public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] asus-laptop: add Lenovo SL LenovoCare LED support
@ 2009-12-08  7:26 Ike Panhc
       [not found] ` <1260257169-7227-1-git-send-email-ike.pan-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Ike Panhc @ 2009-12-08  7:26 UTC (permalink / raw)
  To: linux-acpi, linux-kernel, acpi4asus-user
  Cc: Corentin Chary, Alexandre Rostovtsev

From: Ike Panhc <ikepanhc@canonical.com>

This patch is to enable the LenovoCare LED support on Lenovo SL laptop. Based
on the found of the control interface by Alexandre Rostovtsev

Turn on the LenovoCare LED:
 (As root privileges) echo 1 > /sys/class/leds/asus\:\:LenovoCare/brightness
Trun off the LenovoCare LED:
 (As root privileges) echo 0 > /sys/class/leds/asus\:\:LenovoCare/brightness

The patch against current checkout of acpi4asus is below.

Signed-off-by: Ike Panhc <ikepanhc@canonical.com>
---
 drivers/platform/x86/asus-laptop.c |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
index 3348cc6..f3c52b6 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -87,6 +87,7 @@
 #define LCD_ON      0x80	/* LCD backlight */
 #define GPS_ON      0x100	/* GPS */
 #define KEY_ON      0x200	/* Keyboard backlight */
+#define LLED_ON     0x400	/* Lenovo SL: LenovoCare LED */
 
 #define ASUS_LOG    ASUS_HOTK_FILE ": "
 #define ASUS_ERR    KERN_ERR    ASUS_LOG
@@ -123,6 +124,7 @@ ASUS_HANDLE(tled_set, ASUS_HOTK_PREFIX "TLED");
 ASUS_HANDLE(rled_set, ASUS_HOTK_PREFIX "RLED");	/* W1JC */
 ASUS_HANDLE(pled_set, ASUS_HOTK_PREFIX "PLED");	/* A7J */
 ASUS_HANDLE(gled_set, ASUS_HOTK_PREFIX "GLED");	/* G1, G2 (probably) */
+ASUS_HANDLE(lled_set, "\\_SB_.PCI0.SBRG.EC0_.HKEY.TVLS"); /* LenovoCare */
 
 /* LEDD */
 ASUS_HANDLE(ledd_set, ASUS_HOTK_PREFIX "SLCM");
@@ -285,6 +287,7 @@ ASUS_LED(rled, "record", 1);
 ASUS_LED(pled, "phone", 1);
 ASUS_LED(gled, "gaming", 1);
 ASUS_LED(kled, "kbd_backlight", 3);
+ASUS_LED(lled, "LenovoCare", 1);
 
 struct key_entry {
 	char type;
@@ -419,6 +422,9 @@ static void write_status(acpi_handle handle, int out, int mask)
 		handle = (out) ? gps_on_handle : gps_off_handle;
 		out = 0x02;
 		break;
+	case LLED_ON:
+		out = (out & 0x1) * 0xFF;
+		break;
 	default:
 		out &= 0x1;
 		break;
@@ -452,6 +458,7 @@ ASUS_LED_HANDLER(pled, PLED_ON);
 ASUS_LED_HANDLER(rled, RLED_ON);
 ASUS_LED_HANDLER(tled, TLED_ON);
 ASUS_LED_HANDLER(gled, GLED_ON);
+ASUS_LED_HANDLER(lled, LLED_ON);
 
 /*
  * Keyboard backlight
@@ -1146,6 +1153,7 @@ static int asus_hotk_get_info(void)
 	ASUS_HANDLE_INIT(rled_set);
 	ASUS_HANDLE_INIT(pled_set);
 	ASUS_HANDLE_INIT(gled_set);
+	ASUS_HANDLE_INIT(lled_set);
 
 	ASUS_HANDLE_INIT(ledd_set);
 
@@ -1338,6 +1346,7 @@ static void asus_led_exit(void)
 	ASUS_LED_UNREGISTER(rled);
 	ASUS_LED_UNREGISTER(gled);
 	ASUS_LED_UNREGISTER(kled);
+	ASUS_LED_UNREGISTER(lled);
 }
 
 static void asus_input_exit(void)
@@ -1417,19 +1426,25 @@ static int asus_led_init(struct device *dev)
 	if (rv)
 		goto out4;
 
+	rv = ASUS_LED_REGISTER(lled, dev);
+	if (rv)
+		goto out5;
+
 	if (kled_set_handle && kled_get_handle)
 		rv = ASUS_LED_REGISTER(kled, dev);
 	if (rv)
-		goto out5;
+		goto out6;
 
 	led_workqueue = create_singlethread_workqueue("led_workqueue");
 	if (!led_workqueue)
-		goto out6;
+		goto out7;
 
 	return 0;
-out6:
+out7:
 	rv = -ENOMEM;
 	ASUS_LED_UNREGISTER(kled);
+out6:
+	ASUS_LED_UNREGISTER(lled);
 out5:
 	ASUS_LED_UNREGISTER(gled);
 out4:
-- 
1.6.3.3


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

* Re: [PATCH] asus-laptop: add Lenovo SL LenovoCare LED support
       [not found] ` <1260257169-7227-1-git-send-email-ike.pan-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
