linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] thinkpad_acpi: Add support for status (external cover) LED
@ 2017-01-19 17:21 Adam Goode
       [not found] ` <CAOf41Nka4UNk_XUegEXAOHE-Xf0eOs71fuZgBKr0PHEL9sGyag@mail.gmail.com>
  2017-05-07 16:38 ` Pavel Machek
  0 siblings, 2 replies; 8+ messages in thread
From: Adam Goode @ 2017-01-19 17:21 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh, Darren Hart
  Cc: ibm-acpi-devel, platform-driver-x86, linux-kernel, Adam Goode

This allows the control of the red status LED, which is the dot of the "i"
in the word "ThinkPad" on the outside cover of newer models.

In the manual, both this LED and the power LED are referred to as
the "system-status indicators" without distinction between the two, so
I chose "status" as the LED name.

Signed-off-by: Adam Goode <agoode@google.com>

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index cacb43fb1df7..6577bf8e5635 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -5611,11 +5611,11 @@ static const char * const tpacpi_led_names[TPACPI_LED_NUMLEDS] = {
 	"tpacpi::standby",
 	"tpacpi::dock_status1",
 	"tpacpi::dock_status2",
-	"tpacpi::unknown_led2",
+	"tpacpi::status",
 	"tpacpi::unknown_led3",
 	"tpacpi::thinkvantage",
 };
