980 Commits

Author SHA1 Message Date
Joonwoo Park
816b8e6e04 ASoC: wcd9310: Prevent from going suspend while accessing codec registers
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>
2012-02-09 16:14:20 -08:00
Amy Maloche
8950101583 mfd: pm8038-core: Add support for LEDs on pmic 8038
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>
2012-02-08 10:46:50 -08:00
Jay Chokshi
3f8463cec2 mfd: 8821: Amend the value of a macro
Update PMIC version macro with the right value.

Change-Id: I48391ca0a3745d5b04d5d4c7dd6e7ccad250fafb
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
2012-02-06 21:16:38 -08:00
Joonwoo Park
6c1ebb6226 ASoC: wcd9310: Use correct address of MICB4 registers
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>
2012-02-04 23:12:35 -08:00
David Collins
1b570d26b8 mfd: pmic: Add voltage switch test registers to PMIC core drivers
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>
2012-02-03 11:07:23 -08:00
Linux Build Service Account
98009d81e1 Merge "mfd: pm8xxx-misc: add pm8xxx_usb_id_pullup API" into msm-3.0 2012-02-01 10:37:20 -08:00
Willie Ruan
5db1f24037 mfd: pm8xxx-misc: add pm8xxx_usb_id_pullup API
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>
2012-02-01 14:11:04 +05:30
Jay Chokshi
0c220cd9bc mfd: pm8xxx-pwm: Add support for PM8038
Adapt the driver to take into consideration LPG
architecture of pmic 8038 and 8922. It does not
support 7-bit mode yet.

Change-Id: Ibfca90aae6fd9c90025af5364e1dcaf4a8bb3033
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
2012-01-30 11:23:49 -08:00
Willie Ruan
b10be97df4 mfd: pm8xxx-pwm: add pre-divide=6 and update macros
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>
2012-01-30 11:23:49 -08:00
Linux Build Service Account
25774b80e5 Merge "mfd: pm8xxx-irq: mask non requested interrupt" into msm-3.0 2012-01-29 09:27:41 -08:00
Abhijeet Dharmapurikar
9d10de3ef3 mfd: pm8xxx-irq: mask non requested interrupt
When a non requested interrupt triggers, the genirq ends up calling
mask or mask_ack callback. This callback is expected to mask that
interrupt so it doesn't trigger us further.

There is a bug in the pm8xxx-irq driver where config[] entry for an
unrequested irq remains empty. So the mask or the mask_ack callback
ends up masking 0th interrupt.

Fix the mask and mask_ack callback to check if config[] is empty, if
so fill it in right then and mask the irq.

Change-Id: I85d3bfff92c52a1c3eb8123a9c3757660e20fac6
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2012-01-26 21:22:00 -08:00
Willie Ruan
5106035d9a mfd: pm8921-core: Add support for PMIC PM8917 chip
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>
2012-01-25 14:21:54 -08:00
David Collins
4724272b4b mfd: pm8xxx-misc: add an API to preload the dVdd regulator
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>
2012-01-20 11:34:58 -08:00
Linux Build Service Account
600490f99e Merge "msm: qdsp6v2: Invalid memory access of timpani regset array" into msm-3.0 2012-01-19 22:42:18 -08:00
Santosh Mardi
efd780d21a msm: qdsp6v2: Invalid memory access of timpani regset array
Adie codec write is accessing out of memory bound for
timpani regset array.

CRs-Fixed: 330562
Change-Id: I98f46d3b59c76ccfaf5edd6c04d1df01d431ef01
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
2012-01-18 17:08:53 +05:30
David Keitel
b0f4036c4a mfd: pm8038-core: enable bms and charger devices
Enable charger and bms devices to make sure they are probed
on 8930.

Change-Id: I4917de40a672628bab868260b280cfb580668e4e
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
2012-01-17 14:55:23 -08:00
Willie Ruan
4a0a700e51 mfd: pm8xxx-pwm: simplify period search algorithm
Compare each search result (cur_err) directly with the best
result (best_err) without using local result in the loop for m.
This simplifies the code and makes it cleaner.

Change-Id: Icb6d19e1a14662b00bf7172ca6a7413fbe969cbc
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
2012-01-12 15:40:18 -08:00
Willie Ruan
db78e94440 mfd: pm8xxx-pwm: correct the 1KHz clock value
1kHz clock in PWM module is 1024Hz, instead of 1000Hz.
It is derived from sleep clock,

