Re: [PATCH] ideapad-laptop: add new driver

Previous thread: [PATCH] pxa: fix CI_HSYNC and CI_VSYNC MFP defines by Axel Lin on Thursday, August 12, 2010 - 8:39 pm. (2 messages)

Next thread: [Resend][Patch v2] kexec: increase max of kexec segments and use dynamic allocation by Amerigo Wang on Thursday, August 12, 2010 - 10:38 pm. (3 messages)
From: Ike Panhc
Date: Thursday, August 12, 2010 - 9:08 pm

ideapad-laptop is a new driver which enable hotkeys on Lenovo Ideapad laptops

The driver will bind on ACPI HID:VPC2004. When hotkey pressed, the notify
function will be called and query EC to tell which key pressed.

Hotkeys enabled listed below:
 * LCD backlight switch - reports KEY_DISPLAY_OFF
 * One key restore - reports KEY_PROG1
 * Brightness Up/down - reports KEY_BRIGHTNESS_CYCLE
   Both up/down keys reports the same event. Need to find other way to detect
 * Touchpad switch - reports KEY_F13
 * Video output switch - reports KEY_SWITCHVIDEOMODE
 * Camera switch - reports KEY_CAMERA
 * Video resolution switch - reports KEY_VIDEO_NEXT
 * S/W rfkill key - reports KEY_WLAN

The developing git tree as reference:
  git://kernel.ubuntu.com/ikepanhc/ideapad-laptop.git

This patch made against current checkout of mainline kernel.

Signed-off-by: Ike Panhc <ike.pan@canonical.com>
---
 drivers/platform/x86/Kconfig          |   11 +
 drivers/platform/x86/Makefile         |    1 +
 drivers/platform/x86/ideapad-laptop.c |  398 +++++++++++++++++++++++++++++++++
 3 files changed, 410 insertions(+), 0 deletions(-)
 create mode 100644 drivers/platform/x86/ideapad-laptop.c

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 79baa63..e9a203d 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -581,4 +581,15 @@ config INTEL_IPS
 	  functionality.  If in doubt, say Y here; it will only load on
 	  supported platforms.
 
+config IDEAPAD_LAPTOP
+	tristate "Ideapad Laptop Extras"
+	depends on ACPI
+	depends on INPUT
+	select INPUT_SPARSEKMAP
+	---help---
+	  This is the ACPI extra Linux driver for ideapad laptops which enable
+	  ACPI event based hotkey.
+
+	  If you have an Ideapad laptop, say Y or M here.
+
 endif # X86_PLATFORM_DEVICES
diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
index 4744c77..47ca2b9 100644
--- a/drivers/platform/x86/Makefile
+++ b/drivers/platform/x86/Makefile
@@ ...
From: Corentin Chary
Date: Thursday, August 12, 2010 - 11:37 pm

Cool, now we got two ideapad drivers :p.

David just sent an rfkill driver to this list. Maybe you could merge your work ?

Thanks,
-- 
Corentin Chary
http://xf.iksaif.net
--

From: Ike Panhc
Date: Thursday, August 12, 2010 - 11:53 pm

Could you point me where is the rfkill driver? Sorry I do not find it.

I will see what I can do.

Thanks.
--

From: Corentin Chary
Date: Friday, August 13, 2010 - 12:01 am

From: Ike Panhc
Date: Friday, August 13, 2010 - 12:15 am

Yes, I believe I can. will read patch from David and merge.

But I think i will not use \_SB_.SECN as major interface. I know there is
another command code of EC that can access HW switch status and shutdown
the interface.


--

From: David Woodhouse
Date: Friday, August 13, 2010 - 2:22 am

git://git.infradead.org/users/dwmw2/ideapad-2.6.git
	http://git.infradead.org/users/dwmw2/ideapad-2.6.git

After fixing Corentin's review feedback and conferring with Matthew, I
asked Linus to pull it last night -- without the rfkill support, people
were having to reinstall Windows and use it to unblock the rfkill and
get wireless working.

