Alexandre Rostovtsev | 14 Feb 2009 11:12
Picon

[0/3] lenovo-sl-laptop : new driver for drivers/staging

lenovo-sl-laptop is a new driver that adds support for hotkeys,
bluetooth, LEDs and screen brightness on the Lenovo ThinkPad SL series
laptops. [1] These laptops are not supported by the normal
thinkpad_acpi driver because their firmware is quite different from the
"real" ThinkPads. [2] After I wrote the SL series driver, I posted it
on the linux thinkpad mailing list, asking whether it would be a good
idea to try to merge it with thinkpad_acpi. Henrique de Moraes
Holschuh, the thinkpad_acpi maintainer, replied that lenovo-sl-laptop
should be kept separate from thinkpad_acpi. [3] Since then, I have
received a number of emails from users who had tried the driver on
their laptops and found that it works. Thus, I am posting it here for
review and hope for eventual inclusion in staging.

Patches against 2.6.29-rc5 will be in following emails.

One important note concerning the backlight. Currently, the ACPI video
driver has poor support for the ThinkPad SL series because their _BCL
and _BQC methods violate the ACPI spec. Thus, the lenovo-sl-laptop
driver adds optional (controlled via module parameter, default off)
support for setting the backlight brightness.
Zhang Rui has stated that he will be working on making the ACPI video
driver properly support the ThinkPad SL series and other laptops with
non-standard backlight brightness interfaces. When he is finished,
backlight functionality can probably be safely removed from
lenovo-sl-laptop. [4]

Finally, a list of things that the driver does not currently support.
There is no support for the hdaps accelerometer (and adding it would be
difficult), no sensor information (I don't yet understand how to decode
it), and no fan speed control.
(Continue reading)

Alexandre Rostovtsev | 14 Feb 2009 11:16
Picon

[1/3] lenovo-sl-laptop : driver source

This patch contains the actual source of the lenovo-sl-laptop driver.

Signed-off-by: Alexandre Rostovtsev <tetromino <at> gmail.com>

diff --git a/drivers/staging/lenovo-sl-laptop/lenovo-sl-laptop.c b/drivers/staging/lenovo-sl-laptop/lenovo-sl-laptop.c
new file mode 100644
index 0000000..4ea8166
--- /dev/null
+++ b/drivers/staging/lenovo-sl-laptop/lenovo-sl-laptop.c
 <at>  <at>  -0,0 +1,1107  <at>  <at> 
