diff options
author | Claudio Mignanti <c.mignanti@gmail.com> | 2009-10-01 15:44:28 +0000 |
---|---|---|
committer | Claudio Mignanti <c.mignanti@gmail.com> | 2009-10-01 15:44:28 +0000 |
commit | ef368dfc0573e03b9e58c806c1668d6762f4f799 (patch) | |
tree | 52aefba1b99e11ba12fe48d9f362e25465b37bff /target/linux | |
parent | 054c54512f1120f037142964b0e51190d11b8904 (diff) | |
download | upstream-ef368dfc0573e03b9e58c806c1668d6762f4f799.tar.gz upstream-ef368dfc0573e03b9e58c806c1668d6762f4f799.tar.bz2 upstream-ef368dfc0573e03b9e58c806c1668d6762f4f799.zip |
Implement sysfs interface for some specific cris driver
SVN-Revision: 17805
Diffstat (limited to 'target/linux')
3 files changed, 126 insertions, 0 deletions
diff --git a/target/linux/etrax/patches-2.6.30/600-create-device-serial.patch b/target/linux/etrax/patches-2.6.30/600-create-device-serial.patch new file mode 100644 index 0000000000..516b98471f --- /dev/null +++ b/target/linux/etrax/patches-2.6.30/600-create-device-serial.patch @@ -0,0 +1,44 @@ +--- a/drivers/serial/crisv10.c ++++ b/drivers/serial/crisv10.c +@@ -31,6 +31,7 @@ static char *serial_version = "$Revision + #include <linux/module.h> + #include <linux/uaccess.h> + #include <linux/io.h> ++#include <linux/device.h> + + #include <asm/irq.h> + #include <asm/dma.h> +@@ -4414,6 +4415,8 @@ static const struct tty_operations rs_op + #endif + }; + ++static struct class *rs_class; ++ + static int __init rs_init(void) + { + int i; +@@ -4547,6 +4550,24 @@ static int __init rs_init(void) + #endif + #endif /* CONFIG_SVINTO_SIM */ + ++ rs_class = class_create(THIS_MODULE, "rs_tty"); ++#ifdef CONFIG_ETRAX_SERIAL_PORT0 ++ device_create(rs_class, NULL, ++ MKDEV(TTY_MAJOR, 64), NULL, "ttyS0"); ++#endif ++#ifdef CONFIG_ETRAX_SERIAL_PORT1 ++ device_create(rs_class, NULL, ++ MKDEV(TTY_MAJOR, 65), NULL, "ttyS1"); ++#endif ++#ifdef CONFIG_ETRAX_SERIAL_PORT2 ++ device_create(rs_class, NULL, ++ MKDEV(TTY_MAJOR, 66), NULL, "ttyS2"); ++#endif ++#ifdef CONFIG_ETRAX_SERIAL_PORT3 ++ device_create(rs_class, NULL, ++ MKDEV(TTY_MAJOR, 67), NULL, "ttyS3"); ++#endif ++ + return 0; + } + diff --git a/target/linux/etrax/patches-2.6.30/610-create-the-gpio-devices.patch b/target/linux/etrax/patches-2.6.30/610-create-the-gpio-devices.patch new file mode 100644 index 0000000000..27e13c2baf --- /dev/null +++ b/target/linux/etrax/patches-2.6.30/610-create-the-gpio-devices.patch @@ -0,0 +1,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; + } + diff --git a/target/linux/etrax/patches-2.6.30/620-create-the-i2c-devices.patch b/target/linux/etrax/patches-2.6.30/620-create-the-i2c-devices.patch new file mode 100644 index 0000000000..9c2e37ae98 --- /dev/null +++ b/target/linux/etrax/patches-2.6.30/620-create-the-i2c-devices.patch @@ -0,0 +1,32 @@ +--- a/arch/cris/arch-v10/drivers/i2c.c ++++ b/arch/cris/arch-v10/drivers/i2c.c +@@ -21,6 +21,7 @@ + #include <linux/fs.h> + #include <linux/string.h> + #include <linux/init.h> ++#include <linux/device.h> + + #include <asm/etraxi2c.h> + +@@ -678,6 +679,8 @@ i2c_init(void) + return res; + } + ++static struct class *i2c_class; ++ + static int __init + i2c_register(void) + { +@@ -693,7 +696,11 @@ i2c_register(void) + } + + printk(KERN_INFO "I2C driver v2.2, (c) 1999-2004 Axis Communications AB\n"); +- ++ ++ i2c_class = class_create(THIS_MODULE, "i2c_etrax"); ++ device_create(i2c_class, NULL, ++ MKDEV(I2C_MAJOR, 0), NULL, "i2c"); ++ + return 0; + } + |