aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/etrax/patches/cris/009-sysfs.patch
blob: 4988a20fc3931c66592cd82444e290e285b75432 (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
--- linux-2.6.19.2.orig/drivers/serial/crisv10.c	2007-05-26 18:12:33.000000000 +0200
+++ linux-2.6.19.2/drivers/serial/crisv10.c	2007-05-26 19:24:56.000000000 +0200
@@ -442,6 +442,7 @@
 #include <asm/uaccess.h>
 #include <linux/kernel.h>
 #include <linux/mutex.h>
+#include <linux/miscdevice.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -4822,6 +4823,12 @@
 	.tiocmset = rs_tiocmset
 };
 
+#define CONFIG_ETRAX_SYSFS_NODES
+#ifdef CONFIG_ETRAX_SYSFS_NODES
+static struct class *mem_class;
+#endif
+
+static struct class *rs_class;
 static int __init
 rs_init(void)
 {
@@ -4948,6 +4955,30 @@
 #endif
 #endif /* CONFIG_SVINTO_SIM */
 
+#ifdef CONFIG_ETRAX_SYSFS_NODES
+
+	rs_class = class_create(THIS_MODULE, "rs_tty");
+#ifdef CONFIG_ETRAX_SERIAL_PORT0
+	class_device_create(rs_class, NULL,
+		MKDEV(TTY_MAJOR, 64),
+		NULL, "ttyS0");
+#endif
+#ifdef CONFIG_ETRAX_SERIAL_PORT1
+	class_device_create(rs_class, NULL,
+		MKDEV(TTY_MAJOR, 65),
+		NULL, "ttyS1");
+#endif
+#ifdef CONFIG_ETRAX_SERIAL_PORT2
+	class_device_create(rs_class, NULL,
+		MKDEV(TTY_MAJOR, 66),
+		NULL, "ttyS2");
+#endif
+#ifdef CONFIG_ETRAX_SERIAL_PORT3
+	class_device_create(rs_class, NULL,
+		MKDEV(TTY_MAJOR, 67),
+		NULL, "ttyS3");
+#endif
+#endif
 	return 0;
 }
 
--- linux-2.6.19.2.orig/arch/cris/arch-v10/drivers/Kconfig	2007-05-26 18:12:22.000000000 +0200
+++ linux-2.6.19.2/arch/cris/arch-v10/drivers/Kconfig	2007-05-26 19:26:06.000000000 +0200
@@ -900,3 +900,9 @@
 	  1 = 2kohm, 2 = 4kohm, 3 = 4kohm
 	  4 = 1 diode, 8 = 2 diodes
 	  Allowed values are (increasing current): 0, 11, 10, 9, 7, 6, 5
+	 
+config ETRAX_SYSFS_NODES
+	bool "Create device nodes using sysfs for builtin devices"
+	default n
+	help
+	  Creates device nodes inside the rootfs dynamically for all the builtin devices
--- linux-2.6.19.2.orig/drivers/serial/crisv10.c	2007-05-28 20:37:56.000000000 +0200
+++ linux-2.6.19.2/drivers/serial/crisv10.c	2007-05-28 20:39:07.000000000 +0200
@@ -4823,12 +4823,11 @@
 	.tiocmset = rs_tiocmset
 };
 
-#define CONFIG_ETRAX_SYSFS_NODES
 #ifdef CONFIG_ETRAX_SYSFS_NODES
-static struct class *mem_class;
+static struct class *rs_class;
 #endif
 
-static struct class *rs_class;
+
 static int __init
 rs_init(void)
 {