On Wed, 26 Dec 2012, Simon Danner wrote: > The status of the ThinkLight was not restored on resume, > make it work > > Signed-off-by: Simon Danner <danner.simon@xxxxxxxxx> Acked-by: Henrique de Moraes Holschuh <hmh@xxxxxxxxxx> Simon, please repost your patch, with my acked-by added, to the platform-driver-x86 ML: http://vger.kernel.org/vger-lists.html#platform-driver-x86 > --- > drivers/platform/x86/thinkpad_acpi.c | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c > index 75dd651..c046909 100644 > --- a/drivers/platform/x86/thinkpad_acpi.c > +++ b/drivers/platform/x86/thinkpad_acpi.c > @@ -4762,6 +4762,8 @@ static struct ibm_struct video_driver_data = { > * Light (thinklight) subdriver > */ > > +static int light_resume_status; > + > TPACPI_HANDLE(lght, root, "\\LGHT"); /* A21e, A2xm/p, T20-22, X20-21 */ > TPACPI_HANDLE(ledb, ec, "LEDB"); /* G4x */ > > @@ -4921,11 +4923,38 @@ static int light_write(char *buf) > return light_set_status(newstatus); > } > > +static void light_suspend(void) > +{ > + if (!tp_features.light || !tp_features.light_status) > + return; > + > + light_resume_status = light_get_status(); > + > + if (light_resume_status < 0) > + pr_notice("failed to read light status for later restore" > + "during resume: %d\n", light_resume_status); > +} > + > +static void light_resume(void) > +{ > + int rc; > + > + if (!tp_features.light || !tp_features.light_status) > + return; > + > + rc = light_set_status(light_resume_status); > + if (rc < 0) > + pr_notice("failed to restore light status: %d\n", rc); > + > +} > + > static struct ibm_struct light_driver_data = { > .name = "light", > .read = light_read, > .write = light_write, > .exit = light_exit, > + .suspend = light_suspend, > + .resume = light_resume, > }; > > /************************************************************************* -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh ------------------------------------------------------------------------------ Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow - 200+ hours of step-by-step video tutorials by Java experts. SALE $49.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122612 _______________________________________________ ibm-acpi-devel mailing list ibm-acpi-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel