summaryrefslogtreecommitdiff
path: root/target/linux/etrax/patches/cris/013-crisdriver-sysfs.patch
blob: 7f594c41941390135f330daf26c9d418ba24db3e (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/drivers/ds1302.c linux-2.6.19.2/arch/cris/arch-v10/drivers/ds1302.c
--- linux-2.6.19.2.orig/arch/cris/arch-v10/drivers/ds1302.c	2007-05-28 22:35:23.000000000 +0200
+++ linux-2.6.19.2/arch/cris/arch-v10/drivers/ds1302.c	2007-05-28 22:55:40.000000000 +0200
@@ -21,7 +21,7 @@
 #include <linux/delay.h>
 #include <linux/bcd.h>
 #include <linux/capability.h>
-
+#include <linux/device.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/arch/svinto.h>
@@ -480,6 +480,10 @@
 	return 0;
 }
 
+#ifdef CONFIG_SYSFS
+static struct class *rtc_class;
+#endif
+
 static int __init ds1302_register(void)
 {
 	ds1302_init();
@@ -488,7 +492,15 @@
 		       ds1302_name, RTC_MAJOR_NR);
 		return -1;
 	}
-        return 0;
+	
+	#ifdef CONFIG_SYSFS
+	rtc_class = class_create(THIS_MODULE, "rtc");
+	class_device_create(rtc_class, NULL,
+		MKDEV(RTC_MAJOR_NR, 0),
+		NULL, "rtc");
+	#endif
+	
+	return 0;
 
 }
 
diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/drivers/eeprom.c linux-2.6.19.2/arch/cris/arch-v10/drivers/eeprom.c
--- linux-2.6.19.2.orig/arch/cris/arch-v10/drivers/eeprom.c	2007-05-28 22:35:23.000000000 +0200
+++ linux-2.6.19.2/arch/cris/arch-v10/drivers/eeprom.c	2007-05-28 23:03:45.000000000 +0200
@@ -103,6 +103,7 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/wait.h>
+#include <linux/device.h>
 #include <asm/uaccess.h>
 #include "i2c.h"
 
@@ -185,6 +186,9 @@
 };
 
 /* eeprom init call. Probes for different eeprom models. */
+#ifdef CONFIG_SYSFS
+static struct class *eep_class;
+#endif
 
 int __init eeprom_init(void)
 {
@@ -202,7 +206,13 @@
            eeprom_name, EEPROM_MAJOR_NR);
     return -1;
   }
-  
+
+#ifdef CONFIG_SYSFS
+	eep_class = class_create(THIS_MODULE, "eep");
+	class_device_create(eep_class, NULL, MKDEV(EEPROM_MAJOR, 0), NULL, "eeprom");
+#endif
+
+ 
   printk("EEPROM char device v0.3, (c) 2000 Axis Communications AB\n");
 
   /*
diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/drivers/gpio.c linux-2.6.19.2/arch/cris/arch-v10/drivers/gpio.c
--- linux-2.6.19.2.orig/arch/cris/arch-v10/drivers/gpio.c	2007-05-28 22:35:23.000000000 +0200
+++ linux-2.6.19.2/arch/cris/arch-v10/drivers/gpio.c	2007-05-28 22:59:27.000000000 +0200
@@ -181,6 +181,7 @@
 #include <linux/poll.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/device.h>
 
 #include <asm/etraxgpio.h>
 #include <asm/arch/svinto.h>
@@ -938,6 +939,10 @@
 
 /* main driver initialization routine, called from mem.c */
 
+#ifdef CONFIG_SYSFS
+static struct class *gpio_class;
+#endif
+
 static __init int
 gpio_init(void)
 {
@@ -955,6 +960,14 @@
 		return res;
 	}
 
+#ifdef CONFIG_SYSFS
+	gpio_class = class_create(THIS_MODULE, "gpio");
+	class_device_create(gpio_class, NULL, MKDEV(GPIO_MAJOR, 0), NULL, "gpioa");
+	class_device_create(gpio_class, NULL, MKDEV(GPIO_MAJOR, 1), NULL, "gpiob");
+	class_device_create(gpio_class, NULL, MKDEV(GPIO_MAJOR, 2), NULL, "leds");
+	class_device_create(gpio_class, NULL, MKDEV(GPIO_MAJOR, 3), NULL, "gpiog");
+#endif
+
 	/* Clear all leds */
 #if defined (CONFIG_ETRAX_CSP0_LEDS) ||  defined (CONFIG_ETRAX_PA_LEDS) || defined (CONFIG_ETRAX_PB_LEDS)
 	LED_NETWORK_SET(0);
diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/drivers/pcf8563.c linux-2.6.19.2/arch/cris/arch-v10/drivers/pcf8563.c
--- linux-2.6.19.2.orig/arch/cris/arch-v10/drivers/pcf8563.c	2007-05-28 22:35:23.000000000 +0200
+++ linux-2.6.19.2/arch/cris/arch-v10/drivers/pcf8563.c	2007-05-28 23:09:02.000000000 +0200
@@ -26,6 +26,7 @@
 #include <linux/ioctl.h>
 #include <linux/delay.h>
 #include <linux/bcd.h>
+#include <linux/device.h>
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
@@ -344,6 +345,10 @@
 	return 0;
 }
 
+#ifdef CONFIG_SYSFS
+static struct class *pcf8563_class;
+#endif
+
 static int __init 
 pcf8563_register(void)
 {
@@ -358,6 +363,10 @@
 		       "device.\n", PCF8563_NAME, PCF8563_MAJOR);
 		return -1;
 	}
+#ifdef CONFIG_SYSFS
+	pcf8563_class = class_create(THIS_MODULE, "pcf8563");
+	class_device_create(pcf8563_class, NULL, MKDEV(PCF8563_MAJOR, 0), NULL, "rtc");
+#endif
 
 	printk(KERN_INFO "%s Real-Time Clock Driver, %s\n", PCF8563_NAME,
 	       DRIVER_VERSION);
diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/drivers/sync_serial.c linux-2.6.19.2/arch/cris/arch-v10/drivers/sync_serial.c
--- linux-2.6.19.2.orig/arch/cris/arch-v10/drivers/sync_serial.c	2007-05-28 22:35:23.000000000 +0200
+++ linux-2.6.19.2/arch/cris/arch-v10/drivers/sync_serial.c	2007-05-28 23:06:41.000000000 +0200
@@ -29,6 +29,8 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/sync_serial.h>
+#include <linux/device.h>
+
 #include <asm/arch/io_interface_mux.h>
 
 /* The receiver is a bit tricky beacuse of the continuous stream of data.*/
@@ -241,6 +243,9 @@
 	.open    = sync_serial_open,
 	.release = sync_serial_release
 };
+#ifdef CONFIG_SYSFS
+static struct class *syncser_class;
+#endif
 
 static int __init etrax_sync_serial_init(void)
 {
@@ -274,6 +279,11 @@
 		printk("unable to get major for synchronous serial port\n");
 		return -EBUSY;
 	}
+#ifdef CONFIG_SYSFS
+	syncser_class = class_create(THIS_MODULE, "syncser");
+	class_device_create(syncser_class, NULL, MKDEV(SYNC_SERIAL_MAJOR, 0), NULL, "syncser0");
+	class_device_create(syncser_class, NULL, MKDEV(SYNC_SERIAL_MAJOR, 1), NULL, "syncser1");
+#endif
 
 	/* Deselect synchronous serial ports while configuring. */
 	SETS(gen_config_ii_shadow, R_GEN_CONFIG_II, sermode1, async);