aboutsummaryrefslogtreecommitdiffstats
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2011-09-01 15:47:31 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2011-09-01 15:47:31 -0700
commita85790dce910516ab81087807e7129aac0c99c25 (patch)
tree0b0d5d7f5e69ada1c155703a79d10e5ff67e66a9
parent5ca416c5fc64a87b3cc8bc278d317fd839315627 (diff)
downloadpatches-a85790dce910516ab81087807e7129aac0c99c25.tar.gz
more samsung patches
-rw-r--r--platform-brightness-quirk-for-samsung-laptop-driver.patch (renamed from platform-samsung_laptop-add-support-for-samsung-nc210-nc110.patch)63
-rw-r--r--platform-fix-error-path-in-samsung-laptop-init.patch4
-rw-r--r--platform-fix-samsung-laptop-dmi-identification-for-n220-model.patch35
-rw-r--r--platform-samsung-laptop-dmi-info-for-nc210-nc110.patch38
-rw-r--r--platform-samsung_laptop-add-support-for-x520-machines.patch2
-rw-r--r--platform-samsung_laptop-fix-samsung-brightness-min-max-calculations.patch8
-rw-r--r--platform-samsung_laptop-samsung-backlight-for-r528-r728.patch2
-rw-r--r--series4
8 files changed, 107 insertions, 49 deletions
diff --git a/platform-samsung_laptop-add-support-for-samsung-nc210-nc110.patch b/platform-brightness-quirk-for-samsung-laptop-driver.patch
index 952ed0842c7bff..59ba50df218eb9 100644
--- a/platform-samsung_laptop-add-support-for-samsung-nc210-nc110.patch
+++ b/platform-brightness-quirk-for-samsung-laptop-driver.patch
@@ -1,15 +1,14 @@
-From jasonbstubbs@gmail.com Mon Jun 13 16:55:59 2011
+From jasonbstubbs@gmail.com Thu Sep 1 15:44:36 2011
+Message-ID: <4E576E50.4070500@gmail.com>
+Date: Fri, 26 Aug 2011 19:58:40 +1000
From: Jason Stubbs <jasonbstubbs@gmail.com>
To: Greg KH <greg@kroah.com>
-Subject: platform: samsung_laptop: add support for samsung nc210/nc110
-Date: Fri, 13 May 2011 20:47:07 +1000
-Cc: Greg KH <gregkh@suse.de>
-Message-Id: <201105132047.07544.jasonbstubbs@gmail.com>
+CC: David Herrmann <dh.herrmann@googlemail.com>, platform-driver-x86@vger.kernel.org, <mjg@redhat.com>
+Subject: Platform: Brightness quirk for samsung laptop driver
From: Jason Stubbs <jasonbstubbs@gmail.com>
-This patch adds support for the NC210/NC110 to the samsung-laptop driver.
-
+On some Samsung laptops the brightness regulation works slightly different.
All SABI commands except for set_brightness work as expected. The behaviour
of set_brightness is as follows:
@@ -18,18 +17,18 @@ of set_brightness is as follows:
result in a brightness level of 3.
- A spurious KEY_BRIGHTNESS_UP or KEY_BRIGHTNESS_DOWN event is also generated
along with the change in brightness.
-- Neither of the above two issues occur when changing from/to brightness level 0.
+- Neither of the above two issues occur when changing from/to brightness
+ level 0.
-Along with adding the DMI checks for the NC210/NC110, this patch adds
-detection and a non-intrusive workaround for the above issues.
+This patch adds detection and a non-intrusive workaround for the above issues.
Signed-off-by: Jason Stubbs <jasonbstubbs@gmail.com>
-Cc: stable <stable@kernel.org>
+Tested-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
- drivers/platform/x86/samsung-laptop.c | 52 ++++++++++++++++++++++++++++++++++
- 1 file changed, 52 insertions(+)
+ drivers/platform/x86/samsung-laptop.c | 43 ++++++++++++++++++++++++++++++++++
+ 1 file changed, 43 insertions(+)
--- a/drivers/platform/x86/samsung-laptop.c
+++ b/drivers/platform/x86/samsung-laptop.c
@@ -37,13 +36,13 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
static struct mutex sabi_mutex;
static struct platform_device *sdev;
static struct rfkill *rfk;
-+static int has_stepping_quirk;
++static bool has_stepping_quirk;
static int force;
module_param(force, bool, 0);
-@@ -380,6 +381,17 @@ static void set_brightness(u8 user_brigh
+@@ -382,6 +383,17 @@ static void set_brightness(u8 user_brigh
{
- u8 user_level = user_brightness - sabi_config->min_brightness;
+ u8 user_level = user_brightness + sabi_config->min_brightness;
+ if (has_stepping_quirk && user_level != 0) {
+ /*
@@ -59,7 +58,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
sabi_set_command(sabi_config->commands.set_brightness, user_level);
}
-@@ -388,6 +400,34 @@ static int get_brightness(struct backlig
+@@ -390,6 +402,34 @@ static int get_brightness(struct backlig
return (int)read_brightness();
}
@@ -69,10 +68,10 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+ u8 check_level;
+
+ /*
-+ * Some laptops (nc210/nc110 at the very least) exhibit the strange
-+ * behaviour of stepping toward rather than setting the brightness
-+ * except when changing to/from brightness level 0. This behaviour
-+ * is checked for here and worked around in set_brightness.
++ * Some laptops exhibit the strange behaviour of stepping toward
++ * (rather than setting) the brightness except when changing to/from
++ * brightness level 0. This behaviour is checked for here and worked
++ * around in set_brightness.
+ */
+
+ if (initial_level <= 2)
@@ -80,11 +79,11 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+ else
+ check_level = initial_level - 2;
+
-+ has_stepping_quirk = 0;
++ has_stepping_quirk = false;
+ set_brightness(check_level);
+
+ if (read_brightness() != check_level) {
-+ has_stepping_quirk = 1;
++ has_stepping_quirk = true;
+ pr_info("enabled workaround for brightness stepping quirk\n");
+ }
+
@@ -94,23 +93,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
static int update_status(struct backlight_device *bd)
{
set_brightness(bd->props.brightness);
-@@ -695,6 +735,15 @@ static struct dmi_system_id __initdata s
- },
- .callback = dmi_check_cb,
- },
-+ {
-+ .ident = "NC210/NC110",
-+ .matches = {
-+ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
-+ DMI_MATCH(DMI_PRODUCT_NAME, "NC210/NC110"),
-+ DMI_MATCH(DMI_BOARD_NAME, "NC210/NC110"),
-+ },
-+ .callback = dmi_check_cb,
-+ },
- { },
- };
- MODULE_DEVICE_TABLE(dmi, samsung_dmi_table);
-@@ -803,6 +852,9 @@ static int __init samsung_init(void)
+@@ -823,6 +863,9 @@ static int __init samsung_init(void)
}
}
diff --git a/platform-fix-error-path-in-samsung-laptop-init.patch b/platform-fix-error-path-in-samsung-laptop-init.patch
index 5940b874c1c414..bee13feb950e48 100644
--- a/platform-fix-error-path-in-samsung-laptop-init.patch
+++ b/platform-fix-error-path-in-samsung-laptop-init.patch
@@ -18,7 +18,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- a/drivers/platform/x86/samsung-laptop.c
+++ b/drivers/platform/x86/samsung-laptop.c
-@@ -848,7 +848,7 @@ static int __init samsung_init(void)
+@@ -799,7 +799,7 @@ static int __init samsung_init(void)
sabi_iface = ioremap_nocache(ifaceP, 16);
if (!sabi_iface) {
pr_err("Can't remap %x\n", ifaceP);
@@ -27,7 +27,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
}
if (debug) {
printk(KERN_DEBUG "ifaceP = 0x%08x\n", ifaceP);
-@@ -903,7 +903,6 @@ static int __init samsung_init(void)
+@@ -851,7 +851,6 @@ static int __init samsung_init(void)
if (retval)
goto error_file_create;
diff --git a/platform-fix-samsung-laptop-dmi-identification-for-n220-model.patch b/platform-fix-samsung-laptop-dmi-identification-for-n220-model.patch
new file mode 100644
index 00000000000000..ebf558197f672c
--- /dev/null
+++ b/platform-fix-samsung-laptop-dmi-identification-for-n220-model.patch
@@ -0,0 +1,35 @@
+From f934ff08872c1c894ef124bca4aeab4f50d641cc Mon Sep 17 00:00:00 2001
+From: Raul Gutierrez Segales <rgs@collabora.co.uk>
+Date: Tue, 30 Aug 2011 16:52:01 +0100
+Subject: [PATCH] Platform: fix samsung-laptop DMI identification for N220 model
+
+This is a follow-up for commit 78a7539b, which didn't cover the
+Samsung N220 laptop. With this backlight brightness works nicely
+on the N220 netbook.
+
+Signed-off-by: Raul Gutierrez Segales <rgs@collabora.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/platform/x86/samsung-laptop.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/drivers/platform/x86/samsung-laptop.c
++++ b/drivers/platform/x86/samsung-laptop.c
+@@ -663,6 +663,16 @@ static struct dmi_system_id __initdata s
+ .callback = dmi_check_cb,
+ },
+ {
++ .ident = "N220",
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR,
++ "SAMSUNG ELECTRONICS CO., LTD."),
++ DMI_MATCH(DMI_PRODUCT_NAME, "N220"),
++ DMI_MATCH(DMI_BOARD_NAME, "N220"),
++ },
++ .callback = dmi_check_cb,
++ },
++ {
+ .ident = "N150/N210/N220/N230",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR,
diff --git a/platform-samsung-laptop-dmi-info-for-nc210-nc110.patch b/platform-samsung-laptop-dmi-info-for-nc210-nc110.patch
new file mode 100644
index 00000000000000..e5c143c3dfbfa7
--- /dev/null
+++ b/platform-samsung-laptop-dmi-info-for-nc210-nc110.patch
@@ -0,0 +1,38 @@
+From jasonbstubbs@gmail.com Thu Sep 1 15:45:04 2011
+Message-ID: <4E578A42.4080809@gmail.com>
+Date: Fri, 26 Aug 2011 21:57:54 +1000
+From: Jason Stubbs <jasonbstubbs@gmail.com>
+To: Greg KH <greg@kroah.com>
+CC: David Herrmann <dh.herrmann@googlemail.com>, platform-driver-x86@vger.kernel.org, <mjg@redhat.com>
+Subject: [PATCH] Platform: Samsung laptop DMI info for NC210/NC110
+
+From: Jason Stubbs <jasonbstubbs@gmail.com>
+
+This patch just adds the DMI info for the samsung laptop driver to work with
+the NC210/NC110. It needs the brightness quirk patch for proper support.
+
+Signed-off-by: Jason Stubbs <jasonbstubbs@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/platform/x86/samsung-laptop.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/drivers/platform/x86/samsung-laptop.c
++++ b/drivers/platform/x86/samsung-laptop.c
+@@ -755,6 +755,15 @@ static struct dmi_system_id __initdata s
+ },
+ .callback = dmi_check_cb,
+ },
++ {
++ .ident = "NC210/NC110",
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
++ DMI_MATCH(DMI_PRODUCT_NAME, "NC210/NC110"),
++ DMI_MATCH(DMI_BOARD_NAME, "NC210/NC110"),
++ },
++ .callback = dmi_check_cb,
++ },
+ { },
+ };
+ MODULE_DEVICE_TABLE(dmi, samsung_dmi_table);
diff --git a/platform-samsung_laptop-add-support-for-x520-machines.patch b/platform-samsung_laptop-add-support-for-x520-machines.patch
index 62170c59245e1e..2be3c5fbe879b8 100644
--- a/platform-samsung_laptop-add-support-for-x520-machines.patch
+++ b/platform-samsung_laptop-add-support-for-x520-machines.patch
@@ -19,7 +19,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- a/drivers/platform/x86/samsung-laptop.c
+++ b/drivers/platform/x86/samsung-laptop.c
-@@ -744,6 +744,15 @@ static struct dmi_system_id __initdata s
+@@ -695,6 +695,15 @@ static struct dmi_system_id __initdata s
},
.callback = dmi_check_cb,
},
diff --git a/platform-samsung_laptop-fix-samsung-brightness-min-max-calculations.patch b/platform-samsung_laptop-fix-samsung-brightness-min-max-calculations.patch
index a2d5e9190721ca..3887cc3f6700c8 100644
--- a/platform-samsung_laptop-fix-samsung-brightness-min-max-calculations.patch
+++ b/platform-samsung_laptop-fix-samsung-brightness-min-max-calculations.patch
@@ -28,7 +28,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- a/drivers/platform/x86/samsung-laptop.c
+++ b/drivers/platform/x86/samsung-laptop.c
-@@ -371,15 +371,17 @@ static u8 read_brightness(void)
+@@ -370,15 +370,17 @@ static u8 read_brightness(void)
&sretval);
if (!retval) {
user_brightness = sretval.retval[0];
@@ -46,9 +46,9 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
- u8 user_level = user_brightness - sabi_config->min_brightness;
+ u8 user_level = user_brightness + sabi_config->min_brightness;
- if (has_stepping_quirk && user_level != 0) {
- /*
-@@ -881,7 +883,8 @@ static int __init samsung_init(void)
+ sabi_set_command(sabi_config->commands.set_brightness, user_level);
+ }
+@@ -829,7 +831,8 @@ static int __init samsung_init(void)
/* create a backlight device to talk to this one */
memset(&props, 0, sizeof(struct backlight_properties));
props.type = BACKLIGHT_PLATFORM;
diff --git a/platform-samsung_laptop-samsung-backlight-for-r528-r728.patch b/platform-samsung_laptop-samsung-backlight-for-r528-r728.patch
index 9bf2b3bbb98a24..e09b7ff7bd762a 100644
--- a/platform-samsung_laptop-samsung-backlight-for-r528-r728.patch
+++ b/platform-samsung_laptop-samsung-backlight-for-r528-r728.patch
@@ -20,7 +20,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- a/drivers/platform/x86/samsung-laptop.c
+++ b/drivers/platform/x86/samsung-laptop.c
-@@ -753,6 +753,15 @@ static struct dmi_system_id __initdata s
+@@ -704,6 +704,15 @@ static struct dmi_system_id __initdata s
},
.callback = dmi_check_cb,
},
diff --git a/series b/series
index 5134dcdcfc16ce..65f99eb8eb5f55 100644
--- a/series
+++ b/series
@@ -46,8 +46,10 @@ gregkh/gkh-version.patch
platform-samsung_laptop-add-dmi-information-for-samsung-r700-laptops.patch
-platform-samsung_laptop-add-support-for-samsung-nc210-nc110.patch
platform-samsung_laptop-add-support-for-x520-machines.patch
platform-samsung_laptop-samsung-backlight-for-r528-r728.patch
platform-samsung_laptop-fix-samsung-brightness-min-max-calculations.patch
platform-fix-error-path-in-samsung-laptop-init.patch
+platform-brightness-quirk-for-samsung-laptop-driver.patch
+platform-samsung-laptop-dmi-info-for-nc210-nc110.patch
+platform-fix-samsung-laptop-dmi-identification-for-n220-model.patch