]> err.no Git - linux-2.6/commitdiff
ACPI: thinkpad-acpi: add power-management handler capability
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Thu, 19 Jul 2007 02:45:37 +0000 (23:45 -0300)
committerLen Brown <len.brown@intel.com>
Sun, 22 Jul 2007 03:46:08 +0000 (23:46 -0400)
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>
drivers/misc/thinkpad_acpi.c
drivers/misc/thinkpad_acpi.h

index c86b228375cc33a5d7e5cd8cb83fd6bab4af72b1..78914bf2166db42f890a0c4c0c43ac6ffcfcc418 100644 (file)
@@ -519,11 +519,27 @@ static struct platform_device *tpacpi_pdev;
 static struct class_device *tpacpi_hwmon;
 static struct input_dev *tpacpi_inputdev;
 
+
+static int tpacpi_resume_handler(struct platform_device *pdev)
+{
+       struct ibm_struct *ibm, *itmp;
+
+       list_for_each_entry_safe(ibm, itmp,
+                                &tpacpi_all_drivers,
+                                all_drivers) {
+               if (ibm->resume)
+                       (ibm->resume)();
+       }
+
+       return 0;
+}
+
 static struct platform_driver tpacpi_pdriver = {
        .driver = {
                .name = IBM_DRVR_NAME,
                .owner = THIS_MODULE,
        },
+       .resume = tpacpi_resume_handler,
 };
 
 
index 00f1bd73df8f4197b54c6d5ada289ff81ac20d57..c5c1316ae3a66a4fe02b6cfe4a9a7894b1d9179e 100644 (file)
@@ -205,6 +205,7 @@ struct ibm_struct {
        int (*read) (char *);
        int (*write) (char *);
        void (*exit) (void);
+       void (*resume) (void);
 
        struct list_head all_drivers;