diff options
5 files changed, 207 insertions, 0 deletions
diff --git a/platform-samsung_laptop-add-dmi-information-for-samsung-r700-laptops.patch b/platform-samsung_laptop-add-dmi-information-for-samsung-r700-laptops.patch new file mode 100644 index 00000000000000..b6cff1f2fb5777 --- /dev/null +++ b/platform-samsung_laptop-add-dmi-information-for-samsung-r700-laptops.patch @@ -0,0 +1,41 @@ +From stefanbeller@googlemail.com Tue May 10 15:35:01 2011 +Date: Wed, 30 Mar 2011 17:58:45 +0200 +Message-ID: <AANLkTin1Uvg=-2zkhMQoCOusu1xrS6TYA0LUom=jp_ZV@mail.gmail.com> +Subject: platform: samsung_laptop: add dmi information for Samsung R700 laptops +From: Stefan Beller <stefanbeller@googlemail.com> +To: gregkh@suse.de + +My DMI model is this: +>dmesg |grep DMI +[ 0.000000] DMI present. +[ 0.000000] DMI: SAMSUNG ELECTRONICS CO., LTD. SR700/SR700, BIOS +04SR 02/20/2008 + +adding dmi information of Samsung R700 laptops +This adds the dmi information of Samsungs R700 laptops. + +Signed-off-by: Stefan Beller <stefanbeller@googlemail.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 +@@ -621,6 +621,15 @@ static struct dmi_system_id __initdata s + .callback = dmi_check_cb, + }, + { ++ .ident = "R700", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "SR700"), ++ DMI_MATCH(DMI_BOARD_NAME, "SR700"), ++ }, ++ .callback = dmi_check_cb, ++ }, ++ { + .ident = "R530/R730", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), diff --git a/platform-samsung_laptop-add-support-for-samsung-nc210-nc110.patch b/platform-samsung_laptop-add-support-for-samsung-nc210-nc110.patch new file mode 100644 index 00000000000000..1b64ebd97b48d7 --- /dev/null +++ b/platform-samsung_laptop-add-support-for-samsung-nc210-nc110.patch @@ -0,0 +1,68 @@ +From jasonbstubbs@gmail.com Tue May 10 15:37:55 2011 +From: Jason Stubbs <jasonbstubbs@gmail.com> +To: Greg KH <gregkh@suse.de> +Subject: platform: samsung_laptop: add support for samsung nc210/nc110 +Date: Wed, 20 Apr 2011 15:07:54 +1000 +Cc: linux-kernel@vger.kernel.org +Message-Id: <201104201507.54862.jasonbstubbs@gmail.com> + +From: Jason Stubbs <jasonbstubbs@gmail.com> + +Note, I don't expect this patch to go in and would actually just like some +feedback on how to better handle the set_brightness problem. Note also that +this patch won't apply on top of my brightness min/max fixes patch and I'll +redo this one as necessary. + +This patch adds support for the NC210/NC110 to the samsung-laptop driver. + +All SABI commands except for set_brightness work as expected. The behaviour +of set_brightness is as follows: + +- Setting a new brightness will only step one level toward the new brightness + level. For example, setting a level of 5 when the current level is 2 will + 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. + +The changes in set_brightness() work around the above while attempting to +minimize flicker due to jumping to and from brightness level 0. + +Signed-off-by: Jason Stubbs <jasonbstubbs@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/platform/x86/samsung-laptop.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +--- a/drivers/platform/x86/samsung-laptop.c ++++ b/drivers/platform/x86/samsung-laptop.c +@@ -380,6 +380,12 @@ static void set_brightness(u8 user_brigh + { + u8 user_level = user_brightness - sabi_config->min_brightness; + ++ if (user_level == read_brightness()) ++ return; ++ ++ if (sabi_config->min_brightness == 0 && user_level != 0) ++ sabi_set_command(sabi_config->commands.set_brightness, 0); ++ + sabi_set_command(sabi_config->commands.set_brightness, user_level); + } + +@@ -675,6 +681,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 new file mode 100644 index 00000000000000..e44f0022f5639f --- /dev/null +++ b/platform-samsung_laptop-add-support-for-x520-machines.patch @@ -0,0 +1,36 @@ +From tmassimi@gmail.com Tue May 10 15:40:27 2011 +From: Tommaso Massimi <tmassimi@gmail.com> +Date: Sat, 23 Apr 2011 22:36:37 +0200 +Message-ID: <BANLkTimYBw5BfZWinUy0OtyhJFXygxKnmg@mail.gmail.com> +Subject: Platform: samsung_laptop: add support for X520 machines. +To: linux-kernel@vger.kernel.org, Greg Kroah-Hartman <gregkh@suse.de> + +From: Tommaso Massimi <tmassimi@gmail.com> + +my samsung laptop would be very happy if you add +these lines to the file drivers/platform/x86/samsung-laptop.c + +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 +@@ -690,6 +690,15 @@ static struct dmi_system_id __initdata s + }, + .callback = dmi_check_cb, + }, ++ { ++ .ident = "X520", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "X520"), ++ DMI_MATCH(DMI_BOARD_NAME, "X520"), ++ }, ++ .callback = dmi_check_cb, ++ }, + { }, + }; + MODULE_DEVICE_TABLE(dmi, samsung_dmi_table); diff --git a/platform-samsung_laptop-fix-samsung-brightness-min-max-calculations.patch b/platform-samsung_laptop-fix-samsung-brightness-min-max-calculations.patch new file mode 100644 index 00000000000000..f561b8cad86198 --- /dev/null +++ b/platform-samsung_laptop-fix-samsung-brightness-min-max-calculations.patch @@ -0,0 +1,61 @@ +From jasonbstubbs@gmail.com Thu May 12 09:42:26 2011 +From: Jason Stubbs <jasonbstubbs@gmail.com> +To: Greg KH <greg@kroah.com> +Subject: platform: samsung_laptop: fix samsung brightness min/max calculations +Date: Thu, 12 May 2011 12:32:38 +1000 +Cc: Greg KH <gregkh@suse.de>, linux-kernel@vger.kernel.org +Message-Id: <201105121232.39157.jasonbstubbs@gmail.com> + +From: Jason Stubbs <jasonbstubbs@gmail.com> + +For one of the SABI configs, the valid brightness levels are 1 through 8 with +0 being reserved for the BIOS. To make the range 0-based, the driver is meant +to offset values to/from userspace by 1 giving valid levels of 0 through 7. + +Currently, the driver is reporting a max brightness of 8 and doing the offset +the wrong way such that setting a brightness of 8 will set as 7 in hardware +while setting a brightness of 0 will attempt (and fail) to set as -1 in +hardware. + +This patch fixes these calculations as well as a potential miscalculation due +to an assumption of min_brightness being either 0 or 1. + +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, 6 insertions(+), 3 deletions(-) + +--- a/drivers/platform/x86/samsung-laptop.c ++++ b/drivers/platform/x86/samsung-laptop.c +@@ -370,15 +370,17 @@ static u8 read_brightness(void) + &sretval); + if (!retval) { + user_brightness = sretval.retval[0]; +- if (user_brightness != 0) ++ if (user_brightness > sabi_config->min_brightness) + user_brightness -= sabi_config->min_brightness; ++ else ++ user_brightness = 0; + } + return user_brightness; + } + + static void set_brightness(u8 user_brightness) + { +- u8 user_level = user_brightness - sabi_config->min_brightness; ++ u8 user_level = user_brightness + sabi_config->min_brightness; + + if (user_level == read_brightness()) + return; +@@ -815,7 +817,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; +- props.max_brightness = sabi_config->max_brightness; ++ props.max_brightness = sabi_config->max_brightness - ++ sabi_config->min_brightness; + backlight_device = backlight_device_register("samsung", &sdev->dev, + NULL, &backlight_ops, + &props); @@ -48,3 +48,4 @@ 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-fix-samsung-brightness-min-max-calculations.patch |