http://bugs.meego.com/show_bug.cgi?id=4086
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/577114
http://forums.lenovo.com/t5/Linux-Discussion/Solution-to-rfkill-wireless-problems-w-Id...

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation

--

From: David Woodhouse
Date: Friday, August 13, 2010 - 2:14 am

Hm, interesting. What model (and BIOS version) are you testing with?

On my S10-3, (DMI BIOS version 2ACN23WW, date 03/12/2010), I get these
keys through the normal keyboard controller -- and we can tell the
brightness up/down apart, too.

http://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h=9cd075e3

Do you see those keycodes too... and do they *stop* arriving through the
keyboard controller when you load your driver?

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation

--

From: Ike Panhc
Date: Friday, August 13, 2010 - 2:27 am

I have two machine, B550 and S10-3, the BIOS date/version of S10-3 is the
Yes, IIRC EC will send i8042 keycode when you booting with QS button, not
with power button. atkbd.c reports unknown key after booting with QS button.

--

From: David Woodhouse
Date: Friday, August 13, 2010 - 2:34 am

That's interesting. I don't *ever* boot with the QS button; I get the
keycodes when I boot normally. I tried the QS button precisely once, but
only *after* I blew away the original contents of the hard drive with my
MeeGo installation, so it didn't boot.

Do you know how to restore it? Or do you have a copy of the 'lenovo-ec'
module that it apparently contains?

I did keep the Windows restore partition, just in case I needed to go
back to it to get wireless working. But when I tried to recover, it told
me it didn't like my partition table -- so I fixed that and next time I
booted into the OS recovery, it just dumped me at a command prompt and
didn't even manage to start the graphical recovery tool.

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation

--

From: Ike Panhc
Date: Friday, August 13, 2010 - 7:56 pm

No, I received the ideapads without any OS preinstalled, and get the design
spec with NDA. I asked and got the approve to send the driver to mainline
kernel according to the spec.

Since your driver is pulled. I am happy to have another patch made against
your driver and post again.

--

From: David Woodhouse
Date: Saturday, August 14, 2010 - 2:49 am

Cool. I'd like to have a copy of that spec. Please could you tell me who
in Lenovo (presumably) I should contact?

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation

--

From: Len Brown
Date: Saturday, August 14, 2010 - 7:33 pm

If you merge the drivers, I'd sure prefer the name "ideapad-laptop"
over "ideapad-acpi".

While the maintainerless "toshiba-acpi" driver was a pioneer,
and thinkpad-acpi feared installed-base confusion when considering
a name change, we tend to reserve the "acpi" in drivers for things
that supply ACPI, rather than simply use ACPI.

Also, you may find that the platform driver ends up doing
more for the laptop than just using what is behind its
platform-specific ACPI extension.

thanks,
Len Brown, Intel Open Source Technology Center

--

From: Florian Echtler
Date: Sunday, August 15, 2010 - 1:14 am

Hello David,

I do have that module: I coaxed it out of Lenovo with the help of
gpl-violations.org as no source was available on my S10-3t. Since it is
flagged as Dual BSD/GPL license, there should be no harm in posting it
here. I hope it helps you in some way.

Florian
From: Florian Echtler
Date: Sunday, August 15, 2010 - 1:20 am

Hello David,

I do have that module: I coaxed it out of Lenovo with the help of
gpl-violations.org as no source was available on my S10-3t. Since it is
flagged as Dual BSD/GPL license, there should be no harm in posting it
here. I hope it helps you in some way.

Florian

Previous thread: [PATCH] pxa: fix CI_HSYNC and CI_VSYNC MFP defines by Axel Lin on Thursday, August 12, 2010 - 8:39 pm. (2 messages)

Next thread: [Resend][Patch v2] kexec: increase max of kexec segments and use dynamic allocation by Amerigo Wang on Thursday, August 12, 2010 - 10:38 pm. (3 messages)