aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/pda_power.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/power/pda_power.c')
-rw-r--r--drivers/power/pda_power.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c
index 4e1eb040e148..c058f285be1a 100644
--- a/drivers/power/pda_power.c
+++ b/drivers/power/pda_power.c
@@ -97,36 +97,31 @@ static void update_charger(void)
97 dev_dbg(dev, "charger off\n"); 97 dev_dbg(dev, "charger off\n");
98 pdata->set_charge(0); 98 pdata->set_charge(0);
99 } 99 }
100
101 return;
102} 100}
103 101
104static void supply_timer_func(unsigned long irq) 102static void supply_timer_func(unsigned long power_supply_ptr)
105{ 103{
106 if (ac_irq && irq == ac_irq->start) 104 void *power_supply = (void *)power_supply_ptr;
107 power_supply_changed(&pda_power_supplies[0]); 105
108 else if (usb_irq && irq == usb_irq->start) 106 power_supply_changed(power_supply);
109 power_supply_changed(&pda_power_supplies[1]);
110 return;
111} 107}
112 108
113static void charger_timer_func(unsigned long irq) 109static void charger_timer_func(unsigned long power_supply_ptr)
114{ 110{
115 update_charger(); 111 update_charger();
116 112
117 /* Okay, charger set. Now wait a bit before notifying supplicants, 113 /* Okay, charger set. Now wait a bit before notifying supplicants,
118 * charge power should stabilize. */ 114 * charge power should stabilize. */
119 supply_timer.data = irq; 115 supply_timer.data = power_supply_ptr;
120 mod_timer(&supply_timer, 116 mod_timer(&supply_timer,
121 jiffies + msecs_to_jiffies(pdata->wait_for_charger)); 117 jiffies + msecs_to_jiffies(pdata->wait_for_charger));
122 return;
123} 118}
124 119
125static irqreturn_t power_changed_isr(int irq, void *unused) 120static irqreturn_t power_changed_isr(int irq, void *power_supply)
126{ 121{
127 /* Wait a bit before reading ac/usb line status and setting charger, 122 /* Wait a bit before reading ac/usb line status and setting charger,
128 * because ac/usb status readings may lag from irq. */ 123 * because ac/usb status readings may lag from irq. */
129 charger_timer.data = irq; 124 charger_timer.data = (unsigned long)power_supply;
130 mod_timer(&charger_timer, 125 mod_timer(&charger_timer,
131 jiffies + msecs_to_jiffies(pdata->wait_for_status)); 126 jiffies + msecs_to_jiffies(pdata->wait_for_status));
132 return IRQ_HANDLED; 127 return IRQ_HANDLED;
@@ -252,7 +247,6 @@ static int __init pda_power_init(void)
252static void __exit pda_power_exit(void) 247static void __exit pda_power_exit(void)
253{ 248{
254 platform_driver_unregister(&pda_power_pdrv); 249 platform_driver_unregister(&pda_power_pdrv);
255 return;
256} 250}
257 251
258module_init(pda_power_init); 252module_init(pda_power_init);