Commit Graph

421 Commits

Author SHA1 Message Date
David Keitel
012deefa0b power: pm8921-charger: Allow disabling of input current limit
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>
2011-12-05 12:23:44 -08: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
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
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
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
Linux Build Service Account
df0f40090a Merge "power: pm8921-charger: use resume_voltage_delta" into msm-3.0 2011-11-21 10:14:36 -08:00
Anirudh Ghayal
c49157f837 msm: 8660: Add ssbi device for PM8901
Use the msm-ssbi driver for communication over
the SSBI interafce.

Change-Id: Ibc26754944c32ac8eaa939f552033974e1a7758f
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2011-11-21 10:06:00 +05:30
Abhijeet Dharmapurikar
d55878e749 power: pm8921-charger: use resume_voltage_delta
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>
2011-11-20 19:32:40 -07:00
Santosh Mardi
e15e230fcf ASoC: wcd9310: add I2C\I2S support for tabla codec
Add support for I2C\I2S interface for tabla codec along
With SLIMBUS interface.

Change-Id: Ib0f2ebe62121c1e43a9bdbcaec7621e9d96ac3c4
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
2011-11-18 03:06:26 +05:30
Bryan Huntsman
d074fa2796 Merge remote-tracking branch 'common/android-3.0' into msm-3.0
* 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>
2011-11-16 13:52:50 -08:00
Anirudh Ghayal
c2019339bc mfd: pm8058: Modify pm8058 subdevices to pm8xxx interface
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>
2011-11-16 19:06:11 +05:30
Anirudh Ghayal
51e947f6f5 mfd: pm8xxx-misc: Add pm8xxx stay on API
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>
2011-11-14 08:19:17 +05:30
Anirudh Ghayal
a4262a3821 mfd: pm8xxx-misc: Add pm8xxx hard reset config API
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>
2011-11-14 08:19:05 +05:30
Linux Build Service Account
27e8d53719 Merge changes I75853196,I9e677ebd,Id3802e37,Ic3fe2733 into msm-3.0
* 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
2011-11-13 13:30:25 -08:00
Linux Build Service Account
72a2b5ddf5 Merge "hwmon: pm8xxx-adc: Merge pm8921-adc and pm8xxx-adc" into msm-3.0 2011-11-11 21:45:05 -08:00
Anirudh Ghayal
a23c1cabcc mfd: pm8xxx-misc: Add pm8xxx watchdog reset control API
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>
2011-11-12 06:14:34 +05:30
Anirudh Ghayal
bfbaf82d21 mfd: pm8xxx-misc: Add pm8xxx smpl based API's
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>
2011-11-12 06:14:14 +05:30
Anirudh Ghayal
7b3822911a mfd: pm8xxx-misc: Add the pm8xxx coincell chg API
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>
2011-11-12 06:13:39 +05:30
Siddartha Mohanadoss
ae39c90df6 hwmon: pm8xxx-adc: Merge pm8921-adc and pm8xxx-adc
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>
2011-11-09 22:07:10 -08:00
Patrick Lai
49efeaccb1 ASoC: wcd9310: add headphone over current protection feature
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>
2011-11-09 10:19:16 -08:00
Linux Build Service Account
30dbf3483f Merge "hwmon: pm8921-adc: Add reverse calibration for BTM" into msm-3.0 2011-11-03 15:35:08 -07:00
Santosh Mardi
2292028c22 ASoC: wcd9310: Update legacy mode, txfe controls based on platform data
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>
2011-11-03 13:28:59 -06:00
Abhijeet Dharmapurikar
e45c3d38a6 power: pm8921-charger: use trickle time for trickle charging
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>
2011-11-01 16:28:57 -06:00
Siddartha Mohanadoss
b377415f17 hwmon: pm8921-adc: Add reverse calibration for BTM
-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>
2011-11-01 11:17:45 -07:00
Anirudh Ghayal
5213eb8787 mfd: pm8xxx-misc: Add uart gpio mux control API
CRs-Fixed: 313982
Change-Id: I10ea5283271619f0ae510ad7039e0df8b1745f57
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2011-10-31 11:19:34 +05:30
Linux Build Service Account
cf5a9faf69 Merge "power: pm8921-charger: enable external charger" into msm-3.0 2011-10-27 14:35:52 -07:00
Jay Chokshi
868312e934 leds: pm8xxx: Add PWM feature in leds-pm8xxx
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>
2011-10-26 12:23:49 -07:00
Amir Samuelov
d31ef501b8 power: pm8921-charger: enable external charger
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>
2011-10-26 14:41:36 +02:00
Jay Chokshi
e91f55cdb5 mfd: 8018: Add led and pwm devices
Change-Id: I92b9f6956aac24cef8898ce59263dd80b5b30d3f
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
2011-10-21 10:39:28 -07:00
Siddartha Mohanadoss
5bcd20614d mfd: pm8018: Add PM8018 ADC resource
Change-Id: I6a4df32671b95070cdb719d80767f0ffde8cd40a
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2011-10-20 18:07:37 -07:00
Siddartha Mohanadoss
17607d277e hwmon: pm8xxx-adc: Add PM8018 ADC Driver
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>
2011-10-18 09:22:12 -07:00
Linux Build Service Account
d02d1db765 Merge "drivers: rtc-pm8xxx: Fix automatic wakeup of APPS due to RTC alarm." into msm-3.0 2011-10-17 03:47:33 -07:00
Anirudh Ghayal
9d9cdc218c msm: Add msm-ssbi devices for PM8058 on supported targets
Supported targets are msm8660, msm7x30 and fsm9xxx

