Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Daniel Mack <daniel@caiaq.de>
Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>

authored by

Daniel Mack and committed by
Anton Vorontsov
a3bcbbee b5874f33

+12
+10
drivers/power/pda_power.c
··· 404 404 405 405 static int pda_power_suspend(struct platform_device *pdev, pm_message_t state) 406 406 { 407 + if (pdata->suspend) { 408 + int ret = pdata->suspend(state); 409 + 410 + if (ret) 411 + return ret; 412 + } 413 + 407 414 if (device_may_wakeup(&pdev->dev)) { 408 415 if (ac_irq) 409 416 ac_wakeup_enabled = !enable_irq_wake(ac_irq->start); ··· 429 422 if (ac_irq && ac_wakeup_enabled) 430 423 disable_irq_wake(ac_irq->start); 431 424 } 425 + 426 + if (pdata->resume) 427 + return pdata->resume(); 432 428 433 429 return 0; 434 430 }
+2
include/linux/pda_power.h
··· 24 24 int (*is_usb_online)(void); 25 25 void (*set_charge)(int flags); 26 26 void (*exit)(struct device *dev); 27 + int (*suspend)(pm_message_t state); 28 + int (*resume)(void); 27 29 28 30 char **supplied_to; 29 31 size_t num_supplicants;