+/*
+ *  lenovo-sl-laptop.c - Lenovo ThinkPad SL Series Extras Driver
+ *
+ *
+ *  Copyright (C) 2008-2009 Alexandre Rostovtsev <tetromino <at> gmail.com>
+ *
+ *  Largely based on thinkpad_acpi.c, eeepc-laptop.c, and video.c which
+ *  are copyright their respective authors.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
(Continue reading)

Alexandre Rostovtsev | 14 Feb 2009 11:19
Picon

[2/3] lenovo-sl-laptop : documentation

This patch contains the documentation for the lenovo-sl-laptop driver.

Signed-off-by: Alexandre Rostovtsev <tetromino <at> gmail.com>

diff --git a/Documentation/laptops/lenovo-sl-laptop.txt b/Documentation/laptops/lenovo-sl-laptop.txt
new file mode 100644
index 0000000..d7bd728
--- /dev/null
+++ b/Documentation/laptops/lenovo-sl-laptop.txt
 <at>  <at>  -0,0 +1,130  <at>  <at> 
+Lenovo ThinkPad SL Series Laptop Extras driver
+http://github.com/tetromino/lenovo-sl-laptop
+Version 0.02
+13 February 2009
+
+Copyright (C) 2008-2009 Alexandre Rostovtsev <tetromino <at> gmail.com>
+
+lenovo-sl-laptop is a driver for controlling various parts of the Lenovo
+ThinkPad SL series (SL300/400/500) laptops. The SL series is not supported
+by the standard thinkpad_acpi driver.
+
+Reporting bugs
+--------------
+
+You can report bugs to me by email, or use the Linux ThinkPad mailing list:
+http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad
+You will need to subscribe to the mailing list to post.
+
+Disclaimer
+---------
(Continue reading)

Alexandre Rostovtsev | 14 Feb 2009 11:22
Picon

[3/3] lenovo-sl-laptop : kconfig etc.

Makefiles and kconfigs for the lenovo-sl-laptop driver.

Signed-off-by: Alexandre Rostovtsev <tetromino <at> gmail.com>

diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index ce6badd..a34f9c8 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
 <at>  <at>  -95,5 +95,7  <at>  <at>  source "drivers/staging/epl/Kconfig"

 source "drivers/staging/android/Kconfig"

+source "drivers/staging/lenovo-sl-laptop/Kconfig"
+
 endif # !STAGING_EXCLUDE_BUILD
 endif # STAGING
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 9ddcc2b..14ce47f 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
 <at>  <at>  -30,3 +30,4  <at>  <at>  obj-$(CONFIG_INPUT_MIMIO)	+= mimio/
 obj-$(CONFIG_TRANZPORT)		+= frontier/
 obj-$(CONFIG_EPL)		+= epl/
 obj-$(CONFIG_ANDROID)		+= android/
+obj-$(CONFIG_LENOVO_SL_LAPTOP)  += lenovo-sl-laptop/
diff --git a/drivers/staging/lenovo-sl-laptop/Kconfig b/drivers/staging/lenovo-sl-laptop/Kconfig
new file mode 100644
index 0000000..88bdeb6
--- /dev/null
+++ b/drivers/staging/lenovo-sl-laptop/Kconfig
(Continue reading)

Christoph Hellwig | 14 Feb 2009 15:52
Favicon

Re: [0/3] lenovo-sl-laptop : new driver for drivers/staging

On Sat, Feb 14, 2009 at 05:12:14AM -0500, Alexandre Rostovtsev wrote:
> Patches against 2.6.29-rc5 will be in following emails.

Please submit it to the kernel proper, not the staging tree.  Also
please just submit it in one patch instead of the split.

--
To unsubscribe from this list: send the line "unsubscribe linux-laptop" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Marcel Holtmann | 14 Feb 2009 16:59

Re: [0/3] lenovo-sl-laptop : new driver for drivers/staging

Hi Christoph,

> > Patches against 2.6.29-rc5 will be in following emails.
> 
> Please submit it to the kernel proper, not the staging tree.  Also
> please just submit it in one patch instead of the split.

I can only second that. This is not a driver that belongs anywhere near
the staging tree. It should be instead sent to the ACPI mailing list for
review.

The staging tree should _NOT_ be used as a shortcut for upstream
inclusion.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-laptop" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Henrique de Moraes Holschuh | 15 Feb 2009 13:29
Picon
Favicon

Re: [0/3] lenovo-sl-laptop : new driver for drivers/staging

On Sat, 14 Feb 2009, Marcel Holtmann wrote:
> > > Patches against 2.6.29-rc5 will be in following emails.
> > Please submit it to the kernel proper, not the staging tree.  Also
> > please just submit it in one patch instead of the split.
> 
> I can only second that. This is not a driver that belongs anywhere near
> the staging tree. It should be instead sent to the ACPI mailing list for
> review.
> 
> The staging tree should _NOT_ be used as a shortcut for upstream
> inclusion.

I don't think that was what was happening (I should hope nothing can
get promoted from staging without the usual reviews, anyway!), but
whatever.

We will be happy to review the driver in linux-acpi.  Submitting it as
a single patch against latest Linus is probably best.  Oh, and it
should be checkpatch-clean if it isn't already.

--

-- 
  "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
Alexandre Rostovtsev | 15 Feb 2009 17:35
Picon

Re: [0/3] lenovo-sl-laptop : new driver for drivers/staging

On Sun, Feb 15, 2009 at 7:29 AM, Henrique de Moraes Holschuh
<hmh <at> hmh.eng.br> wrote:
> We will be happy to review the driver in linux-acpi.  Submitting it as
> a single patch against latest Linus is probably best.

I think I found the fan speed interface; I will resubmit to linux-acpi
after I finish it.

> Oh, and it
> should be checkpatch-clean if it isn't already.

Checkpatch complains about static variables initialized to 0. Since
it's my first time writing kernel code, I have to ask what are
probably obvious questions.
1. Why is initializing a static variable to 0 bad? or worse than
initializing that variable to 1, or -1?
2. If I want to have a module parameter whose default value is 0, what
should I do to stop checkpatch from complaining?

-Alexandre
Johannes Weiner | 15 Feb 2009 19:29

Re: [0/3] lenovo-sl-laptop : new driver for drivers/staging

On Sun, Feb 15, 2009 at 11:35:32AM -0500, Alexandre Rostovtsev wrote:
> On Sun, Feb 15, 2009 at 7:29 AM, Henrique de Moraes Holschuh
> <hmh <at> hmh.eng.br> wrote:
> > We will be happy to review the driver in linux-acpi.  Submitting it as
> > a single patch against latest Linus is probably best.
> 
> I think I found the fan speed interface; I will resubmit to linux-acpi
> after I finish it.
> 
> > Oh, and it
> > should be checkpatch-clean if it isn't already.
> 
> Checkpatch complains about static variables initialized to 0. Since
> it's my first time writing kernel code, I have to ask what are
> probably obvious questions.
> 1. Why is initializing a static variable to 0 bad? or worse than
> initializing that variable to 1, or -1?
> 2. If I want to have a module parameter whose default value is 0, what
> should I do to stop checkpatch from complaining?

Static variables are initialized to zero automatically.

	static int foo;

is equivalent to

	static int foo = 0;

Gmane