thinkpad_acpi: Fix inconsistent mute LED after resume
PATCH 1/1 thinkpad_acpi: Fix inconsistent mute LED after resume
The mute LED states have to be restored after resume.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=70351
--- drivers/platform/x86/thinkpad_acpi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/platform/x86/thinkpad_acpi.c +12 -0
@@ -8447,9 +8447,21 @@ static void mute_led_exit(void)tpacpi_led_set (i, false); } +static void mute_led_resume (void ) +{ +int i; + +for (i =0 ; i <TPACPI_LED_MAX ; i++) { +struct tp_led_table *t = &led_tables[i]; +if (t->state >=0 ) +mute_led_on_off (t, t->state); + } +} +static struct ibm_struct mute_led_driver_data = { .name ="mute_led" , .exit = mute_led_exit, + .resume = mute_led_resume, };/****************************************************************************
Signature · 1 line
1.8.5.2
Quoted 5 lines · Takashi Iwai
The mute LED states have to be restored after resume.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=70351
Cc <[email protected]> [v3.13+]Signed-off-by Takashi Iwai <[email protected]>
Signature · 4 lines
"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
Quoted 1 line · Takashi Iwai
The mute LED states have to be restored after resume.
Hm. Is this something that should be done in the class code rather than in individual drivers?
Signature · 1 line
Matthew Garrett <[email protected]>
Quoted 1 line · Takashi Iwai
The mute LED states have to be restored after resume.
Oh, never mind, we're not doing this through the LED class, are we?
Signature · 1 line
Matthew Garrett <[email protected]>
At Wed, 12 Feb 2014 20:37:36 +0000,
Quoted 5 lines · Matthew Garrett
Quoted 1 line · Takashi Iwai
The mute LED states have to be restored after resume.
Oh, never mind, we're not doing this through the LED class, are we?
Good point. It seems that leds_class has pm_ops but it's enabled only when a flag is set.
I added the original bug reporter to Cc. (Don't know the name, Bugzilla shows only the email address.)
Could you check the patch below works instead of the previous fix?
Takashi
---
drivers/platform/x86/thinkpad_acpi.c +1 -0
@@ -4796,6 +4796,7 @@ static struct tpacpi_led_classdev tpacpi_led_thinklight = { .name = "tpacpi::thinklight", .brightness_set = &light_sysfs_set, .brightness_get = &light_sysfs_get, + .flags = LED_CORE_SUSPENDRESUME, } };
Hi,
this patch doesn't work. The sound is now muted after the resume (light is on). But the userspace knows nothing about it. (kmix shows the volume as umuted)
Peter
Quoted 31 lines · On Thu, 13 Feb 2014 09:35:30 +0100 Takashi Iwai <[email protected]> wrote:
At Wed, 12 Feb 2014 20:37:36 +0000,
Quoted 5 lines · Matthew Garrett
Quoted 1 line · Takashi Iwai
The mute LED states have to be restored after resume.
Oh, never mind, we're not doing this through the LED class, are we?
Good point. It seems that
leds_classhaspm_opsbut it's enabled only when a flag is set.I added the original bug reporter to Cc. (Don't know the name, Bugzilla shows only the email address.)
Could you check the patch below works instead of the previous fix?Takashi
---
drivers/platform/x86/thinkpad_acpi.c +1
-0@@ -4796,6 +4796,7 @@ static struct tpacpi_led_classdev tpacpi_led_thinklight = { .name = "tpacpi::thinklight", .brightness_set = &light_sysfs_set, .brightness_get = &light_sysfs_get, + .flags = LED_CORE_SUSPENDRESUME, } };
At Thu, 13 Feb 2014 19:02:46 +0100,
Quoted 5 lines · [email protected] wrote:
Hi,
this patch doesn't work. The sound is now muted after the resume (light is on). But the userspace knows nothing about it. (kmix shows the volume as umuted)
OK, scratch the last patch. I thought the mute LED is also a part of thinkpad_acpi's leds_class, but it's not. So, my initial patch is a correct fix in the end.
Matthew, could you take it please?
thanks,
Takashi
Quoted 39 lines
Peter
Quoted 31 lines · On Thu, 13 Feb 2014 09:35:30 +0100 Takashi Iwai <[email protected]> wrote:
At Wed, 12 Feb 2014 20:37:36 +0000,
Quoted 5 lines · Matthew Garrett
Quoted 1 line · Takashi Iwai
The mute LED states have to be restored after resume.
Oh, never mind, we're not doing this through the LED class, are we?
Good point. It seems that
leds_classhaspm_opsbut it's enabled only when a flag is set.I added the original bug reporter to Cc. (Don't know the name, Bugzilla shows only the email address.)
Could you check the patch below works instead of the previous fix?Takashi
---
drivers/platform/x86/thinkpad_acpi.c +1
-0@@ -4796,6 +4796,7 @@ static struct tpacpi_led_classdev tpacpi_led_thinklight = { .name = "tpacpi::thinklight", .brightness_set = &light_sysfs_set, .brightness_get = &light_sysfs_get, + .flags = LED_CORE_SUSPENDRESUME, } };