@ 2009-12-10 10:09   ` Pavel Machek
  2009-12-10 10:38     ` Corentin Chary
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2009-12-10 10:09 UTC (permalink / raw)
  To: Ike Panhc
  Cc: linux-acpi-u79uwXL29TY76Z2rM5mHXA,
	acpi4asus-user-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Corentin Chary,
	Alexandre Rostovtsev

On Tue 2009-12-08 15:26:09, Ike Panhc wrote:
> From: Ike Panhc <ikepanhc-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
> 
> This patch is to enable the LenovoCare LED support on Lenovo SL laptop. Based
> on the found of the control interface by Alexandre Rostovtsev
> 
> Turn on the LenovoCare LED:
>  (As root privileges) echo 1 > /sys/class/leds/asus\:\:LenovoCare/brightness
> Trun off the LenovoCare LED:
>  (As root privileges) echo 0 > /sys/class/leds/asus\:\:LenovoCare/brightness
> 
> The patch against current checkout of acpi4asus is below.

Is the driver severely misnamed by now? I believe Lenovo and ASUS are
pretty different firms...

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

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev

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

* Re: [PATCH] asus-laptop: add Lenovo SL LenovoCare LED support
  2009-12-10 10:38     ` Corentin Chary
@ 2009-12-10 10:14       ` Pavel Machek
  2009-12-10 10:58         ` Corentin Chary
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2009-12-10 10:14 UTC (permalink / raw)
  To: Corentin Chary
  Cc: Ike Panhc, linux-acpi, linux-kernel, acpi4asus-user,
	Alexandre Rostovtsev

On Thu 2009-12-10 11:38:00, Corentin Chary wrote:
> On Thu, Dec 10, 2009 at 11:09 AM, Pavel Machek <pavel@ucw.cz> wrote:
> > On Tue 2009-12-08 15:26:09, Ike Panhc wrote:
> >> From: Ike Panhc <ikepanhc@canonical.com>
> >>
> >> This patch is to enable the LenovoCare LED support on Lenovo SL laptop. Based
> >> on the found of the control interface by Alexandre Rostovtsev
> >>
> >> Turn on the LenovoCare LED:
> >>  (As root privileges) echo 1 > /sys/class/leds/asus\:\:LenovoCare/brightness
> >> Trun off the LenovoCare LED:
> >>  (As root privileges) echo 0 > /sys/class/leds/asus\:\:LenovoCare/brightness
> >>
> >> The patch against current checkout of acpi4asus is below.
> >
> > Is the driver severely misnamed by now? I believe Lenovo and ASUS are
> > pretty different firms...
> >
> 
> Lenovo ship DSDT with similar ATKD interace.
> See http://git.iksaif.net/?p=acpi4asus.git;a=commitdiff;h=31a38147625c283b58137db45e7507cd1e49aa05
> 

So what? Rename the driver... having Asus::lenovocare led is just wrong.

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

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

* Re: [PATCH] asus-laptop: add Lenovo SL LenovoCare LED support
  2009-12-10 10:09   ` Pavel Machek