-#define TPACPI_SAFE_LEDS	0x1081U
+#define TPACPI_SAFE_LEDS	0x1481U
 
 static inline bool tpacpi_is_led_restricted(const unsigned int led)
 {
-- 
2.11.0.390.gc69c2f50cf-goog

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

* Re: [ibm-acpi-devel] [PATCH 1/1] thinkpad_acpi: Add support for status (external cover) LED
       [not found] ` <CAOf41Nka4UNk_XUegEXAOHE-Xf0eOs71fuZgBKr0PHEL9sGyag@mail.gmail.com>
@ 2017-02-08  1:01   ` Henrique de Moraes Holschuh
  2017-02-12 18:22     ` Sebastian Reichel
  0 siblings, 1 reply; 8+ messages in thread
From: Henrique de Moraes Holschuh @ 2017-02-08  1:01 UTC (permalink / raw)
  To: Adam Goode
  Cc: Henrique de Moraes Holschuh, Darren Hart, ibm-acpi-devel,
	linux-kernel, platform-driver-x86

Hello Adam,

I apologise for the delay on answering you.

On Tue, 31 Jan 2017, Adam Goode wrote:
> On Thu, Jan 19, 2017 at 12:21 PM, Adam Goode <agoode@google.com> wrote:
> > This allows the control of the red status LED, which is the dot of the "i"
> > in the word "ThinkPad" on the outside cover of newer models.
> >
> > In the manual, both this LED and the power LED are referred to as
> > the "system-status indicators" without distinction between the two, so
> > I chose "status" as the LED name.

I seem to recall this LED had an ACPI interface that was specific for
it, and allowed it to on/off/sine-wave?

> > Signed-off-by: Adam Goode <agoode@google.com>
> >
> > diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/
> > thinkpad_acpi.c
> > index cacb43fb1df7..6577bf8e5635 100644
> > --- a/drivers/platform/x86/thinkpad_acpi.c
> > +++ b/drivers/platform/x86/thinkpad_acpi.c
> > @@ -5611,11 +5611,11 @@ static const char * const
> > tpacpi_led_names[TPACPI_LED_NUMLEDS] = {
> >         "tpacpi::standby",
> >         "tpacpi::dock_status1",
> >         "tpacpi::dock_status2",
> > -       "tpacpi::unknown_led2",
> > +       "tpacpi::status",
> >         "tpacpi::unknown_led3",
> >         "tpacpi::thinkvantage",
> >  };
> > -#define TPACPI_SAFE_LEDS       0x1081U
> > +#define TPACPI_SAFE_LEDS       0x1481U

What happens on older Lenovo models (x00, x10, x20 series?)?  I think
the T410 already had it...

Also, please add code to not export it to userspace (as a led class) on
IBM.

-- 
  Henrique Holschuh

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

* Re: [ibm-acpi-devel] [PATCH 1/1] thinkpad_acpi: Add support for status (external cover) LED
  2017-02-08  1:01   ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
@ 2017-02-12 18:22     ` Sebastian Reichel
  2017-02-12 18:27       ` Adam Goode
  0 siblings, 1 reply; 8+ messages in thread
From: Sebastian Reichel @ 2017-02-12 18:22 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh
  Cc: Adam Goode, Henrique de Moraes Holschuh, Darren Hart,
	ibm-acpi-devel, linux-kernel, platform-driver-x86

[-- Attachment #1: Type: text/plain, Size: 2270 bytes --]

Hi,

On Tue, Feb 07, 2017 at 11:01:32PM -0200, Henrique de Moraes Holschuh wrote:
> Hello Adam,
> 
> I apologise for the delay on answering you.
> 
> On Tue, 31 Jan 2017, Adam Goode wrote:
> > On Thu, Jan 19, 2017 at 12:21 PM, Adam Goode <agoode@google.com> wrote:
> > > This allows the control of the red status LED, which is the dot of the "i"
> > > in the word "ThinkPad" on the outside cover of newer models.
> > >
> > > In the manual, both this LED and the power LED are referred to as
> > > the "system-status indicators" without distinction between the two, so
> > > I chose "status" as the LED name.
> 
> I seem to recall this LED had an ACPI interface that was specific for
> it, and allowed it to on/off/sine-wave?

I don't know what the ACPI interface looks like, but the lid status
led goes into sine-wave mode during suspend. Note, that the power-led
also goes into sine-wave mode during suspend and is already supported
by thinkpad-acpi's LED code (without the sine-wave feature as far
as I can tell).

> > > Signed-off-by: Adam Goode <agoode@google.com>
> > >
> > > diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/
> > > thinkpad_acpi.c
> > > index cacb43fb1df7..6577bf8e5635 100644
> > > --- a/drivers/platform/x86/thinkpad_acpi.c
> > > +++ b/drivers/platform/x86/thinkpad_acpi.c
> > > @@ -5611,11 +5611,11 @@ static const char * const
> > > tpacpi_led_names[TPACPI_LED_NUMLEDS] = {
> > >         "tpacpi::standby",
> > >         "tpacpi::dock_status1",
> > >         "tpacpi::dock_status2",
> > > -       "tpacpi::unknown_led2",
> > > +       "tpacpi::status",

"status" looks a bit generic. I suggest "external_lid_status".

> > >         "tpacpi::unknown_led3",
> > >         "tpacpi::thinkvantage",
> > >  };
> > > -#define TPACPI_SAFE_LEDS       0x1081U
> > > +#define TPACPI_SAFE_LEDS       0x1481U
> 
> What happens on older Lenovo models (x00, x10, x20 series?)?  I think
> the T410 already had it...
> 
> Also, please add code to not export it to userspace (as a led class) on
> IBM.

Adam, can you prepare an updated patch? I would like to use this
led to notify myself about events (i.e. compilation finished)
while my thinkpad's lid is closed.

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [ibm-acpi-devel] [PATCH 1/1] thinkpad_acpi: Add support for status (external cover) LED
  2017-02-12 18:22     ` Sebastian Reichel
@ 2017-02-12 18:27       ` Adam Goode
  0 siblings, 0 replies; 8+ messages in thread
From: Adam Goode @ 2017-02-12 18:27 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Henrique de Moraes Holschuh, Henrique de Moraes Holschuh,
	Darren Hart, ibm-acpi-devel, linux-kernel, platform-driver-x86

On Sun, Feb 12, 2017 at 1:22 PM, Sebastian Reichel <sre@kernel.org> wrote:
> Hi,
>
> On Tue, Feb 07, 2017 at 11:01:32PM -0200, Henrique de Moraes Holschuh wrote:
>> Hello Adam,
>>
>> I apologise for the delay on answering you.
>>
>> On Tue, 31 Jan 2017, Adam Goode wrote:
>> > On Thu, Jan 19, 2017 at 12:21 PM, Adam Goode <agoode@google.com> wrote:
>> > > This allows the control of the red status LED, which is the dot of the "i"
>> > > in the word "ThinkPad" on the outside cover of newer models.
>> > >
>> > > In the manual, both this LED and the power LED are referred to as
>> > > the "system-status indicators" without distinction between the two, so
>> > > I chose "status" as the LED name.
>>
>> I seem to recall this LED had an ACPI interface that was specific for
>> it, and allowed it to on/off/sine-wave?
>
> I don't know what the ACPI interface looks like, but the lid status
> led goes into sine-wave mode during suspend. Note, that the power-led
> also goes into sine-wave mode during suspend and is already supported
> by thinkpad-acpi's LED code (without the sine-wave feature as far
> as I can tell).
>
>> > > Signed-off-by: Adam Goode <agoode@google.com>
>> > >
>> > > diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/
>> > > thinkpad_acpi.c
>> > > index cacb43fb1df7..6577bf8e5635 100644
>> > > --- a/drivers/platform/x86/thinkpad_acpi.c
>> > > +++ b/drivers/platform/x86/thinkpad_acpi.c
>> > > @@ -5611,11 +5611,11 @@ static const char * const
>> > > tpacpi_led_names[TPACPI_LED_NUMLEDS] = {
>> > >         "tpacpi::standby",
>> > >         "tpacpi::dock_status1",
>> > >         "tpacpi::dock_status2",
>> > > -       "tpacpi::unknown_led2",
>> > > +       "tpacpi::status",
>
> "status" looks a bit generic. I suggest "external_lid_status".
>
>> > >         "tpacpi::unknown_led3",
>> > >         "tpacpi::thinkvantage",
>> > >  };
>> > > -#define TPACPI_SAFE_LEDS       0x1081U
>> > > +#define TPACPI_SAFE_LEDS       0x1481U
>>
>> What happens on older Lenovo models (x00, x10, x20 series?)?  I think
>> the T410 already had it...
>>
>> Also, please add code to not export it to userspace (as a led class) on
>> IBM.
>
> Adam, can you prepare an updated patch? I would like to use this
> led to notify myself about events (i.e. compilation finished)
> while my thinkpad's lid is closed.
>

Yes, I will definitely prepare a new patch at some point. The only
hardware I have to test this on is an old IBM X40 and the Lenovo X260.
(I have a T410 with a busted screen that I could try it on maybe.) But
not much else.

I don't know if I can get to this in the next few weeks, since I am
travelling. If someone would like to clean up the patch and move
forward without me, no problem. Otherwise I will get to it eventually.


Thanks,

Adam


> -- Sebastian

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

* Re: [PATCH 1/1] thinkpad_acpi: Add support for status (external cover) LED
  2017-01-19 17:21 [PATCH 1/1] thinkpad_acpi: Add support for status (external cover) LED Adam Goode
       [not found] ` <CAOf41Nka4UNk_XUegEXAOHE-Xf0eOs71fuZgBKr0PHEL9sGyag@mail.gmail.com>
@ 2017-05-07 16:38 ` Pavel Machek
  2017-05-07 23:49   ` Henrique de Moraes Holschuh
  1 sibling, 1 reply; 8+ messages in thread
From: Pavel Machek @ 2017-05-07 16:38 UTC (permalink / raw)
  To: Adam Goode
  Cc: Henrique de Moraes Holschuh, Darren Hart, ibm-acpi-devel,
	platform-driver-x86, linux-kernel

On Thu 2017-01-19 12:21:32, Adam Goode wrote:
> This allows the control of the red status LED, which is the dot of the "i"
> in the word "ThinkPad" on the outside cover of newer models.
> 
> In the manual, both this LED and the power LED are referred to as
> the "system-status indicators" without distinction between the two, so
> I chose "status" as the LED name.

Could we name it something like external_status or something? "status" is way too generic.

										Pavel
> 
> Signed-off-by: Adam Goode <agoode@google.com>
> 
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index cacb43fb1df7..6577bf8e5635 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -5611,11 +5611,11 @@ static const char * const tpacpi_led_names[TPACPI_LED_NUMLEDS] = {
>  	"tpacpi::standby",
>  	"tpacpi::dock_status1",
>  	"tpacpi::dock_status2",
> -	"tpacpi::unknown_led2",
> +	"tpacpi::status",
>  	"tpacpi::unknown_led3",
>  	"tpacpi::thinkvantage",
>  };
> -#define TPACPI_SAFE_LEDS	0x1081U
> +#define TPACPI_SAFE_LEDS	0x1481U
>  
>  static inline bool tpacpi_is_led_restricted(const unsigned int led)
>  {
> -- 
> 2.11.0.390.gc69c2f50cf-goog

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [PATCH 1/1] thinkpad_acpi: Add support for status (external cover) LED
  2017-05-07 16:38 ` Pavel Machek
@ 2017-05-07 23:49   ` Henrique de Moraes Holschuh
  2017-05-12 10:43     ` Pavel Machek
  0 siblings, 1 reply; 8+ messages in thread
From: Henrique de Moraes Holschuh @ 2017-05-07 23:49 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Adam Goode, Henrique de Moraes Holschuh, Darren Hart,
	ibm-acpi-devel, platform-driver-x86, linux-kernel

On Sun, 07 May 2017, Pavel Machek wrote:
> On Thu 2017-01-19 12:21:32, Adam Goode wrote:
> > This allows the control of the red status LED, which is the dot of the "i"
> > in the word "ThinkPad" on the outside cover of newer models.
> > 
> > In the manual, both this LED and the power LED are referred to as
> > the "system-status indicators" without distinction between the two, so
> > I chose "status" as the LED name.
> 
> Could we name it something like external_status or something? "status" is way too generic.

"thinkdot" ;-)

-- 
  Henrique Holschuh

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

* Re: [PATCH 1/1] thinkpad_acpi: Add support for status (external cover) LED
  2017-05-07 23:49   ` Henrique de Moraes Holschuh
@ 2017-05-12 10:43     ` Pavel Machek
  2017-05-12 17:23       ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
  0 siblings, 1 reply; 8+ messages in thread
From: Pavel Machek @ 2017-05-12 10:43 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh
  Cc: Adam Goode, Henrique de Moraes Holschuh, Darren Hart,
	ibm-acpi-devel, platform-driver-x86, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 800 bytes --]

On Sun 2017-05-07 20:49:03, Henrique de Moraes Holschuh wrote:
> On Sun, 07 May 2017, Pavel Machek wrote:
> > On Thu 2017-01-19 12:21:32, Adam Goode wrote:
> > > This allows the control of the red status LED, which is the dot of the "i"
> > > in the word "ThinkPad" on the outside cover of newer models.
> > > 
> > > In the manual, both this LED and the power LED are referred to as
> > > the "system-status indicators" without distinction between the two, so
> > > I chose "status" as the LED name.
> > 
> > Could we name it something like external_status or something? "status" is way too generic.
> 
> "thinkdot" ;-)

Sounds good to me ;-).

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* Re: [ibm-acpi-devel] [PATCH 1/1] thinkpad_acpi: Add support for status (external cover) LED
  2017-05-12 10:43     ` Pavel Machek
@ 2017-05-12 17:23       ` Henrique de Moraes Holschuh
  0 siblings, 0 replies; 8+ messages in thread
From: Henrique de Moraes Holschuh @ 2017-05-12 17:23 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Adam Goode, linux-kernel, platform-driver-x86, ibm-acpi-devel,
	Darren Hart

On Fri, 12 May 2017, Pavel Machek wrote:
> On Sun 2017-05-07 20:49:03, Henrique de Moraes Holschuh wrote:
> > On Sun, 07 May 2017, Pavel Machek wrote:
> > > On Thu 2017-01-19 12:21:32, Adam Goode wrote:
> > > > This allows the control of the red status LED, which is the dot of the "i"
> > > > in the word "ThinkPad" on the outside cover of newer models.
> > > > 
> > > > In the manual, both this LED and the power LED are referred to as
> > > > the "system-status indicators" without distinction between the two, so
> > > > I chose "status" as the LED name.
> > > 
> > > Could we name it something like external_status or something? "status" is way too generic.
> > 
> > "thinkdot" ;-)
> 
> Sounds good to me ;-).

Ok.  Adam, care to respin this when you have the time?

-- 
  Henrique Holschuh

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

end of thread, other threads:[~2017-05-12 17:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-19 17:21 [PATCH 1/1] thinkpad_acpi: Add support for status (external cover) LED Adam Goode
     [not found] ` <CAOf41Nka4UNk_XUegEXAOHE-Xf0eOs71fuZgBKr0PHEL9sGyag@mail.gmail.com>
2017-02-08  1:01   ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
2017-02-12 18:22     ` Sebastian Reichel
2017-02-12 18:27       ` Adam Goode
2017-05-07 16:38 ` Pavel Machek
2017-05-07 23:49   ` Henrique de Moraes Holschuh
2017-05-12 10:43     ` Pavel Machek
2017-05-12 17:23       ` [ibm-acpi-devel] " Henrique de Moraes Holschuh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).