aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/thinkpad_acpi.c
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2008-01-08 10:02:50 -0500
committerLen Brown <len.brown@intel.com>2008-02-01 22:26:07 -0500
commit083f17606f624c79555e313d87cf37ac1486b073 (patch)
treee317ee9ef9b7cb088ecfcd3dc7cccc2d7b30ab5a /drivers/misc/thinkpad_acpi.c
parent35ff8b9fa90d97f3a19ea3e2311385927535ebc9 (diff)
ACPI: thinkpad-acpi: add suspend handler
Add a handler for suspend events. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc/thinkpad_acpi.c')
-rw-r--r--drivers/misc/thinkpad_acpi.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index dd6fa81fa868..c6c25a460c9c 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -188,6 +188,7 @@ struct ibm_struct {
188 int (*write) (char *); 188 int (*write) (char *);
189 void (*exit) (void); 189 void (*exit) (void);
190 void (*resume) (void); 190 void (*resume) (void);
191 void (*suspend) (pm_message_t state);
191 192
192 struct list_head all_drivers; 193 struct list_head all_drivers;
193 194
@@ -658,6 +659,21 @@ static struct input_dev *tpacpi_inputdev;
658static struct mutex tpacpi_inputdev_send_mutex; 659static struct mutex tpacpi_inputdev_send_mutex;
659static LIST_HEAD(tpacpi_all_drivers); 660static LIST_HEAD(tpacpi_all_drivers);
660 661
662static int tpacpi_suspend_handler(struct platform_device *pdev,
663 pm_message_t state)
664{
665 struct ibm_struct *ibm, *itmp;
666
667 list_for_each_entry_safe(ibm, itmp,
668 &tpacpi_all_drivers,
669 all_drivers) {
670 if (ibm->suspend)
671 (ibm->suspend)(state);
672 }
673
674 return 0;
675}
676
661static int tpacpi_resume_handler(struct platform_device *pdev) 677static int tpacpi_resume_handler(struct platform_device *pdev)
662{ 678{
663 struct ibm_struct *ibm, *itmp; 679 struct ibm_struct *ibm, *itmp;
@@ -677,6 +693,7 @@ static struct platform_driver tpacpi_pdriver = {
677 .name = TPACPI_DRVR_NAME, 693 .name = TPACPI_DRVR_NAME,
678 .owner = THIS_MODULE, 694 .owner = THIS_MODULE,
679 }, 695 },
696 .suspend = tpacpi_suspend_handler,
680 .resume = tpacpi_resume_handler, 697 .resume = tpacpi_resume_handler,
681}; 698};
682 699