Platform: add Samsung Laptop platform driver
Subsystems (2)
PATCH 1/1 Platform: add Samsung Laptop platform driver
From: Greg Kroah-Hartman <[email protected]>
This adds the samsung-laptop driver to the kernel. It now supports all known Samsung laptops that use the SABI interface.
--- Documentation/ABI/testing/sysfs-driver-samsung-laptop | 19 drivers/platform/x86/Kconfig | 13 drivers/platform/x86/Makefile | 1 drivers/platform/x86/samsung-laptop.c | 832 ++++++++++++++++++ 4 files changed, 865 insertions(+)
Matthew, this is a copy of the latest version in the linux-next tree of the driver. Once it has been accepted into your tree, I'll delete the staging driver. Or, if you want to give your ACK, I can just move the driver from staging into this directory in my tree, which will properly preserve the history of the code.
v2 - I have also addressed all of the review comments you gave me
previously, and fixed a bug in the previous version that broke the driver on the N128 laptop, as well as added support for a wide range of other laptops thanks to many testers who sent in patches.
v3 - Added a few more device ids, const changes, and now supports
variable brightness levels as not all laptops are the same with this.
Documentation/ABI/testing/sysfs-driver-samsung-laptop new file +19 -0
@@ -0,0 +1,19 @@ +What: /sys/devices/platform/samsung/performance_level +Date: January 1, 2010 +KernelVersion: 2.6.33 +Contact: Greg Kroah-Hartman <[email protected]> +Description: Some Samsung laptops have different "performance levels" + that are can be modified by a function key, and by this + sysfs file. These values don't always make a whole lot + of sense, but some users like to modify them to keep + their fans quiet at all costs. Reading from this file + will show the current performance level. Writing to the + file can change this value. + Valid options: + "silent" + "normal" + "overclock" + Note that not all laptops support all of these options. + Specifically, not all support the "overclock" option, + and it's still unknown if this value even changes + anything, other than making the user feel a bit better.
drivers/platform/x86/Kconfig +13 -0
@@ -654,4 +654,17 @@ config XO1_RFKILL Support for enabling/disabling the WLAN interface on the OLPC XO-1 laptop. +config SAMSUNG_LAPTOP + tristate "Samsung Laptop driver" + depends on RFKILL && BACKLIGHT_CLASS_DEVICE && X86 + ---help--- + This module implements a driver for a wide range of different + Samsung laptops. It offers control over the different + function keys, wireless LED, LCD backlight level, and + sometimes provides a "performance_control" sysfs file to allow + the performance level of the laptop to be changed. + + To compile this driver as a module, choose M here: the module + will be called samsung-laptop. + endif # X86_PLATFORM_DEVICES
drivers/platform/x86/Makefile +1 -0
@@ -34,3 +34,4 @@ obj-$(CONFIG_INTEL_IPS) += intel_ips.o obj-$(CONFIG_GPIO_INTEL_PMIC) += intel_pmic_gpio.o obj-$(CONFIG_XO1_RFKILL) += xo1-rfkill.o obj-$(CONFIG_IBM_RTL) += ibm_rtl.o +obj-$(CONFIG_SAMSUNG_LAPTOP) += samsung-laptop.o
drivers/platform/x86/samsung-laptop.c new file +832 -0
832 lines not on this page · raw message
Matthew Garrett
AppliedApplied, thanks.
Signature · 1 line
Matthew Garrett | [email protected]
Quoted 1 line · Matthew Garrett
Applied, thanks.
Great, any pointers to where it was applied? I think I need to send you a few more 'add a new device id' patches and I want to make sure I get the right version to patch against.
thanks,
greg k-h
Quoted 6 lines · Greg KH
Quoted 1 line · Matthew Garrett
Applied, thanks.
Great, any pointers to where it was applied? I think I need to send you a few more 'add a new device id' patches and I want to make sure I get the right version to patch against.
http://git.kernel.org/?p=linux/kernel/git/mjg59/platform-drivers-x86.git;a=shortlog;h=refs/heads/linux-next
- ideally we'd just have it id against all Samsung laptops and check for SABI? Or are there machines where that might break?
Signature · 1 line
Matthew Garrett | [email protected]
Quoted 9 lines · Matthew Garrett
Quoted 6 lines · Greg KH
Quoted 1 line · Matthew Garrett
Applied, thanks.
Great, any pointers to where it was applied? I think I need to send you a few more 'add a new device id' patches and I want to make sure I get the right version to patch against.
Thanks.
Quoted 2 lines
- ideally we'd just have it id against all Samsung laptops and check for SABI? Or are there machines where that might break?
I thought all samsung laptops had SABI, but as the other samsung laptop driver shows, that's not true.
I don't know what happens if we try to check for SABI on those machines. We are just rooting around in the BIOS rom and reading values, _hopefully_ that wouldn't break any other machines, but I don't really know.
I wouldn't mind just doing a DMI match on all Samsung laptops, it would save me having to constantly send patch updates, so I'll let this be your call :)
thanks,
greg k-h
Quoted 3 lines · Greg KH
I wouldn't mind just doing a DMI match on all Samsung laptops, it would save me having to constantly send patch updates, so I'll let this be your call :)
I think it'd be worth a go, at least. dell-laptop has example alias lines for that, there's a few different DMI classes that can be used for laptops so you'd need to check which one Samsung are using.
Signature · 1 line
Matthew Garrett | [email protected]
Hi Matthew,
concering the hp-wmi driver I would like to answer a few questions.
My GNU/Linux Debian system with a self compiled custom kernel 2.6.37.3 is running on a HP Pavilion DV7-4151sg notebook (dmidecode output, DSDT, and kernel config attached).
I activated the driver on my HP notebook in order to achieve several goals:
(1) make the rfkill hardware button work
(seems to work according to the output of rfkill list and acpi_listen)
(2) make the buttons for lowering and increasing display brightness work (do not work, no output with acpi_listen)
(3) the display back side has an illuminated "hp" logo which I would like to be able to switch off (alone or together with the display) to save a little energy
How can I found out if these functionality is achievable via ACPI WMI functions or somehow else?
What would I have to change in hp-wmi.c?
Any help is appreciated.
Best regards,
Jörg-Volker.
HP WMI driver
In reply to Matthew GarrettHi Matthew,
concering the hp-wmi driver I would like to answer a few questions.
My GNU/Linux Debian system with a self compiled custom kernel 2.6.37.3 is running on a HP Pavilion DV7-4151sg notebook (dmidecode output, DSDT, and kernel config attached).
I activated the driver on my HP notebook in order to achieve several goals:
(1) make the rfkill hardware button work
(seems to work according to the output of rfkill list and acpi_listen)
(2) make the buttons for lowering and increasing display brightness work (do not work, no output with acpi_listen)
(3) the display back side has an illuminated "hp" logo which I would like to be able to switch off (alone or together with the display) to save a little energy
How can I found out if these functionality is achievable via ACPI WMI functions or somehow else?
What would I have to change in hp-wmi.c?
By the way, I see the following messages in dmesg concerning WMI (these messages did not appear before 2.6.37.4):
ACPI Error: Field [D128] at 1040 exceeds Buffer [NULL] size 160 (bits) (20101013/dsopcode-597)
ACPI Error: Method parse/execution failed [\_SB_.WMID.HWMC] (Node ffff88011be42320), AE_AML_BUFFER_LIMIT (20101013/psparse-537) ACPI Error: Method parse/execution failed [\_SB_.WMID.WMAD] (Node ffff88011be42500), AE_AML_BUFFER_LIMIT (20101013/psparse-537) ACPI Error: Field [D128] at 1040 exceeds Buffer [NULL] size 160 (bits) (20101013/dsopcode-597)
ACPI Error: Method parse/execution failed [\_SB_.WMID.HWMC] (Node ffff88011be42320), AE_AML_BUFFER_LIMIT (20101013/psparse-537) ACPI Error: Method parse/execution failed [\_SB_.WMID.WMAD] (Node ffff88011be42500), AE_AML_BUFFER_LIMIT (20101013/psparse-537) ACPI Error: Field [D128] at 1040 exceeds Buffer [NULL] size 160 (bits) (20101013/dsopcode-597)
ACPI Error: Method parse/execution failed [\_SB_.WMID.HWMC] (Node ffff88011be42320), AE_AML_BUFFER_LIMIT (20101013/psparse-537) ACPI Error: Method parse/execution failed [\_SB_.WMID.WMAD] (Node ffff88011be42500), AE_AML_BUFFER_LIMIT (20101013/psparse-537)
hp-wmi: probe of hp-wmi failed with error -22
Any help is appreciated.
Best regards,
Jörg-Volker.
P.S.: Please excuse the previous unready e-mail with the wrong subject.