Change-Id: Ifd61985469fc485e913fe5474e422e53746f784d
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
2012-01-12 13:56:56 -08:00
Willie Ruan
9f5488df9f mfd: pm8xxx-pwm: simplify code by eliminating macros
Simplify period preprocessing to favor n=9 for big period_us.
This removes MAX_MPT here with no disadvantage. Also remove
MAX_MPT as initial min_err because it doesn't have advantage
over using maximum unsigned integer value.

Change-Id: Ie905922802ed88f322a627b1a89f4c00cc214459
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
2012-01-12 13:40:32 -08:00
Willie Ruan
70f989db30 mfd: pm8xxx-pwm: fix an overflow bug
The overflow could be the multiplication (period_us * NSEC_PER_USEC)
in next line, rather than at the 6-bit max period value. So we should
use the max unsigned int value as boundary.

Change-Id: Ida753d752a8ca144b4c158e1a6ed505077de98ea
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
2012-01-11 09:13:35 -08:00
Linux Build Service Account
ec3c193aa6 Merge changes I4973b80b,I3c4fd9d3 into msm-3.0
* changes:
  msm: 8930: Add ADC clients
  mfd: pmic8038-core: Add HK/XOADC device
2012-01-09 17:18:37 -08:00
Siddartha Mohanadoss
ef10213c2f mfd: pmic8038-core: Add HK/XOADC device
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>
2012-01-06 18:15:08 -08:00
Eugene Yasman
ff64af17ad Revert "mfd: pm8921: Set PMIC PON reset detection time to 3 seconds"
This reverts commit 39405edcf0.

Change-Id: I2d4bd92e0899b9c849861d3dac348db2e838b755
Signed-off-by: Eugene Yasman <eyasman@codeaurora.org>
2012-01-05 00:35:47 +02:00
David Collins
8c695c5096 mfd: pm8018-core: use pm8xxx-regulator instead of pm8018-regulator
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>
2011-12-29 06:37:34 -08:00
Linux Build Service Account
286e9e0b31 Merge changes I8d6e42d2,I0d48f033 into msm-3.0
* changes:
  mfd: pm8038-core: add pm8xxx-regulator device configuration data
  mfd: pm8921-core: use pm8xxx-regulator instead of pm8921-regulator
2011-12-28 08:41:18 -08:00
Bryan Huntsman
cc147036b8 msm: fix MSM_SHOW_RESUME_IRQ selection
Drivers should not be selecting features from any particular
architecture.  For MSM_SHOW_RESUME_IRQ, allow it to be configured per
feature that uses it, not per architecture.

Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
2011-12-27 23:32:41 -07:00
David Collins
045a76e605 mfd: pm8038-core: add pm8xxx-regulator device configuration data
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>
2011-12-27 06:29:14 -08:00
David Collins
7501674da4 mfd: pm8921-core: use pm8xxx-regulator instead of pm8921-regulator
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>
2011-12-27 06:29:14 -08:00
Linux Build Service Account
ffe4c27017 Merge changes Ie4293847,I050635b7 into msm-3.0
* changes:
  mfd: wcd9310: Make tabla interrupt line to be wakeable
  mfd: wcd9310: Retry read/write on failure
2011-12-22 01:02:15 -08:00
Anirudh Ghayal
0c72b8462e mfd: pmic8058: Remove pm8058_hard_reset_config implementation
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>
2011-12-19 09:21:39 +05:30
Anirudh Ghayal
33d93bf02c mfd: pmic8058: Remove pm8058_stay_on implementation
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>
2011-12-19 08:57:02 +05:30
Anirudh Ghayal
49ca45badc mfd: pmic8058: Remove reset_pwr_off, smpl control and WD reset control APIs
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>
2011-12-16 13:34:47 +05:30
Joonwoo Park
4669aa3f5d mfd: wcd9310: Make tabla interrupt line to be wakeable
Tabla hardware needs to wake up CPU by interrupt for headset
insertion/removal/button press functionalities.
Make Tabla's interrupt line as wakeable interrupt so driver gets
interrupt while CPU is suspend mode.

CRs-Fixed: 318317
Change-Id: Ie42938478ad66cb108a01abea1d0b01df7485e8b
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2011-12-15 17:28:46 -08:00
Joonwoo Park
37cb6a2d9d mfd: wcd9310: Retry read/write on failure
There can be instance that slimbus read or write fails due to slimbus
clock not turning back on time.
Wait 5ms if driver fails to read/write and retry.