Change-Id: I1d21b73ba67c6769441658e648c32204c72754d3
Acked-by: Kaushik Sikdar <ksikdar@qualcomm.com>
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2011-10-17 12:53:07 +05:30
Ashay Jaiswal
d66c9d51b2 drivers: rtc-pm8xxx: Fix automatic wakeup of APPS due to RTC alarm.
Alarm interrupt causes automatic wakeup even when the phone is in
powerdown state.

Change-Id: If3ae30304adba4f07284a3dc496956d67a1ae1b0
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
2011-10-17 11:08:37 +05:30
Jay Chokshi
8994e39bcd leds-pm8xxx: Pass LED flags from board file
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
2011-10-11 09:59:29 -07:00
Jay Chokshi
4acbdd5c37 mfd: pm8xxx-pwm: add two APIs
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>
2011-10-06 09:27:50 -07:00
Abhijeet Dharmapurikar
0f0242353f power: pm8921-charger: config cold/hot threshold
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>
2011-10-05 10:36:45 -07:00
Abhijeet Dharmapurikar
fad7235d01 power: pm8921-bms: calculate real_fcc
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>
2011-10-05 10:35:51 -07:00
Siddartha Mohanadoss
77d106ea89 hwmon: pm8921-adc: Add sysfs interface
-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
2011-10-04 17:14:12 -07:00
Jay Chokshi
1097519e8b mfd: pm8xxx-irq: Set unique dev id for sys device
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
2011-10-03 16:21:25 -07:00
Siddartha Mohanadoss
0f063b8670 mfd: pm8921-adc: Add configure and read from MPP ADC
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>
2011-10-03 16:21:08 -07:00
Abhijeet Dharmapurikar
33fe6fb63c power: pm8921-charger: update userspace per update_time milliseconds
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>
2011-10-03 16:21:06 -07:00
Abhijeet Dharmapurikar
325bdc9937 power: pm8921-bms: report FCC
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>
2011-10-03 16:21:05 -07:00
Abhijeet Dharmapurikar
6d565fdf7a msm: restart: Handle reset interrupt from pmic
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>
2011-10-03 16:20:55 -07:00
Abhijeet Dharmapurikar
e922bbba5c power: pm8921-bms: use battery data based on battery id
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>
2011-10-03 16:20:20 -07:00
Siddartha Mohanadoss
a0f5121b96 mfd: pm8921-adc: Fix scaling and PM8921 MPP ADC read
-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>
2011-10-03 16:20:09 -07:00
David Collins
b909f239f1 mfd: pm8018: Add support for PM8018 regulators into PM8018 core
Signed-off-by: David Collins <collinsd@codeaurora.org>
2011-10-03 16:20:06 -07:00
David Collins
fdefdf941f mfd: pm8018: Add PMIC 8018 core driver
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>
2011-10-03 16:20:04 -07:00