Home Home > GIT Browse > SLE15-SP1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2009-08-17 12:11:11 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2009-08-17 12:11:11 -0700
commit958e3f575ed3601898747ff16fd8e044e33a351b (patch)
tree99480cad4943e52b91f99bdab4bcbdf9ef9c6eb2
parent0dafc35c3b337f0d48420be46df7b8b5c4e20f96 (diff)
- patches.drivers/samsung-backlight-driver.patch: Change the range fromrpm-2.6.31-3
0-255 to 0-7 to make it easier for HAL to handle the device without a need for custom scripts.
-rw-r--r--kernel-source.changes7
-rw-r--r--patches.drivers/samsung-backlight-driver.patch39
2 files changed, 37 insertions, 9 deletions
diff --git a/kernel-source.changes b/kernel-source.changes
index b765ff1232..35076b6083 100644
--- a/kernel-source.changes
+++ b/kernel-source.changes
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Mon Aug 17 21:10:55 CEST 2009 - gregkh@suse.de
+
+- patches.drivers/samsung-backlight-driver.patch: Change the range from
+ 0-255 to 0-7 to make it easier for HAL to handle the device without a
+ need for custom scripts.
+
+-------------------------------------------------------------------
Mon Aug 17 16:38:38 CEST 2009 - jeffm@suse.com
- Updated to 2.6.31-rc6.
diff --git a/patches.drivers/samsung-backlight-driver.patch b/patches.drivers/samsung-backlight-driver.patch
index b1e6df1599..0acb8952b6 100644
--- a/patches.drivers/samsung-backlight-driver.patch
+++ b/patches.drivers/samsung-backlight-driver.patch
@@ -25,8 +25,8 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/platform/x86/Kconfig | 12 ++
drivers/platform/x86/Makefile | 1
- drivers/platform/x86/samsung-backlight.c | 157 +++++++++++++++++++++++++++++++
- 3 files changed, 170 insertions(+)
+ drivers/platform/x86/samsung-backlight.c | 178 +++++++++++++++++++++++++++++++
+ 3 files changed, 191 insertions(+)
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -56,7 +56,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+obj-$(CONFIG_SAMSUNG_BACKLIGHT) += samsung-backlight.o
--- /dev/null
+++ b/drivers/platform/x86/samsung-backlight.c
-@@ -0,0 +1,157 @@
+@@ -0,0 +1,178 @@
+/*
+ * Samsung N130 and NC10 Laptop Backlight driver
+ *
@@ -66,6 +66,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
++ *
+ */
+
+#include <linux/kernel.h>
@@ -76,9 +77,21 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+#include <linux/fb.h>
+#include <linux/dmi.h>
+
-+#define MAX_BRIGHT 0xff
++#define MAX_BRIGHT 0x07
+#define OFFSET 0xf4
+
++/*
++ * HAL/gnome-display-manager really wants us to only set 8 different levels for
++ * the brightness control. And since 256 different levels seems a bit
++ * overkill, that's fine. So let's map the 256 values to 8 different ones:
++ *
++ * userspace 0 1 2 3 4 5 6 7
++ * hardware 0 36 72 108 144 180 216 252
++ *
++ * or hardware = (userspace * 36) - 1 iff userspace != 0
++ */
++
++
+static int offset = OFFSET;
+module_param(offset, int, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(offset, "The offset into the PCI device for the brightness control");
@@ -88,15 +101,23 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+static u8 read_brightness(void)
+{
-+ u8 brightness;
++ u8 kernel_brightness;
++ u8 user_brightness = 0;
+
-+ pci_read_config_byte(pci_device, offset, &brightness);
-+ return brightness;
++ pci_read_config_byte(pci_device, offset, &kernel_brightness);
++ if (kernel_brightness != 0)
++ user_brightness = kernel_brightness / 36;
++
++ return user_brightness;
+}
+
-+static void set_brightness(u8 brightness)
++static void set_brightness(u8 user_brightness)
+{
-+ pci_write_config_byte(pci_device, offset, brightness);
++ u16 kernel_brightness = 0;
++
++ if (user_brightness != 0)
++ kernel_brightness = (user_brightness * 36) - 1;
++ pci_write_config_byte(pci_device, offset, (u8)kernel_brightness);
+}
+
+static int get_brightness(struct backlight_device *bd)