@ 2009-12-10 10:38     ` Corentin Chary
  2009-12-10 10:14       ` Pavel Machek
  0 siblings, 1 reply; 5+ messages in thread
From: Corentin Chary @ 2009-12-10 10:38 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Ike Panhc, linux-acpi, linux-kernel, acpi4asus-user,
	Alexandre Rostovtsev

On Thu, Dec 10, 2009 at 11:09 AM, Pavel Machek <pavel@ucw.cz> wrote:
> On Tue 2009-12-08 15:26:09, Ike Panhc wrote:
>> From: Ike Panhc <ikepanhc@canonical.com>
>>
>> This patch is to enable the LenovoCare LED support on Lenovo SL laptop. Based
>> on the found of the control interface by Alexandre Rostovtsev
>>
>> Turn on the LenovoCare LED:
>>  (As root privileges) echo 1 > /sys/class/leds/asus\:\:LenovoCare/brightness
>> Trun off the LenovoCare LED:
>>  (As root privileges) echo 0 > /sys/class/leds/asus\:\:LenovoCare/brightness
>>
>> The patch against current checkout of acpi4asus is below.
>
> Is the driver severely misnamed by now? I believe Lenovo and ASUS are
> pretty different firms...
>

Lenovo ship DSDT with similar ATKD interace.
See http://git.iksaif.net/?p=acpi4asus.git;a=commitdiff;h=31a38147625c283b58137db45e7507cd1e49aa05


-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] asus-laptop: add Lenovo SL LenovoCare LED support
  2009-12-10 10:14       ` Pavel Machek
@ 2009-12-10 10:58         ` Corentin Chary
  0 siblings, 0 replies; 5+ messages in thread
From: Corentin Chary @ 2009-12-10 10:58 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Ike Panhc, linux-acpi, linux-kernel, acpi4asus-user,
	Alexandre Rostovtsev

On Thu, Dec 10, 2009 at 11:14 AM, Pavel Machek <pavel@ucw.cz> wrote:
> On Thu 2009-12-10 11:38:00, Corentin Chary wrote:
>> On Thu, Dec 10, 2009 at 11:09 AM, Pavel Machek <pavel@ucw.cz> wrote:
>> > On Tue 2009-12-08 15:26:09, Ike Panhc wrote:
>> >> From: Ike Panhc <ikepanhc@canonical.com>
>> >>
>> >> This patch is to enable the LenovoCare LED support on Lenovo SL laptop. Based
>> >> on the found of the control interface by Alexandre Rostovtsev
>> >>
>> >> Turn on the LenovoCare LED:
>> >>  (As root privileges) echo 1 > /sys/class/leds/asus\:\:LenovoCare/brightness
>> >> Trun off the LenovoCare LED:
>> >>  (As root privileges) echo 0 > /sys/class/leds/asus\:\:LenovoCare/brightness
>> >>
>> >> The patch against current checkout of acpi4asus is below.
>> >
>> > Is the driver severely misnamed by now? I believe Lenovo and ASUS are
>> > pretty different firms...
>> >
>>
>> Lenovo ship DSDT with similar ATKD interace.
>> See http://git.iksaif.net/?p=acpi4asus.git;a=commitdiff;h=31a38147625c283b58137db45e7507cd1e49aa05
>>
>
> So what? Rename the driver... having Asus::lenovocare led is just wrong.

asus::lenovocare led won't be in asus-laptop (see the whole discussion).

All specific lenovo things will be in a new lenevo specific driver.
asus-laptop also support some MEDION, JVC or VICTOR laptops, but these
are only exceptions.

-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2009-12-10 10:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-08  7:26 [PATCH] asus-laptop: add Lenovo SL LenovoCare LED support Ike Panhc
     [not found] ` <1260257169-7227-1-git-send-email-ike.pan-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2009-12-10 10:09   ` Pavel Machek
2009-12-10 10:38     ` Corentin Chary
2009-12-10 10:14       ` Pavel Machek
2009-12-10 10:58         ` Corentin Chary

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox