aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2007-07-18 22:45:37 -0400
committerLen Brown <len.brown@intel.com>2007-07-21 23:46:08 -0400
commite295e8508c1dd56e06c73e78a2f67f2eb563e74f (patch)
tree076ac3317d2158e76d1326912f190c354f895b65 /drivers/misc
parent1a343760b516ca5466d201bec32b1794858b18a5 (diff)
ACPI: thinkpad-acpi: add power-management handler capability
Some subdrivers could benefit from resume handling, so add the infrastructure for simple resume handling. 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')
-rw-r--r--drivers/misc/thinkpad_acpi.c16
-rw-r--r--drivers/misc/thinkpad_acpi.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index c86b228375cc..78914bf2166d 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -519,11 +519,27 @@ static struct platform_device *tpacpi_pdev;
519static struct class_device *tpacpi_hwmon; 519static struct class_device *tpacpi_hwmon;
520static struct input_dev *tpacpi_inputdev; 520static struct input_dev *tpacpi_inputdev;
521 521
522
523static int tpacpi_resume_handler(struct platform_device *pdev)
524{
525 struct ibm_struct *ibm, *itmp;
526
527 list_for_each_entry_safe(ibm, itmp,
528 &tpacpi_all_drivers,
529 all_drivers) {
530 if (ibm->resume)
531 (ibm->resume)();
532 }
533
534 return 0;
535}
536
522static struct platform_driver tpacpi_pdriver = { 537static struct platform_driver tpacpi_pdriver = {
523 .driver = { 538 .driver = {
524 .name = IBM_DRVR_NAME, 539 .name = IBM_DRVR_NAME,
525 .owner = THIS_MODULE, 540 .owner = THIS_MODULE,
526 }, 541 },
542 .resume = tpacpi_resume_handler,
527}; 543};
528 544
529 545
diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h
index 00f1bd73df8f..c5c1316ae3a6 100644
--- a/drivers/misc/thinkpad_acpi.h
+++ b/drivers/misc/thinkpad_acpi.h
@@ -205,6 +205,7 @@ struct ibm_struct {
205 int (*read) (char *); 205 int (*read) (char *);
206 int (*write) (char *); 206 int (*write) (char *);
207 void (*exit) (void); 207 void (*exit) (void);
208 void (*resume) (void);
208 209
209 struct list_head all_drivers; 210 struct list_head all_drivers;
210 211