diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-26 06:48:11 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-26 06:48:11 -0700 |
| commit | 5ca416c5fc64a87b3cc8bc278d317fd839315627 (patch) | |
| tree | 137a620719b08758d11c56198d55ecad55990ad4 | |
| parent | fa8e7578b83a8ab8411d62a85c690f80d7b9c44d (diff) | |
| download | patches-5ca416c5fc64a87b3cc8bc278d317fd839315627.tar.gz | |
doh, forgot to add the files...
3 files changed, 135 insertions, 0 deletions
diff --git a/platform-fix-error-path-in-samsung-laptop-init.patch b/platform-fix-error-path-in-samsung-laptop-init.patch new file mode 100644 index 00000000000000..5940b874c1c414 --- /dev/null +++ b/platform-fix-error-path-in-samsung-laptop-init.patch @@ -0,0 +1,37 @@ +From dh.herrmann@googlemail.com Wed Aug 24 16:09:42 2011 +From: David Herrmann <dh.herrmann@googlemail.com> +To: platform-driver-x86@vger.kernel.org +Cc: gregkh@suse.de, dh.herrmann@googlemail.com, mjg@redhat.com +Subject: Platform: Fix error path in samsung-laptop init +Date: Tue, 23 Aug 2011 13:03:07 +0200 +Message-Id: <1314097387-3665-1-git-send-email-dh.herrmann@googlemail.com> + +samsung_init() should not return success if not all devices are initialized. +Otherwise, samsung_exit() will dereference sdev NULL pointers and others. + +Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + drivers/platform/x86/samsung-laptop.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/platform/x86/samsung-laptop.c ++++ b/drivers/platform/x86/samsung-laptop.c +@@ -848,7 +848,7 @@ static int __init samsung_init(void) + sabi_iface = ioremap_nocache(ifaceP, 16); + if (!sabi_iface) { + pr_err("Can't remap %x\n", ifaceP); +- goto exit; ++ goto error_no_signature; + } + if (debug) { + printk(KERN_DEBUG "ifaceP = 0x%08x\n", ifaceP); +@@ -903,7 +903,6 @@ static int __init samsung_init(void) + if (retval) + goto error_file_create; + +-exit: + return 0; + + error_file_create: 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..a2d5e9190721ca --- /dev/null +++ b/platform-samsung_laptop-fix-samsung-brightness-min-max-calculations.patch @@ -0,0 +1,60 @@ +From jasonbstubbs@gmail.com Wed Aug 24 16:08:19 2011 +From: Jason Stubbs <jasonbstubbs@gmail.com> +To: Greg KH <greg@kroah.com> +Subject: platform: samsung_laptop: fix samsung brightness min/max calculations +Date: Mon, 20 Jun 2011 07:23:19 +1000 +Cc: Greg KH <gregkh@suse.de>, + linux-kernel@vger.kernel.org +Message-Id: <201106200723.20173.jasonbstubbs@gmail.com> + +From: Jason Stubbs <jasonbstubbs@gmail.com> + +The min_brightness value of the sabi_config is incorrectly used in brightness +calculations. For the config where min_brightness = 1 and max_brightness = 8, +the user visible range should be 0 to 7 with hardware being set in the range +of 1 to 8. What is actually happening is that the user visible range is 0 to +8 with hardware being set in the range of -1 to 7. + +This patch fixes the above issue as well as a miscalculation that would occur +in the case of min_brightness > 1. + +Signed-off-by: Jason Stubbs <jasonbstubbs@gmail.com> +Cc: stable <stable@kernel.org> +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 +@@ -371,15 +371,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 (has_stepping_quirk && user_level != 0) { + /* +@@ -881,7 +883,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); diff --git a/platform-samsung_laptop-samsung-backlight-for-r528-r728.patch b/platform-samsung_laptop-samsung-backlight-for-r528-r728.patch new file mode 100644 index 00000000000000..9bf2b3bbb98a24 --- /dev/null +++ b/platform-samsung_laptop-samsung-backlight-for-r528-r728.patch @@ -0,0 +1,38 @@ +From xor@xorik.ru Wed Aug 24 16:05:07 2011 +From: Smelov Andrey <xor29a@bk.ru> +Subject: Platform: samsung_laptop: samsung backlight for R528/R728 +To: Greg Kroah-Hartman <gregkh@suse.de> +Date: Sat, 11 Jun 2011 14:35:51 +0400 +Message-ID: <1307788551.16735.2.camel@notebook> + + +patch works for me, but I need to add "acpi_backlight=vendor" to kernel +params + +Signed-off-by: Smelov Andrey <xor29a@bk.ru> +Cc: stable <stable@kernel.org> +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 +@@ -753,6 +753,15 @@ static struct dmi_system_id __initdata s + }, + .callback = dmi_check_cb, + }, ++ { ++ .ident = "R528/R728", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "R528/R728"), ++ DMI_MATCH(DMI_BOARD_NAME, "R528/R728"), ++ }, ++ .callback = dmi_check_cb, ++ }, + { }, + }; + MODULE_DEVICE_TABLE(dmi, samsung_dmi_table); |
