diff options
author | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
---|---|---|
committer | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
commit | 709c4d66e0b107ca606941b988bad717c0b45d9b (patch) | |
tree | 37ee08b1eb308f3b2b6426d5793545c38396b838 /packages/linux/opensimpad/simpad-backlight-if.patch | |
parent | fa6cd5a3b993f16c27de4ff82b42684516d433ba (diff) |
rename packages/ to recipes/ per earlier agreement
See links below for more details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816
Signed-off-by: Denys Dmytriyenko <denis@denix.org>
Acked-by: Mike Westerhof <mwester@dls.net>
Acked-by: Philip Balister <philip@balister.org>
Acked-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Marcin Juszkiewicz <hrw@openembedded.org>
Acked-by: Koen Kooi <koen@openembedded.org>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'packages/linux/opensimpad/simpad-backlight-if.patch')
-rw-r--r-- | packages/linux/opensimpad/simpad-backlight-if.patch | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/packages/linux/opensimpad/simpad-backlight-if.patch b/packages/linux/opensimpad/simpad-backlight-if.patch deleted file mode 100644 index 4e04afb5e9..0000000000 --- a/packages/linux/opensimpad/simpad-backlight-if.patch +++ /dev/null @@ -1,102 +0,0 @@ - -# -# Patch managed by http://www.holgerschurig.de/patcher.html -# - ---- linux-2.4.27/drivers/video/mq200fb.c~simpad-backlight-if -+++ linux-2.4.27/drivers/video/mq200fb.c -@@ -82,6 +82,20 @@ - write: proc_write_reg - }; - -+#ifdef CONFIG_SA1100_SIMPAD -+ -+static ssize_t proc_read_light(struct file * file, char * buf, -+ size_t nbytes, loff_t *ppos); -+static ssize_t proc_write_light(struct file * file, const char * buffer, -+ size_t count, loff_t *ppos); -+ -+static struct file_operations proc_light_operations = { -+ read: proc_read_light, -+ write: proc_write_light -+}; -+#endif -+ -+ - typedef struct sa1110_reg_entry { - u32 phyaddr; - char* name; -@@ -622,6 +636,20 @@ - } - } - -+#ifdef CONFIG_SA1100_SIMPAD -+ entry = create_proc_entry("backlight", -+ S_IRWXU | S_IRWXG | S_IRWXO, -+ mq200dir); -+ if(entry) { -+ entry->proc_fops = &proc_light_operations; -+ } -+ else { -+ printk( KERN_ERR -+ "mq200fb: can't create /proc/" MQ200_DIRNAME -+ "/backlight\n"); -+ return(-ENOMEM); -+ } -+ #endif - - #ifdef MQ_SA1110 - -@@ -1879,7 +1907,7 @@ - static void writeBrightness(void *pMQMMIO, int brightness) - { - unsigned long dutyCycle, pwmcontrol; -- int MAX_BRIGHT_REG = 0x000000fc; /* int 254 */ -+ int MAX_BRIGHT_REG = 0x000000fe; /* int 254 */ - - if(brightness > MAX_BRIGHT_REG) - return; -@@ -1961,3 +1989,43 @@ - return (count+endp-buffer); - } - -+#ifdef CONFIG_SA1100_SIMPAD -+ -+#define SIMPAD_BACKLIGHT_MASK 0x00a10044 -+ -+static int proc_read_light(struct file * file, char * buf, -+ size_t nbytes, loff_t *ppos) -+{ -+ char outputbuf[15]; -+ int count; -+ u32 pwmctl; -+ if (*ppos>0) /* Assume reading completed in previous read*/ -+ return 0; -+ -+ pwmctl = *((volatile *) mq200_p2v(0x4be0e03c)); -+ pwmctl &= ~SIMPAD_BACKLIGHT_MASK; -+ pwmctl = pwmctl >> 8; -+ pwmctl = 254 - pwmctl; -+ -+ count = sprintf(outputbuf, "%d\n",pwmctl); -+ *ppos+=count; -+ if (count>nbytes) /* Assume output can be read at one time */ -+ return -EINVAL; -+ if (copy_to_user(buf, outputbuf, count)) -+ return -EFAULT; -+ return count; -+} -+ -+static ssize_t proc_write_light(struct file * file, const char * buffer, -+ size_t count, loff_t *ppos) -+{ -+ void * pMQMMIO = (void *) mqMmioAddr; -+ char *endp; -+ unsigned long newvalue = simple_strtoul(buffer,&endp,0); -+ if (newvalue > 254) -+ newvalue = 254; -+ writeBrightness(pMQMMIO,newvalue); -+ mq200_backlight(pMQMMIO,(int)newvalue); -+ return (count+endp-buffer); -+} -+#endif |