Some use cases require higher input currents which are out of range
of USB specification.
Fix this by adding a call to disable the input current limit and
warn the user with an adequate message that input current limiting
is disabled when the function is called
CRs-Fixed: 318511
Change-Id: I7e2baa0378c94b0b9af22c00d8605b9df8d4f826
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
The PMIC PM8922 chip is very similar to the PM8921 chip. Modify
the pm8921-core driver so that it can also handle PM8922 chips.
Change-Id: Ibae402ff65d1af4e0f18e4a66304f7ac609065b4
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add the revision mask for PMIC8921 revision 3.0 to avoid
printing unknown PMIC revision in kernel log.
Change-Id: Ied28321866551aecbb1658dda5f17018256254a3
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
Facilitate the driver to support PMICs (such as PM8901)
with different IRQ base address.
Change-Id: I285a9b859b795508620ea6dfd7b5ef6953e7aeb3
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Until now only the BMS system was using the ccadc so there was
no need to create a separate ccadc driver.
However we can run in a configuration with BMS disabled
and clients won't be able to read battery current via ccadc.
Separate the ccadc from the bms, this change in is preparation
to add a ccadc api to read the battery current.
Change-Id: Ib96b146d91d01d196df9291eb23432cd430db4d0
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Use the msm-ssbi driver for communication over
the SSBI interafce.
Change-Id: Ibc26754944c32ac8eaa939f552033974e1a7758f
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Since the driver will be changing the max vdd if the battery
temperature enters warm or cool zone, it should also change
the vbatdet voltage so resume of charging can begin accordingly.
Also provide a means to quickly debug is the battery is in cool/warm
zone.
Change-Id: I0fe83a4fabf76711bf86377c3ac23cceecb6e98b
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Add support for I2C\I2S interface for tabla codec along
With SLIMBUS interface.
Change-Id: Ib0f2ebe62121c1e43a9bdbcaec7621e9d96ac3c4
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
* common/android-3.0: (570 commits)
misc: remove kernel debugger core
ARM: common: fiq_debugger: dump sysrq directly to console if enabled
ARM: common: fiq_debugger: add irq context debug functions
net: wireless: bcmdhd: Call init_ioctl() only if was started properly for WEXT
net: wireless: bcmdhd: Call init_ioctl() only if was started properly
net: wireless: bcmdhd: Fix possible memory leak in escan/iscan
cpufreq: interactive governor: default 20ms timer
cpufreq: interactive governor: go to intermediate hi speed before max
cpufreq: interactive governor: scale to max only if at min speed
cpufreq: interactive governor: apply intermediate load on current speed
ARM: idle: update idle ticks before call idle end notifier
input: gpio_input: don't print debounce message unless flag is set
net: wireless: bcm4329: Skip dhd_bus_stop() if bus is already down
net: wireless: bcmdhd: Skip dhd_bus_stop() if bus is already down
net: wireless: bcmdhd: Improve suspend/resume processing
net: wireless: bcmdhd: Check if FW is Ok for internal FW call
tcp: Don't nuke connections for the wrong protocol
ARM: common: fiq_debugger: make uart irq be no_suspend
net: wireless: Skip connect warning for CONFIG_CFG80211_ALLOW_RECONNECT
mm: avoid livelock on !__GFP_FS allocations
...
Conflicts:
arch/arm/mm/cache-l2x0.c
arch/arm/vfp/vfpmodule.c
drivers/mmc/core/host.c
kernel/power/wakelock.c
net/bluetooth/hci_event.c
Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
Move the following subdevices to use the pm8xxx interface -
mpp, irq, gpio, keypad, power-key, leds, othc, vibrator,
rtc, batt-alarm, thermal, upl, nfc, pwm, xoadc, regulators,
xo-buffers, charger.
This allows usage of a common driver for modules which are same
across multiple PM8XXX PMICs. It also provides flexibility
to add/remove subdevices for multiple board configurations.
Change-Id: Id9795552fc9f4a2c920c070babfaef1f4cd6ca61
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
The API configures the PMIC to ignore the PS_HOLD low
signal, which can be used during debugging.
Change-Id: I162657934e34da081eb897d64ffed36ad48e4eff
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
The API configures PMIC for different behaviour on hard reset.
The different options are to disable hard reset, shutdown or
restart on hard reset.
Change-Id: I214d563e904dd7e73c98a454866718a60a11b6dd
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
* changes:
mfd: pm8xxx-misc: Add pm8xxx watchdog reset control API
mfd: pm8xxx-misc: Add pm8xxx smpl based API's
mfd: pm8xxx-misc: Add the pm8xxx coincell chg API
mfd: pm8xxx-misc: Add a ISR to handle 32 kHz OSC halt
The API configures PMIC to either shutdown or reset
when the PS_HOLD line goes low.
Change-Id: I758531966c08ec5acafaeedea13b59019aafa8bc
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Add APIs to:
1. Configure PMIC to reset/shutdown on a SMPL event
2. Set SMPL delay time
Change-Id: I9e677ebd5b4339b50e7d18e2ba0eb3af694c2d20
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
The API enables/disables the coincell charger. It also configures
the coincell charger's voltage and register settings.
The charger allows the coincell (connected to VCOIN) to charge
from VBAT.
Change-Id: Id3802e37d8100e6a72de9fd263e7d201a7a346d2
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Merge changes from pm8921-adc to pm8xxx-adc. The
changes are modification to the BTM lookup table
to map voltage vs temperature instead of A/D word
vs temperature and reverse calibration on the
input voltage read for BTM. Fix setting the
mpp_scale value to avoid compile error.
This keeps the pm8xxx-adc and pm8921-adc
functional code as the same except for the name
change allowing future patch to remove the
pm8921-adc driver.
Change-Id: I03a0b809cd232f7fe8dff86248651c9a2593be29
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
wcd9310 CODEC supports notification of excessive current
drawn by headphone power amplifiers. When receiving notification
from CODEC through interrupt, this driver reports this event
through soc jack framework. At this point, power amplifiers will
be locked hence no audio can be heard. Locking would be removed
once user-space application deroutes playback out of headphone path.
Change-Id: If5856ead31c9a6b8d918c09f1fdc517a69d4fa26
Signed-off-by: Patrick Lai <plai@codeaurora.org>
Based on tabla platform data update the legacy mode, txfe bypass and
txfe buff mode on tx path.
CRs-Fixed: 308208
Change-Id: I96df7a213578ed8e975030dc8d4b983d03eb6518
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Correct a typo where safety time is used for trickle charge time
in the code.
Add the valid ranges and power on defaults for safety timer and
trickle charge timer.
CRs-Fixed: 313652
Change-Id: I49a04c6445d197555b2a434bf4577b6e38e3d3e3
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
-Change BTM threshold table to map temperature vs
input voltage instead of temperature vs A/D word.
Apply reverse calibration to convert the input
voltage to A/D word.
-Fix representing low/high threshold voltage as
a signed int.
CRs-Fixed: 313653
Change-Id: Ib565c672130f8a246a05636c1353ef0d5b373b7d
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Pass PWM period and other configuration from board file.
Update the LPG LUT based on the duty cycles,
pause count, and period.
Change-Id: Ie1812ae8010d986a943af6f3883b13c25bc7244c
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
The pmic 8921 charger has a limit of 2Amp of charge current. This limit
makes it inadequate to charge multi-cell batteries.
The pm8921 charger supports a configuration where an external charger
with more current capacity may be used to charge the battery while the
pm8921 itself can charge from a USB source. In such a configuration
the external charger source is connected to the DCIN pins, this makes the
pmic detect insertion and removal of the external charger source. In turn
this enables automatic switching on or off the usb charging path when an
external charger is plugged out or in respectively. The pm8921 charger
driver has to call start and stop on external charger. The internal
FSM and logic correctly indicates that it is charging from a DC source.
The resume charging of a fully charged battery when an external source
is present needs to start charging from an external source. The driver
relies on VBATDET comparator to signal a low.
Change-Id: Iab5439ac2408ab061bce477f4d41d7b6a8de9b38
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
PM8921 and PM8018 have a common ADC module. Difference's
are in the channel supported on individual PMIC's and
in the MPP mapping to the ADC device.
MPP configuration on PM8018 is not required. The MPP
is directly connected to the AMUX pre-mux channel.
Change-Id: I9aed3366f20e3985962119274d8b2865b7054a79
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Alarm interrupt causes automatic wakeup even when the phone is in
powerdown state.
Change-Id: If3ae30304adba4f07284a3dc496956d67a1ae1b0
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Instead of hard coding the flag into led driver, pass it
from board file.
While at it, re-factor the code to separate led upstream
core data with board specific data.
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
Conflicts:
drivers/mfd/pm8921-core.c
These new APIs allow a driver to specify its PWM period,
and raw PWM values separately using chip specific
parameters.
Change-Id: I3e9860f30a50d4f3d9c556133761d51858d2a2e3
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
Pmic 8921, has configurable hot and cold battery thresholds as
percent of VREF_THERM. Provide means to configure these via
platform data.
One has to set the config values in the charger platform data defined
in the board file.
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
real_fcc is the remaining capacity in the battery when the charger
driver indicates that the battery is fully charged. This value needs
to be calculated when charging ends with a fully charged battery.
The userspace can read this value via module parameter and preserve it
between restarts.
The real reason for calculating this is to indicate how much the battery
capacity has dropped w.r.t the profiled battery data use this deviation
in calculations.
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
-Add sysfs interface to read PM8921 HK/XOADC
and thermistor temperature measurements mapped
through MPP's.
-Move PM8921 ADC from directory /drivers/mfd to
/drivers/hwmon for userspace clients to read ADC
through hwmon.
CRs-Fixed: 302365
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Conflicts:
drivers/mfd/Kconfig
Use device id passed from platform data to register
for sysfs.
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
Conflicts:
drivers/mfd/pm8xxx-irq.c
Support configuring a MPP to pre-defined AMUX6 channel
which is used for dynamic mapping of the MPP-AMUX channel
for clients having multiple MPP's to read ADC.
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
The userspace should be updated periodically to update it with the
charging progress.
Create a delayed_work and schedule it every update_time milliseconds
to notify the userspace that power supply changed. The userspace
is then supposed to read the power supply properties and know about
the charging progress.
CRs-Fixed: 305572
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Since the BMS can calculate FCC based on the charge cycles and age, use it
to report ENERGY_FULL property in the power supply framework.
CRs-Fixed: 304029
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
The reset interrupt in the pmic indicates the pmic will shutdown
the msm in few seconds - it does so by lowering the reset_n line
to the msm.
When this interrupt is triggered it is required that no more ssbi
transactions are initiated and the msm should cleanup and prepare
for the impending shutdown. There is no need to lower ps_hold in
this case as the pmic will shutdown the msm regardless.
Also since we don't want any ssbi transactions, force shutdown
nonboot cpus. This will prevent ssbi transactions to the pmic for
lower/raising nonboot cpu's voltages as they enter/exit idle states.
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Currently the battery data is passed via the board file. Instead
read the battery id and choose the appropriate battery data to use.
CRs-Fixed: 304376
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
-Modify the existing PM8921 ADC read api to include
reading ADC mapped to devices on the MPP.
-Modify scaling function to support XOTHERM and PATHERM
on PM8921.
-Remove post scaling functions for external charger
as its not used on PM8921.
CRs-Fixed: 307164
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Add support for the Qualcomm PM8018 PMIC chip. The core driver
will communicate with the PMIC chip via the MSM SSBI bus.
Initial support is provided for: IRQ, GPIO, MPP, RTC, Power Key,
Misc, and Debug
Signed-off-by: David Collins <collinsd@codeaurora.org>