summaryrefslogtreecommitdiff
path: root/packages/linux/linux-jlime-arm-2.6.17/Mach-Sa1100-Jornada720.patch
diff options
context:
space:
mode:
Diffstat (limited to 'packages/linux/linux-jlime-arm-2.6.17/Mach-Sa1100-Jornada720.patch')
-rw-r--r--packages/linux/linux-jlime-arm-2.6.17/Mach-Sa1100-Jornada720.patch71
1 files changed, 51 insertions, 20 deletions
diff --git a/packages/linux/linux-jlime-arm-2.6.17/Mach-Sa1100-Jornada720.patch b/packages/linux/linux-jlime-arm-2.6.17/Mach-Sa1100-Jornada720.patch
index cbbb98f2bb..89a81c899e 100644
--- a/packages/linux/linux-jlime-arm-2.6.17/Mach-Sa1100-Jornada720.patch
+++ b/packages/linux/linux-jlime-arm-2.6.17/Mach-Sa1100-Jornada720.patch
@@ -1,9 +1,11 @@
---- linux-2.6.17/arch/arm/mach-sa1100/jornada720.c_orig 2006-07-02 20:54:55.000000000 +0000
-+++ linux-2.6.17/arch/arm/mach-sa1100/jornada720.c 2006-07-02 23:12:58.000000000 +0000
-@@ -22,11 +22,139 @@
+--- linux-2.6.17-vanilla/arch/arm/mach-sa1100/jornada720.c 2006-06-18 01:49:35.000000000 +0000
++++ linux-2.6.17/arch/arm/mach-sa1100/jornada720.c 2006-07-10 17:06:11.000000000 +0000
+@@ -22,11 +22,170 @@
#include <asm/mach/map.h>
#include <asm/mach/serial_sa1100.h>
++#include <asm/arch/jornada720.h>
++
+#include <linux/lcd.h>
+#include <linux/backlight.h>
+#include <linux/fb.h>
@@ -43,14 +45,15 @@
+ printk("jornada 720_mcu_byte: timed out\n");
+ return -1;
+ }
-+ Ser4SSDR = MCU_rEVERSE(arg_data) << 8;
++ Ser4SSDR = MCU_REVERSE(arg_data) << 8;
+ udelay(100);
+ while ((Ser4SSSR & SSSR_RNE) == 0);
+ i = Ser4SSDR;
+ if (i > 0xff)
-+ printk("jornada720 mcu_byte: read %x\n". i):
++ printk("jornada720 mcu_byte: read %x\n", i);
+ return MCU_REVERSE(i & 0xff) & 0xff;
+}
++
+
+int jornada720_mcu_start(int arg_data)
+{
@@ -83,23 +86,23 @@
+void jornada720_mcu_init(void)
+{
+
-+ int i;
++ /*int i;
+
+ if (state) {
+ PPSR &= ~PPC_LDD1;
+ PPDR &= PPC_LDD1;
+ }
-+ else {
++ else { */
+ PPSR |= PPC_LDD1;
-+ }
-+ return 0;
++ /*}
++ return 0;*/
+}
+
-+static int jornada720_backlight_get_power(struct backlight_device *bd)
++/*static int jornada720_backlight_get_power(struct backlight_device *bd)
+{
+
+ return ~(PPSR&PPC_LDD1);
-+}
++}*/
+
+static int jornada720_backlight_get_brightness(struct backlight_device *bd)
+{
@@ -112,7 +115,8 @@
+
+static int jornada720_backlight_set_brightness(struct backlight_device *bd)
+{
-+ int brightness = 255 - value;
++ /* TODO: should it be substracted? */
++ int brightness = 255 - bd->props->brightness;
+ jornada720_mcu_start(MCU_SetBrightness);
+ jornada720_mcu_byte(brightness);
+ jornada720_mcu_end();
@@ -121,33 +125,60 @@
+
+static struct backlight_properties jornada720_backlight_properties = {
+ .owner = THIS_MODULE,
-+ .set_power = jornada720_backlight_set_power,
-+ .get_power = jornada720_backlight_get_power,
+ .get_brightness = jornada720_backlight_get_brightness,
-+ .set_brightness = jornada720_backlight_set_brightness,
++ .update_status = jornada720_backlight_set_brightness,
+ .max_brightness = 255,
++};
++
++static int jornada720_lcd_set_power(struct lcd_device *ld, int power)
++{
++ return 0;
++}
++
++static int jornada720_lcd_get_power(struct lcd_device *ld)
++{
++ return 1;
+}
+
-+static struct lcd_properties jornada 720_lcd_properties = {
++static int jornada720_lcd_get_contrast(struct lcd_device *ld)
++{
++ int contrast;
++
++ jornada720_mcu_start(MCU_GetContrast);
++ contrast = jornada720_mcu_read();
++ jornada720_mcu_end();
++
++ return contrast;
++}
++
++static int jornada720_lcd_set_contrast(struct lcd_device *ld, int contrast)
++{
++ jornada720_mcu_start(MCU_SetContrast);
++ jornada720_mcu_byte(contrast);
++ jornada720_mcu_end();
++ return 0;
++}
++
++static struct lcd_properties jornada720_lcd_properties = {
+ .owner = THIS_MODULE,
+ .set_power = jornada720_lcd_set_power,
+ .get_power = jornada720_lcd_get_power,
+ .set_contrast = jornada720_lcd_set_contrast,
-+ .get_contrast = jornada720_lcd_set_contrast,
++ .get_contrast = jornada720_lcd_get_contrast,
+ .max_contrast = 255,
-+}
++};
+
static struct resource sa1111_resources[] = {
[0] = {
.start = 0x40000000,
-@@ -77,6 +205,10 @@
+@@ -77,6 +236,10 @@
PPDR |= PPC_LDD3 | PPC_LDD4;
ret = platform_add_devices(devices, ARRAY_SIZE(devices));
+
+ jornada720_mcu_init();
+ backlight_device_register("e1356fb", 0, &jornada720_backlight_properties);
-+ ldc_device_register("e1356fb", 0, &jornada720_lcd_properties);
++ lcd_device_register("e1356fb", 0, &jornada720_lcd_properties);
}
return ret;
}