aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/etrax/patches-2.6.32/610-create-the-gpio-devices.patch
blob: 27e13c2baf67b56eec16fd2fa7ed028c5bf99b6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
--- a/arch/cris/arch-v10/drivers/gpio.c
+++ b/arch/cris/arch-v10/drivers/gpio.c
@@ -21,6 +21,7 @@
 #include <linux/poll.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/device.h>
 
 #include <asm/etraxgpio.h>
 #include <arch/svinto.h>
@@ -771,6 +772,8 @@ static void ioif_watcher(const unsigned 
 
 /* main driver initialization routine, called from mem.c */
 
+static struct class *gp_class;
+
 static int __init gpio_init(void)
 {
 	int res;
@@ -784,6 +787,8 @@ static int __init gpio_init(void)
 		return res;
 	}
 
+	gp_class = class_create(THIS_MODULE, "gpio_etrax");
+
 	/* Clear all leds */
 #if defined (CONFIG_ETRAX_CSP0_LEDS) ||  defined (CONFIG_ETRAX_PA_LEDS) || defined (CONFIG_ETRAX_PB_LEDS)
 	CRIS_LED_NETWORK_SET(0);
@@ -796,6 +801,8 @@ static int __init gpio_init(void)
 		CRIS_LED_BIT_SET(i);
 #endif
 
+	device_create(gp_class, NULL,
+		MKDEV(GPIO_MAJOR, 2), NULL, "leds");
 #endif
 	/* The I/O interface allocation watcher will be called when
 	 * registering it. */
@@ -822,6 +829,12 @@ static int __init gpio_init(void)
 	if (res)
 		printk(KERN_CRIT "err: PA irq for gpio\n");
 
+	device_create(gp_class, NULL,
+		MKDEV(GPIO_MAJOR, 0), NULL, "gpioa");
+	device_create(gp_class, NULL,
+		MKDEV(GPIO_MAJOR, 1), NULL, "gpiob");
+	device_create(gp_class, NULL,
+		MKDEV(GPIO_MAJOR, 3), NULL, "gpiog");
 	return res;
 }
 
vaddr & ~PAGE_MASK); memcpy(vto, src, len); @@ -255,7 +255,7 @@ void copy_from_user_page(struct vm_area_ struct page *page, unsigned long vaddr, void *dst, const void *src, unsigned long len) { - if (cpu_has_dc_aliases && + if (cpu_has_dc_aliases && cpu_use_kmap_coherent && page_mapped(page) && !Page_dcache_dirty(page)) { void *vfrom = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); memcpy(dst, vfrom, len); Index: linux-2.6.25.1/include/asm-mips/mach-bcm47xx/cpu-feature-overrides.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6.25.1/include/asm-mips/mach-bcm47xx/cpu-feature-overrides.h 2008-05-18 11:32:40.000000000 +0100 @@ -0,0 +1,13 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) + */ +#ifndef __ASM_MACH_BCM47XX_CPU_FEATURE_OVERRIDES_H +#define __ASM_MACH_BCM47XX_CPU_FEATURE_OVERRIDES_H + +#define cpu_use_kmap_coherent 0 + +#endif /* __ASM_MACH_BCM47XX_CPU_FEATURE_OVERRIDES_H */ Index: linux-2.6.25.1/include/asm-mips/cpu-features.h =================================================================== --- linux-2.6.25.1.orig/include/asm-mips/cpu-features.h 2008-05-18 11:32:33.000000000 +0100 +++ linux-2.6.25.1/include/asm-mips/cpu-features.h 2008-05-18 11:32:40.000000000 +0100 @@ -101,6 +101,9 @@ #ifndef cpu_has_pindexed_dcache #define cpu_has_pindexed_dcache (cpu_data[0].dcache.flags & MIPS_CACHE_PINDEX) #endif +#ifndef cpu_use_kmap_coherent +#define cpu_use_kmap_coherent 1 +#endif /* * I-Cache snoops remote store. This only matters on SMP. Some multiprocessors Index: linux-2.6.25.1/arch/mips/mm/c-r4k.c =================================================================== --- linux-2.6.25.1.orig/arch/mips/mm/c-r4k.c 2008-05-18 21:06:36.000000000 +0100 +++ linux-2.6.25.1/arch/mips/mm/c-r4k.c 2008-05-18 21:09:28.000000000 +0100 @@ -484,7 +484,7 @@ static inline void local_r4k_flush_cache * Use kmap_coherent or kmap_atomic to do flushes for * another ASID than the current one. */ - if (cpu_has_dc_aliases) + if (cpu_has_dc_aliases && cpu_use_kmap_coherent) vaddr = kmap_coherent(page, addr); else vaddr = kmap_atomic(page, KM_USER0); @@ -505,7 +505,7 @@ static inline void local_r4k_flush_cache } if (vaddr) { - if (cpu_has_dc_aliases) + if (cpu_has_dc_aliases && cpu_use_kmap_coherent) kunmap_coherent(); else kunmap_atomic(vaddr, KM_USER0);