Change-Id: I050635b7dad9ad282040f0563d3c44124e1327c7
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2011-12-15 17:28:46 -08:00
Anirudh Ghayal
f0b9ad0864 mfd: pmic8901: Remove pm8901_reset_power_off implementation
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>
2011-12-15 08:19:28 +05:30
Anirudh Ghayal
934b2717fb mfd: pmic8901: Add pm8xxx-misc mfd device
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>
2011-12-15 08:19:27 +05:30
Anirudh Ghayal
1fd48c6e08 mfd: pm8xxx-misc: Add delay after disabling regulators in shutdown function
Add delay after disabling each FTSMPS regulator in
__pm8901_reset_pwr_off.  Add additional delay between disabling the
last regulator and when PS_HOLD is lowered to shutdown or restart
the system.

This delay is necessary to limit transient loading on LDO 7 and
dVdd regulators during the PMIC power off sequence.

Change-Id: I0a833f47164cf7c4ba1d0ae1f73c14b595908b3a
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2011-12-15 08:19:27 +05:30
Anirudh Ghayal
9f77e968dd mfd: pm8901: Modify pm8901 subdevices to pm8xxx interface
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>
2011-12-12 13:43:27 -08:00
Linux Build Service Account
5a042f7509 Merge "mfd: timpani-codec: Making AUXPGA gain register as uncacheable" into msm-3.0 2011-12-12 00:58:36 -08:00
Jay Chokshi
9d36a3d457 mfd: pm8038: Add PMIC 8038 core driver
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>
2011-12-09 17:24:27 -08:00
Eugene Yasman
39405edcf0 mfd: pm8921: Set PMIC PON reset detection time to 3 seconds
Shorten the default PMIC reset detection time.

Change-Id: Ia29c429e43b12698496b1cab4e808dbac7821ec0
Signed-off-by: Eugene Yasman <eyasman@codeaurora.org>
2011-12-07 13:50:21 +02:00
David Collins
999480d505 mfd: pm8921-core: Add support for PMIC PM8922 chips
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>
2011-12-02 01:22:32 -07:00
Siddartha Mohanadoss
af91d9056d hwmon: pm8xxx_adc: Remove pm8921-adc
Switch clients to use pm8xxx-adc and remove pm8921-adc.
pm8xxx-adc supports PMIC HK/XOADC for 8960, 9x15, 8064
platforms.

Change-Id: Id27fa908cc097d52e6033c28ce243c6bcf64ed27
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2011-12-01 04:35:59 -07:00
Linux Build Service Account
75f5755b49 Merge "mfd: pmic8901: Add delay after disabling regulators in shutdown function" into msm-3.0 2011-11-29 21:20:56 -08:00
David Keitel
70251b0b81 mfd: pm8921-core: PMIC 8921 rev 3.0 revision mask
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>
2011-11-28 14:50:02 -08:00
Vinay Vaka
df2d0214ed mfd: timpani-codec: Making AUXPGA gain register as uncacheable
AUXPGA LR gain register is treated as a cacheable with which the
register value is changed when device is opened twice. So making
the LR gain register as uncacheable which in turn apply the gain
value to the codec every time device is opened.

CRs-Fixed: 319366
Change-Id: Ibae39848bd05d8462e805cf79c352f2453dc86f4
Signed-off-by: Vinay Vaka <vvaka@codeaurora.org>
2011-11-25 11:15:25 +05:30
Anirudh Ghayal
ca42c7dec9 mfd: pm8xxx-irq: Provide the IRQ base address through core data
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>
2011-11-22 21:26:33 +05:30
Linux Build Service Account
f756be5b27 Merge "ASoC: wcd9310: add I2C\I2S support for tabla codec" into msm-3.0 2011-11-22 06:35:56 -08:00
David Collins
88ebc9c1fb mfd: pmic8901: Add delay after disabling regulators in shutdown function
Add delay after disabling each FTSMPS regulator in
pm8901_reset_pwr_off.  Add additional delay between disabling the
last regulator and when PS_HOLD is lowered to shutdown or restart
the system.

This delay is necessary to limit transient loading on LDO 7 and
dVdd regulators during the PMIC power off sequence.

Change-Id: Ia95894a6a032a254b7ca3f8a251b4984e1432818
Signed-off-by: David Collins <collinsd@codeaurora.org>
2011-11-21 11:46:19 -08:00
Abhijeet Dharmapurikar
82d939848f power: pm8xxx-ccadc: Add pm8xxx ccadc subdevice
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>
2011-11-21 11:21:31 -07:00