[etrax] Update and add patches
[openwrt-10.03/.git] / target / linux / etrax / patches / 013-crisdriver-sysfs.patch
1 Index: linux-2.6.25.16/arch/cris/arch-v10/drivers/ds1302.c
2 ===================================================================
3 --- linux-2.6.25.16.o/arch/cris/arch-v10/drivers/ds1302.c       2008-10-26 15:54:02.000000000 +0100
4 +++ linux-2.6.25.16/arch/cris/arch-v10/drivers/ds1302.c 2008-10-26 15:59:37.000000000 +0100
5 @@ -21,6 +21,7 @@
6  #include <linux/delay.h>
7  #include <linux/bcd.h>
8  #include <linux/capability.h>
9 +#include <linux/device.h>
10  
11  #include <asm/uaccess.h>
12  #include <asm/system.h>
13 @@ -489,6 +490,10 @@
14         return 0;
15  }
16  
17 +#ifdef CONFIG_SYSFS
18 +static struct class *rtc_class;
19 +#endif
20 +
21  static int __init ds1302_register(void)
22  {
23         ds1302_init();
24 @@ -497,6 +502,12 @@
25                        ds1302_name, RTC_MAJOR_NR);
26                 return -1;
27         }
28 +       #ifdef CONFIG_SYSFS
29 +       rtc_class = class_create(THIS_MODULE, "rtc");
30 +       class_device_create(rtc_class, NULL, MKDEV(RTC_MAJOR_NR, 0),
31 +               NULL, "rtc");
32 +       #endif
33 +
34          return 0;
35  
36  }
37 Index: linux-2.6.25.16/arch/cris/arch-v10/drivers/gpio.c
38 ===================================================================
39 --- linux-2.6.25.16.o/arch/cris/arch-v10/drivers/gpio.c 2008-10-26 15:56:28.000000000 +0100
40 +++ linux-2.6.25.16/arch/cris/arch-v10/drivers/gpio.c   2008-10-26 15:57:41.000000000 +0100
41 @@ -20,6 +20,7 @@
42  #include <linux/poll.h>
43  #include <linux/init.h>
44  #include <linux/interrupt.h>
45 +#include <linux/device.h>
46  
47  #include <asm/etraxgpio.h>
48  #include <asm/arch/svinto.h>
49 @@ -768,6 +769,10 @@
50  
51  /* main driver initialization routine, called from mem.c */
52  
53 +#ifdef CONFIG_SYSFS
54 +static struct class *gpio_class;
55 +#endif
56 +
57  static int __init gpio_init(void)
58  {
59         int res;
60 @@ -781,6 +786,13 @@
61                 return res;
62         }
63  
64 +#ifdef CONFIG_SYSFS
65 +       gpio_class = class_create(THIS_MODULE, "gpio");
66 +       class_device_create(gpio_class, NULL, MKDEV(GPIO_MAJOR, 0), NULL, "gpioa");
67 +       class_device_create(gpio_class, NULL, MKDEV(GPIO_MAJOR, 1), NULL, "gpiob");
68 +       class_device_create(gpio_class, NULL, MKDEV(GPIO_MAJOR, 2), NULL, "leds");
69 +       class_device_create(gpio_class, NULL, MKDEV(GPIO_MAJOR, 3), NULL, "gpiog");
70 +#endif
71         /* Clear all leds */
72  #if defined (CONFIG_ETRAX_CSP0_LEDS) ||  defined (CONFIG_ETRAX_PA_LEDS) || defined (CONFIG_ETRAX_PB_LEDS)
73         CRIS_LED_NETWORK_SET(0);
74