The wcd9310 codec driver which is slimbus slave can access codec
registers when slimbus is suspended.
This can cause register read/write failure.
Fix to make sure slimbus is awake before accessing wcd9310 codec's
registers through slimbus.
CRs-fixed: 331338
Change-Id: Iddbdb1614c18dab4bee4f0cc7951884f34cb7173
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Add leds as a sub device to pmic 8038. This will also
take care of filling platform data for leds driver
which comes as part of pmic pdata.
Change-Id: I3814a0f36f79612684e4a2305e3c5c19dc64cb00
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
Unlike Tabla 1.x, Tabla 2.0 codec has different address of micbias 4
registers.
Check hardware version and access proper address when accessing
micbias 4 registers.
CRs-fixed: 330357
Change-Id: I5e12a6b15e82b00d2e238c21d795fdc189ead6a5
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Specify the SSBI test register address for each of the voltage
switches in PMIC 8018, 8038, and 8921 core drivers. This will
allow for future handling of over current protection (OCP) in
the pm8xxx-regulator driver.
Also define the OCP IRQs associated with each of the switches
on these PMICs.
Change-Id: Icfc51c01680e6e95b4348051c764f16cb91b4916
Signed-off-by: David Collins <collinsd@codeaurora.org>
PM8921 family provides a pullup enable bit to support USB ID.
Add the API for such support.
Change-Id: Id3056af070080c1c12f27720020ae718fc6f34f6
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
Add pre-divide=6 and update the max period based on new pre-divide.
Also update pre-divide related macros for better readability.
Change-Id: I5298c373c78f8723dab9a735e4d94f89798800d5
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
The current code assumes that the cool or warm battery temperature
can only be +ve numbers. Remove this restriction by allowing -ve
temperature settings.
Change-Id: I3c54b854a8fdf934efcf1ff21b36c7a0f763692a
CRs-Fixed: 320660
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
The PMIC PM8917 chip is very similar to the PM8921 chip. Modify
the pm8921-core driver so that it can also handle PM8917 chip
which has different number of gpios and mpps, and no LPG/PWM,
no LEDs and no vibrator.
Change-Id: I252adc2ddc4bcd9bb8b8fb5113444356ba7c969e
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
Add a new API, pm8xxx_preload_dVdd, which will preload the dVdd
regulator on PMIC PM8901 chips during off state. This can help
to reduce fluctuations in the dVdd voltage during startup at the
cost of additional off state current draw.
This API should only be called if dVdd startup issues are
suspected.
Change-Id: Ic7ee60539de37a761bb9ca6c5200327a7b99da89
CRs-Fixed: 326086
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add supported power devices such as charger, bms and CCADC.
These devices are required to be enabled to provide charging
functionality to the 8930 platform.
Change-Id: Iae5182ff26ba1cbcb256aeb1aee619f7a368765f
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
Allow the pm8921-charger driver to initiate charging on a
registered 3rd party charging driver through the power supply class.
Also enable the maintenance of charging properties such as online
and charge type using the power supply class rather than
directly depending on the 3rd party driver.
When a external charger is registered using power_supply_register
the external_power_changed callback of the charger driver checks
for an external charger named "dc". This removes the dependency
of a 3rd party charger to call directly into the charger driver.
Also, update the isl9519q driver to reflect the changes and
utilize power supply class calls to enable charging
on the isl chip from PM8921 charger driver.
This serves as an example for other 3rd party external
chargers supporting PMIC with high current charging.
Finally, add pr_fmt macro which automatically adds function name
to print statements and remove __func__ from individual print
statements.
Change-Id: If05e598be260d924ec3263bad33317cf4e7543a1
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
HouseKeeping ADC (HKADC) on the PMIC is used by clients
to measure voltage, current and temperature. Clients
include the Battery, Charger and Thermal clients that
require reading the ADC in real time. This also
supports reading the ADC channels that are mapped through
the PMIC MPP's such as the PA THERM channel.
Change-Id: I3c4fd9d368550c1cca168ea097e0d457d01d695e
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
USB can distinguish between types of USB connections such as a
DC charger or PC connection.
Let the USB drivers set the specifc power_supply_type via this
function.
CRs-Fixed: 326548
Change-Id: I31954b3f8d2b1e5fd72712e1f94f67fdbc2e205d
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
Change the pm8018-core driver so that it registers devices for
the pm8xxx-regulator driver instead of for the pm8018-regulator
driver.
This necessitates changing board file platform data for existing
PMIC 8018 regulators so that additional pm8xxx-regulator data is
properly specified.
Change-Id: I3f64f756a6c48c0dd1684f8d8e98a6fa8dddd6ca
Signed-off-by: David Collins <collinsd@codeaurora.org>
Some board configurations have different needs for usb overvoltage
thresholds and debounce time for usb detection.
Provide apis to program threshold voltage, debounce time and
disable/enable overvoltage protection.
CRs-Fixed: 324137
Change-Id: Ie618ca12be819739a623cf41e5e1198305467aa5
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Add pm8xxx-regulator configuration data into the pm8038-core
driver. This adds support for PMIC PM8038 regulators.
Change-Id: I8d6e42d299141a6add3c41ca920d9186ad7fa3ee
Signed-off-by: David Collins <collinsd@codeaurora.org>
Change the pm8921-core driver so that it registers devices for
the pm8xxx-regulator driver instead of for the pm8921-regulator
driver.
This necessitates changing board file platform data for existing
PMIC 8921 regulators so that additional pm8xxx-regulator data is
properly specified.
Change-Id: I0d48f03344265bd1b7c160bceca944f8924c694c
Signed-off-by: David Collins <collinsd@codeaurora.org>
Create a PM8XXX regulator driver that can support PMIC PM8921
variants including: PM8018, PM8038, and PM8921.
Change-Id: I60d1302e4af9a4c5caa72301c904867acd2ebe0f
Signed-off-by: David Collins <collinsd@codeaurora.org>
pm8xxx_hard_reset_config implements the required functionality,
replace the pm8058 specific call with this.
Remove ssbi_read/ssbi_write functions used in pm8058_hard_reset_config.
Remove unused variable(pm_lock) and enum(pon_config, pm8058_smpl_delay).
Change-Id: I3c5982ebab9277dc088bd3abd5621eb9acf3add9
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
pm8xxx_stay_on implements the required functionality internally.
Modify other occurrences of pm8058_stay_on to pm8xxx_stay_on.
Change-Id: I1c4d932789c6b5592bcbc6fc718d037f188d0e56
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Modify the scaling function routines for Battery temperature
and all channels whose units return milli-volts for voltage.
The Charger driver requires the Units of Voltage and temperature
in uV and 0.1 DegC according to the framework where all voltages,
currents, chargers, energies, time and temperature are in uV, uA,
uAh, uWh, seconds and tenths of degree Celsius unless otherwise
stated. In accordance with the above expected units, the scaling
functions are modified for all voltage channels and the Batt Therm.
This change fixes the XO Therm temperature scaling routine,
PA Therm and Batt id to use the ratiometric calibration.
XO Therm and PA therm units are returned as milli-degree and
degree Centigrade respectively.
Accordingly, update the clients of xoadc to handle this change in
units.
CRs-Fixed: 315797
Change-Id: I6fa3b808062563fef3b0e70cc694e3132421f735
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
These APIs are implemented as a part of pm8xxx_reset_power_off,
pm8xxx_smpl_*, pm8xxx_watchdog_reset_control APIs in the pm8xxx-misc
driver.
Change-Id: I8eaf83e0c4d3551d16ecc7fc94c62514711b9a7d
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
* changes:
power: pm8921-bms: expose start and end charging parameters
power: pm8921-bms: refactor BMS driver code
power: pm8921-bms: force max_voltage at end of charge
pm8901_reset_power_off is implemented as a part of
pm8xxx_reset_power_off (pm8xxx-misc driver).
Remove other functions (ssbi_read/ssbi_write) used only
by pm8901_reset_power_off.
Change-Id: Iad754e827061627cea55a4d6d1b7600c0cf64441
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Misc driver supports global functions such as
pm8xxx_reset_power_off, pm8xxx_hard_reset_config.
Change-Id: Ic20482e693002ae97c31cc476bc52ad3f99891f7
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Significant sleep current is seen with BTM enabled during suspend.
Fix this by disabling BTM before entering suspend and re-enable it
on resume. A board file option may be added to disable this feature.
By default battery temperature monitoring will be turned off on
suspend.
Change-Id: I6614dc076d8ea69f25840dd3eeef94f9739e392f
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
When an end of charge with a full battery happens, the bms driver
fakes max ocv and zero cc. To force max ocv the driver currently
assumes that the first row last column will have the highest profiled
voltage. This may not be true always.
Pass the maximum voltage from platform data and use that to force
max ocv.
Change-Id: I29c71a20648fb2f9066f2f82e14a6080692c63fd
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Move the following subdevices to use the pm8xxx interface -
mpp, irq, thermal, regulators.
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: I6478ec1b99b1ab55ca370d314dbeb590103a4b1c
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Add support for the Qualcomm PM8038 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.
Change-Id: I83f995cc238699100a05e82d04b45ea2a63eb667
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
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>