add initial support for the crisarchitecture used on foxboards to openwrt
[openwrt/svn-archive/archive.git] / target / linux / etrax-2.6 / patches / cris / 009-sysfs.patch
1 --- linux-2.6.19.2.orig/drivers/serial/crisv10.c 2007-05-26 18:12:33.000000000 +0200
2 +++ linux-2.6.19.2/drivers/serial/crisv10.c 2007-05-26 19:24:56.000000000 +0200
3 @@ -442,6 +442,7 @@
4 #include <asm/uaccess.h>
5 #include <linux/kernel.h>
6 #include <linux/mutex.h>
7 +#include <linux/miscdevice.h>
8
9 #include <asm/io.h>
10 #include <asm/irq.h>
11 @@ -4822,6 +4823,12 @@
12 .tiocmset = rs_tiocmset
13 };
14
15 +#define CONFIG_ETRAX_SYSFS_NODES
16 +#ifdef CONFIG_ETRAX_SYSFS_NODES
17 +static struct class *mem_class;
18 +#endif
19 +
20 +static struct class *rs_class;
21 static int __init
22 rs_init(void)
23 {
24 @@ -4948,6 +4955,30 @@
25 #endif
26 #endif /* CONFIG_SVINTO_SIM */
27
28 +#ifdef CONFIG_ETRAX_SYSFS_NODES
29 +
30 + rs_class = class_create(THIS_MODULE, "rs_tty");
31 +#ifdef CONFIG_ETRAX_SERIAL_PORT0
32 + class_device_create(rs_class, NULL,
33 + MKDEV(TTY_MAJOR, 64),
34 + NULL, "ttyS0");
35 +#endif
36 +#ifdef CONFIG_ETRAX_SERIAL_PORT1
37 + class_device_create(rs_class, NULL,
38 + MKDEV(TTY_MAJOR, 65),
39 + NULL, "ttyS1");
40 +#endif
41 +#ifdef CONFIG_ETRAX_SERIAL_PORT2
42 + class_device_create(rs_class, NULL,
43 + MKDEV(TTY_MAJOR, 66),
44 + NULL, "ttyS2");
45 +#endif
46 +#ifdef CONFIG_ETRAX_SERIAL_PORT3
47 + class_device_create(rs_class, NULL,
48 + MKDEV(TTY_MAJOR, 67),
49 + NULL, "ttyS3");
50 +#endif
51 +#endif
52 return 0;
53 }
54
55 --- linux-2.6.19.2.orig/arch/cris/arch-v10/drivers/Kconfig 2007-05-26 18:12:22.000000000 +0200
56 +++ linux-2.6.19.2/arch/cris/arch-v10/drivers/Kconfig 2007-05-26 19:26:06.000000000 +0200
57 @@ -900,3 +900,9 @@
58 1 = 2kohm, 2 = 4kohm, 3 = 4kohm
59 4 = 1 diode, 8 = 2 diodes
60 Allowed values are (increasing current): 0, 11, 10, 9, 7, 6, 5
61 +
62 +config ETRAX_SYSFS_NODES
63 + bool "Create device nodes using sysfs for builtin devices"
64 + default n
65 + help
66 + Creates device nodes inside the rootfs dynamically for all the builtin devices
67 --- linux-2.6.19.2.orig/drivers/serial/crisv10.c 2007-05-28 20:37:56.000000000 +0200
68 +++ linux-2.6.19.2/drivers/serial/crisv10.c 2007-05-28 20:39:07.000000000 +0200
69 @@ -4823,12 +4823,11 @@
70 .tiocmset = rs_tiocmset
71 };
72
73 -#define CONFIG_ETRAX_SYSFS_NODES
74 #ifdef CONFIG_ETRAX_SYSFS_NODES
75 -static struct class *mem_class;
76 +static struct class *rs_class;
77 #endif
78
79 -static struct class *rs_class;
80 +
81 static int __init
82 rs_init(void)
83 {