Skip to contentSkip to conversation

thinkpad_acpi: Add support for status (external cover) LED

PATCH In review Adam Goode 5 participants 10 messages Jan 19, 2017 – May 14, 2017 2 messages not in the archive x86 platform drivers

lore
Share & tools
lore

Adam Goode

author
#0 lore raw

PATCH 1/1 thinkpad_acpi: Add support for status (external cover) LED

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.

drivers/platform/x86/thinkpad_acpi.c +2 -2
index cacb43fb1df7..6577bf8e5635 100644
@@ -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)
 {
Signature · 6 lines
2.11.0.390.gc69c2f50cf-goog


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot

A message that is not in the archive (sent off-list or not yet received): 20170119172132.36029-1-agoode-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org

#2 lore raw
Quoted 28 lines · 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.

drivers/platform/x86/ renamed from drivers/platform/x86/thinkpad_acpi.c +0 -0

thinkpad_acpi.c
index cacb43fb1df7..6577bf8e5635 100644

drivers/platform/x86/thinkpad_acpi.c +2 -2
@@ -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)
Quoted 5 lines

{
--
2.11.0.390.gc69c2f50cf-goog

ping ?

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot

_______________________________________________
ibm-acpi-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel

#3 lore raw

Hello Adam,

I apologise for the delay on answering you.

Quoted 7 lines · Adam Goode
Quoted 6 lines · 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.

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

Quoted 11 lines
Quoted 11 lines
drivers/platform/x86/ renamed from drivers/platform/x86/thinkpad_acpi.c +0 -0

thinkpad_acpi.c
index cacb43fb1df7..6577bf8e5635 100644

drivers/platform/x86/thinkpad_acpi.c +0 -0
@@ -5611,11 +5611,11 @@ static const char * const
 tpacpi_led_names[TPACPI_LED_NUMLEDS] = {
        "tpacpi::standby",
        "tpacpi::dock_status1",
Quoted 8 lines

drivers/platform/x86/thinkpad_acpi.c static const char * const tpacpi_led_names[TPACPI_LED_NUMLEDS] = { · line 5618

Quoted 8 lines
drivers/platform/x86/thinkpad_acpi.c +2 -2
        "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.

Signature · 5 lines
  Henrique Holschuh

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
#4 lore raw

Hi,

Quoted 9 lines · Henrique de Moraes Holschuh

Hello Adam,

I apologise for the delay on answering you.

Quoted 4 lines · Adam Goode
Quoted 3 lines · 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.

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

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).

Quoted 14 lines
Quoted 14 lines
Quoted 8 lines
drivers/platform/x86/ renamed from drivers/platform/x86/thinkpad_acpi.c +0 -0

thinkpad_acpi.c
index cacb43fb1df7..6577bf8e5635 100644

drivers/platform/x86/thinkpad_acpi.c static const char * const · line 5615

Quoted 6 lines
drivers/platform/x86/thinkpad_acpi.c +1 -1
@@ -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".

Quoted 11 lines
Quoted 5 lines

drivers/platform/x86/thinkpad_acpi.c static const char * const tpacpi_led_names[TPACPI_LED_NUMLEDS] = { · line 5618

Quoted 5 lines
drivers/platform/x86/thinkpad_acpi.c +1 -1
        "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

author
#5 lore raw
Quoted 51 lines · Sebastian Reichel

Hi,

Quoted 9 lines · Henrique de Moraes Holschuh

Hello Adam,

I apologise for the delay on answering you.

Quoted 4 lines · Adam Goode
Quoted 3 lines · 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.

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

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).

Quoted 14 lines
Quoted 14 lines
Quoted 8 lines
drivers/platform/x86/ renamed from drivers/platform/x86/thinkpad_acpi.c +0 -0

thinkpad_acpi.c
index cacb43fb1df7..6577bf8e5635 100644

drivers/platform/x86/thinkpad_acpi.c static const char * const · line 5615

Quoted 6 lines
drivers/platform/x86/thinkpad_acpi.c +1 -1
@@ -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".

Quoted 9 lines
Quoted 5 lines

drivers/platform/x86/thinkpad_acpi.c static const char * const tpacpi_led_names[TPACPI_LED_NUMLEDS] = { · line 5618

Quoted 5 lines
drivers/platform/x86/thinkpad_acpi.c +1 -1
        "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...

Quoted 7 lines
Quoted 2 lines

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

Quoted 1 line

-- Sebastian

#6 lore raw
In reply to Adam Goode
Quoted 6 lines · 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.

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

Pavel

Quoted 23 lines
drivers/platform/x86/thinkpad_acpi.c +2 -2
index cacb43fb1df7..6577bf8e5635 100644
@@ -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)
 {
Signature · 1 line
2.11.0.390.gc69c2f50cf-goog
Signature · 6 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
#7 lore raw
Quoted 9 lines · Pavel Machek
Quoted 6 lines · 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.

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

"thinkdot" ;-)

Signature · 1 line
  Henrique Holschuh
#8 lore raw
Quoted 5 lines · Henrique de Moraes Holschuh
Quoted 4 lines · Pavel Machek
Quoted 3 lines · 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.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

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 ;-).

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#9 lore raw
Quoted 10 lines · Pavel Machek
Quoted 9 lines · Henrique de Moraes Holschuh
Quoted 8 lines · Pavel Machek
Quoted 6 lines · 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.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

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?

Signature · 1 line
  Henrique Holschuh

A message that is not in the archive (sent off-list or not yet received): 20170512172321.GA16100-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org

#11 lore raw

Yes, I'll give it a respin "soon" :)

Adam

On Fri, May 12, 2017 at 1:23 PM, Henrique de Moraes Holschuh <hmh-N3TV7GIv+o9fyO9Q7EP/[email protected]

Quoted 18 lines

wrote:

Quoted 4 lines · Pavel Machek
Quoted 3 lines · Henrique de Moraes Holschuh
Quoted 2 lines · Pavel Machek
Quoted 1 line · Adam Goode

This allows the control of the red status LED, which is the dot of

the "i"

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

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

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

I chose "status" as the LED name.

Could we name it something like external_status or something?

"status" is way too generic.

Quoted 1 line
Quoted 1 line
Quoted 9 lines
Quoted 3 lines
Quoted 1 line

"thinkdot" ;-)

Sounds good to me ;-).

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

--
Henrique Holschuh

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
ibm-acpi-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel