All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thinkpad_acpi: Fix inconsistent mute LED after resume
@ 2014-02-12 15:32 Takashi Iwai
  2014-02-12 19:21 ` Henrique de Moraes Holschuh
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Takashi Iwai @ 2014-02-12 15:32 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh
  Cc: Matthew Garrett, ibm-acpi-devel, platform-driver-x86,
	linux-kernel, David Henningsson

The mute LED states have to be restored after resume.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=70351
Cc: <stable@vger.kernel.org> [v3.13+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 drivers/platform/x86/thinkpad_acpi.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index defb6afc1409..e2a91c845ac9 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -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,
 };
 
 /****************************************************************************
-- 
1.8.5.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] thinkpad_acpi: Fix inconsistent mute LED after resume
  2014-02-12 15:32 [PATCH] thinkpad_acpi: Fix inconsistent mute LED after resume Takashi Iwai
@ 2014-02-12 19:21 ` Henrique de Moraes Holschuh
  2014-02-12 20:36   ` Matthew Garrett
  2014-02-12 20:37   ` Matthew Garrett
  2 siblings, 0 replies; 12+ messages in thread
From: Henrique de Moraes Holschuh @ 2014-02-12 19:21 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Matthew Garrett, ibm-acpi-devel, platform-driver-x86,
	linux-kernel, David Henningsson

On Wed, Feb 12, 2014, at 13:32, Takashi Iwai wrote:
> The mute LED states have to be restored after resume.
> 
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=70351
> Cc: <stable@vger.kernel.org> [v3.13+]
> Signed-off-by: Takashi Iwai <tiwai@suse.de>

Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>

-- 
  "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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] thinkpad_acpi: Fix inconsistent mute LED after resume
  2014-02-12 15:32 [PATCH] thinkpad_acpi: Fix inconsistent mute LED after resume Takashi Iwai
@ 2014-02-12 20:36   ` Matthew Garrett
  2014-02-12 20:36   ` Matthew Garrett
  2014-02-12 20:37   ` Matthew Garrett
  2 siblings, 0 replies; 12+ messages in thread
From: Matthew Garrett @ 2014-02-12 20:36 UTC (permalink / raw)
  To: tiwai
  Cc: david.henningsson, ibm-acpi-devel, platform-driver-x86, ibm-acpi,
	linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 417 bytes --]

On Wed, 2014-02-12 at 16:32 +0100, Takashi Iwai wrote:
> 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?

-- 
Matthew Garrett <matthew.garrett@nebula.com>
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] thinkpad_acpi: Fix inconsistent mute LED after resume
@ 2014-02-12 20:36   ` Matthew Garrett
  0 siblings, 0 replies; 12+ messages in thread
From: Matthew Garrett @ 2014-02-12 20:36 UTC (permalink / raw)
  To: tiwai
  Cc: david.henningsson, ibm-acpi-devel, platform-driver-x86, ibm-acpi,
	linux-kernel

On Wed, 2014-02-12 at 16:32 +0100, Takashi Iwai wrote:
> 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?

-- 
Matthew Garrett <matthew.garrett@nebula.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] thinkpad_acpi: Fix inconsistent mute LED after resume
  2014-02-12 15:32 [PATCH] thinkpad_acpi: Fix inconsistent mute LED after resume Takashi Iwai
@ 2014-02-12 20:37   ` Matthew Garrett
  2014-02-12 20:36   ` Matthew Garrett
  2014-02-12 20:37   ` Matthew Garrett
  2 siblings, 0 replies; 12+ messages in thread
From: Matthew Garrett @ 2014-02-12 20:37 UTC (permalink / raw)
  To: tiwai
  Cc: david.henningsson, ibm-acpi-devel, platform-driver-x86, ibm-acpi,
	linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 390 bytes --]

On Wed, 2014-02-12 at 16:32 +0100, Takashi Iwai wrote:
> The mute LED states have to be restored after resume.

Oh, never mind, we're not doing this through the LED class, are we?

-- 
Matthew Garrett <matthew.garrett@nebula.com>
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] thinkpad_acpi: Fix inconsistent mute LED after resume
@ 2014-02-12 20:37   ` Matthew Garrett
  0 siblings, 0 replies; 12+ messages in thread
From: Matthew Garrett @ 2014-02-12 20:37 UTC (permalink / raw)
  To: tiwai
  Cc: david.henningsson, ibm-acpi-devel, platform-driver-x86, ibm-acpi,
	linux-kernel

On Wed, 2014-02-12 at 16:32 +0100, Takashi Iwai wrote:
> The mute LED states have to be restored after resume.

Oh, never mind, we're not doing this through the LED class, are we?

-- 
Matthew Garrett <matthew.garrett@nebula.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] thinkpad_acpi: Fix inconsistent mute LED after resume
  2014-02-12 20:37   ` Matthew Garrett
@ 2014-02-13  8:35     ` Takashi Iwai
  -1 siblings, 0 replies; 12+ messages in thread
From: Takashi Iwai @ 2014-02-13  8:35 UTC (permalink / raw)
  To: Matthew Garrett
  Cc: rauchwolke, david.henningsson, ibm-acpi-devel,
	platform-driver-x86, ibm-acpi, linux-kernel

At Wed, 12 Feb 2014 20:37:36 +0000,
Matthew Garrett wrote:
> 
> On Wed, 2014-02-12 at 16:32 +0100, Takashi Iwai wrote:
> > 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

