From: Claudio Mignanti Date: Thu, 1 Oct 2009 15:44:28 +0000 (+0000) Subject: Implement sysfs interface for some specific cris driver X-Git-Tag: reboot~22329 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ef368dfc0573e03b9e58c806c1668d6762f4f799;p=oweals%2Fopenwrt.git Implement sysfs interface for some specific cris driver SVN-Revision: 17805 --- 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 + #include + #include ++#include + + #include + #include +@@ -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 + #include + #include ++#include + + #include + #include +@@ -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 + #include + #include ++#include + + #include + +@@ -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; + } +