Commit Graph

16 Commits

Author SHA1 Message Date
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
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
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
f1f1e14377 mfd: pm8058: Use msm-ssbi interface instead of i2c-ssbi
Change-Id: I620c23a993c17c78333776c650307872bbadea4e
Acked-by: Kaushik Sikdar <ksikdar@qualcomm.com>
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2011-10-17 12:53:16 +05:30
Jay Chokshi
898340fb21 mfd: pmic: Fix memory leak in debug probe
Free the debug device allocated before an
unsuccessful exit, both in pmic8058 and
pmic8901.

CRs-fixed: 308192
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
2011-10-11 09:59:25 -07:00
Abhijeet Dharmapurikar
bb23a055a0 mfd: pmic8058: Ack interrupts before handling them
There could be a case where
- ADC interrupt is handled and a next request is queued up
- The interrupt thread  gets scheduled out just before acking the interrupt
- ADC hardware completes the queued request and raises the next interrupt
- The interrupt thread now gets a chance to run and acks the adc interrupt.
  Note this acks the next interrupt.

The above sequence of events leads to lost interrupts. Ack the interrupt
before calling the handle_nested_irq. If next interrupt is raised while the
current one's handler is still running, it will cause another invocation of
the interrupt handler to run.

Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2011-10-03 16:21:10 -07:00
Abhijeet Dharmapurikar
a4a3eaf44a mfd: pmic8058: shutdown on hard reset
When the pmic initiates shutdown (probably because the temperature
went to high or resin_n line to pmic was lowered), the default action
is to restart the device.

Override this default configuration which means do not restart
the device when pmic hard reset happens.

Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>

Conflicts:

	drivers/mfd/pmic8058.c
2011-10-03 16:20:55 -07:00
Abhijeet Dharmapurikar
76a1964091 mfd: pmic8058: ack an handled interrupt immediately
Currently the pmic interrupt thread handles all the interrupts
and later clears all those interrupts at once.

A problem was observed with this approach. The adc interrupt handler
could start another conversion and if the conversion finishes before
the pmic interrupt thread clears them, it ends up clearing the new
interrupt too.

Fix it by clearing the interrupt as soon as the handler is called.

Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2011-10-03 16:17:34 -07:00
Abhijeet Dharmapurikar
a346e2c8bc mfd: pmic8058: avoid unmasking enabled irq
If an interrupt was already unmasked previously, don't unmask it
unnecessarily. This will avoid loosing the interrupt if it were
pending.

Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2011-10-03 16:17:33 -07:00
Willie Ruan
6a3c91408d mfd: pmic8058: add pm8058_stay_on API
PMIC stay-on feature allows PMIC to ignore MSM PS_HOLD=low
signal so that some special functions like debugging could be
performed.

This feature should not be used in any product release.

Signed-off-by: Willie Ruan <wruan@codeaurora.org>
2011-10-03 10:28:53 -07:00
Abhijeet Dharmapurikar
a3c0d94209 mfd: pmic8058: fix for lost adc interrupt
An issue of missing interrupt was observed while resuming the device.
The msm_charger resume called adc conversion to get the battery
voltage.  The adc conversion function enables the interrupt and
starts the conversion.  Then pmic8058_resume gets called now which
re-enables the adc interrupt causing the pending bit to drop. With
the ADC EOC interrupt missed, the msm_charger does not receive a
completion event, causing a watchdog timeout.

The pmic8058 irq module has a hardware bug where writing to the config
bits clears the pending status of the interrupt.

Fix it using a sysdev where the pmic interrupts are switched before
any of the subdevices resume and use nonwakeup interrupts. Since
in sysdev resume we only enable non wakeup interrupts the status of
wakeup interrupts remains intact.

CRs-Fixed: 295261
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2011-10-03 10:27:05 -07:00
David Collins
0a91160b3c mfd: pm8058: Locally disable regulators S0/1/3 and L21 during shutdown
When shutting down or restarting, PMIC 8058 regulator S0, S1, S3 and
L21 need to be managed manually. Since the master enable bits for these
regulators are kept set, the local enable bits should be unset and the
active pull-down must be enabled. Any regulators in advanced mode
should be disabled as well. This regulator state ensures that
these regulators drops as expected when PS_HOLD is dropped.

CRs-Fixed: 295731
Signed-off-by: David Collins <collinsd@codeaurora.org>
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
2011-10-03 10:25:45 -07:00
David Collins
17c5a94f1b mfd: pm8058: remove mutex locking from pm8058_masked_write function
Remove mutex_lock and mutex_unlock from pm8058_masked_write.  This
will allow pm8058_reset_pwr_off to call pm8058_mask_write while in
atomic context.

Signed-off-by: David Collins <collinsd@codeaurora.org>
2011-10-03 09:59:10 -07:00
Bryan Huntsman
3f2bc4d6eb Initial Contribution
msm-2.6.38: tag AU_LINUX_ANDROID_GINGERBREAD.02.03.04.00.142

Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
2011-10-03 09:57:10 -07:00