Commit a3bcbbee authored by Daniel Mack's avatar Daniel Mack Committed by Anton Vorontsov

pda_power: Add function callbacks for suspend and resume

Add function prototypes for power management events so they can be
handled and used by platform implementations.
Signed-off-by: default avatarDaniel Mack <daniel@caiaq.de>
Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: default avatarAnton Vorontsov <cbouatmailru@gmail.com>
parent b5874f33
...@@ -404,6 +404,13 @@ static int usb_wakeup_enabled; ...@@ -404,6 +404,13 @@ static int usb_wakeup_enabled;
static int pda_power_suspend(struct platform_device *pdev, pm_message_t state) static int pda_power_suspend(struct platform_device *pdev, pm_message_t state)
{ {
if (pdata->suspend) {
int ret = pdata->suspend(state);
if (ret)
return ret;
}
if (device_may_wakeup(&pdev->dev)) { if (device_may_wakeup(&pdev->dev)) {
if (ac_irq) if (ac_irq)
ac_wakeup_enabled = !enable_irq_wake(ac_irq->start); ac_wakeup_enabled = !enable_irq_wake(ac_irq->start);
...@@ -423,6 +430,9 @@ static int pda_power_resume(struct platform_device *pdev) ...@@ -423,6 +430,9 @@ static int pda_power_resume(struct platform_device *pdev)
disable_irq_wake(ac_irq->start); disable_irq_wake(ac_irq->start);
} }
if (pdata->resume)
return pdata->resume();
return 0; return 0;
} }
#else #else
......
...@@ -24,6 +24,8 @@ struct pda_power_pdata { ...@@ -24,6 +24,8 @@ struct pda_power_pdata {
int (*is_usb_online)(void); int (*is_usb_online)(void);
void (*set_charge)(int flags); void (*set_charge)(int flags);
void (*exit)(struct device *dev); void (*exit)(struct device *dev);
int (*suspend)(pm_message_t state);
int (*resume)(void);
char **supplied_to; char **supplied_to;
size_t num_supplicants; size_t num_supplicants;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment