From: Henrique de Moraes Holschuh Date: Thu, 19 Jul 2007 02:45:37 +0000 (-0300) Subject: ACPI: thinkpad-acpi: add power-management handler capability X-Git-Tag: v2.6.23-rc1~17^2~5^2~11 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e295e8508c1dd56e06c73e78a2f67f2eb563e74f;p=linux-2.6 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 Signed-off-by: Len Brown --- diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index c86b228375..78914bf216 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c @@ -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, }; diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h index 00f1bd73df..c5c1316ae3 100644 --- a/drivers/misc/thinkpad_acpi.h +++ b/drivers/misc/thinkpad_acpi.h @@ -205,6 +205,7 @@ struct ibm_struct { int (*read) (char *); int (*write) (char *); void (*exit) (void); + void (*resume) (void); struct list_head all_drivers;