aboutsummaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorBalaji Rao <balajirrao@openmoko.org>2008-12-29 12:11:38 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-12-29 12:11:38 +0000
commitd494163d44eff907dac6bebc22daa586164bdf1e (patch)
tree3f8c6b1b7207bc11efeefe39d3541bbf85b31078 /drivers/power
parent3e96d0a35a3a1e2c7cfef77ec47a63d1f61467dc (diff)
Move charger initialization from core to mbc driver.
When irq_handler is called from core, the irqs might not have been yet registered - which means, the initial charger state was not being set properly. Signed-off-by: Balaji Rao <balajirrao@openmoko.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/pcf50633-charger.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/power/pcf50633-charger.c b/drivers/power/pcf50633-charger.c
index 866972b9ebf..8ade32aa5d1 100644
--- a/drivers/power/pcf50633-charger.c
+++ b/drivers/power/pcf50633-charger.c
@@ -293,6 +293,7 @@ int __init pcf50633_mbc_probe(struct platform_device *pdev)
struct pcf50633 *pcf;
struct pcf50633_mbc *mbc;
int ret;
+ u8 mbcs1;
pcf = platform_get_drvdata(pdev);
mbc = &pcf->mbc;
@@ -364,6 +365,12 @@ int __init pcf50633_mbc_probe(struct platform_device *pdev)
if (ret)
dev_err(pcf->dev, "failed to register ac\n");
+ mbcs1 = pcf50633_reg_read(pcf, PCF50633_REG_MBCS1);
+ if (mbcs1 & 0x01)
+ pcf50633_mbc_irq_handler(pcf, PCF50633_IRQ_USBINS, NULL);
+ if (mbcs1 & 0x04)
+ pcf50633_mbc_irq_handler(pcf, PCF50633_IRQ_ADPINS, NULL);
+
/* Disable automatic charging restart. Manually setting RESUME
* won't have effect otherwise
*/