---
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index defb6afc1409..16edf75d9c00 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -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,
 	}
 };
 

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] thinkpad_acpi: Fix inconsistent mute LED after resume
@ 2014-02-13  8:35     ` Takashi Iwai
  0 siblings, 0 replies; 12+ messages in thread
From: Takashi Iwai @ 2014-02-13  8:35 UTC (permalink / raw)
  To: Matthew Garrett
  Cc: rauchwolke, david.henningsson, ibm-acpi-devel,
	platform-driver-x86, ibm-acpi, linux-kernel

At Wed, 12 Feb 2014 20:37:36 +0000,
Matthew Garrett wrote:
> 
> On Wed, 2014-02-12 at 16:32 +0100, Takashi Iwai wrote:
> > 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

---
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index defb6afc1409..16edf75d9c00 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -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,
 	}
 };
 

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] thinkpad_acpi: Fix inconsistent mute LED after resume
  2014-02-13  8:35     ` Takashi Iwai
@ 2014-02-13 18:02       ` rauchwolke
  -1 siblings, 0 replies; 12+ messages in thread
From: rauchwolke @ 2014-02-13 18:02 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Matthew Garrett, david.henningsson, ibm-acpi-devel,
	platform-driver-x86, ibm-acpi, linux-kernel

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


On Thu, 13 Feb 2014 09:35:30 +0100
Takashi Iwai <tiwai@suse.de> wrote:

> At Wed, 12 Feb 2014 20:37:36 +0000,
> Matthew Garrett wrote:
> > 
> > On Wed, 2014-02-12 at 16:32 +0100, Takashi Iwai wrote:
> > > 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
> 
> ---
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index defb6afc1409..16edf75d9c00 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -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,
>  	}
>  };
>  

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] thinkpad_acpi: Fix inconsistent mute LED after resume
@ 2014-02-13 18:02       ` rauchwolke
  0 siblings, 0 replies; 12+ messages in thread
From: rauchwolke @ 2014-02-13 18:02 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Matthew Garrett, david.henningsson, ibm-acpi-devel,
	platform-driver-x86, ibm-acpi, linux-kernel

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


On Thu, 13 Feb 2014 09:35:30 +0100
Takashi Iwai <tiwai@suse.de> wrote:

> At Wed, 12 Feb 2014 20:37:36 +0000,
> Matthew Garrett wrote:
> > 
> > On Wed, 2014-02-12 at 16:32 +0100, Takashi Iwai wrote:
> > > 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
> 
> ---
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index defb6afc1409..16edf75d9c00 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -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,
>  	}
>  };
>  

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] thinkpad_acpi: Fix inconsistent mute LED after resume
  2014-02-13 18:02       ` rauchwolke
@ 2014-02-14  6:37         ` Takashi Iwai
  -1 siblings, 0 replies; 12+ messages in thread
From: Takashi Iwai @ 2014-02-14  6:37 UTC (permalink / raw)
  To: rauchwolke
  Cc: Matthew Garrett, david.henningsson, ibm-acpi-devel,
	platform-driver-x86, ibm-acpi, linux-kernel

At Thu, 13 Feb 2014 19:02:46 +0100,
rauchwolke@gmx.net 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

> 
> Peter
> 
> 
> On Thu, 13 Feb 2014 09:35:30 +0100
> Takashi Iwai <tiwai@suse.de> wrote:
> 
> > At Wed, 12 Feb 2014 20:37:36 +0000,
> > Matthew Garrett wrote:
> > > 
> > > On Wed, 2014-02-12 at 16:32 +0100, Takashi Iwai wrote:
> > > > 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
> > 
> > ---
> > diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> > index defb6afc1409..16edf75d9c00 100644
> > --- a/drivers/platform/x86/thinkpad_acpi.c
> > +++ b/drivers/platform/x86/thinkpad_acpi.c
> > @@ -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,
> >  	}
> >  };
> >  
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] thinkpad_acpi: Fix inconsistent mute LED after resume
@ 2014-02-14  6:37         ` Takashi Iwai
  0 siblings, 0 replies; 12+ messages in thread
From: Takashi Iwai @ 2014-02-14  6:37 UTC (permalink / raw)
  To: rauchwolke
  Cc: Matthew Garrett, david.henningsson, ibm-acpi-devel,
	platform-driver-x86, ibm-acpi, linux-kernel

At Thu, 13 Feb 2014 19:02:46 +0100,
rauchwolke@gmx.net 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

> 
> Peter
> 
> 
> On Thu, 13 Feb 2014 09:35:30 +0100
> Takashi Iwai <tiwai@suse.de> wrote:
> 
> > At Wed, 12 Feb 2014 20:37:36 +0000,
> > Matthew Garrett wrote:
> > > 
> > > On Wed, 2014-02-12 at 16:32 +0100, Takashi Iwai wrote:
> > > > 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
> > 
> > ---
> > diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> > index defb6afc1409..16edf75d9c00 100644
> > --- a/drivers/platform/x86/thinkpad_acpi.c
> > +++ b/drivers/platform/x86/thinkpad_acpi.c
> > @@ -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,
> >  	}
> >  };
> >  
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-02-14  6:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-12 15:32 [PATCH] thinkpad_acpi: Fix inconsistent mute LED after resume Takashi Iwai
2014-02-12 19:21 ` Henrique de Moraes Holschuh
2014-02-12 20:36 ` Matthew Garrett
2014-02-12 20:36   ` Matthew Garrett
2014-02-12 20:37 ` Matthew Garrett
2014-02-12 20:37   ` Matthew Garrett
2014-02-13  8:35   ` Takashi Iwai
2014-02-13  8:35     ` Takashi Iwai
2014-02-13 18:02     ` rauchwolke
2014-02-13 18:02       ` rauchwolke
2014-02-14  6:37       ` Takashi Iwai
2014-02-14  6:37         ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.