X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/84eaaac61b9b7a2402b222580db86324ba26f024..636f4cc8ac224f27632009f6314287961d1ccc31:/target/linux/au1000-2.6/patches/010-au100_gpio_i2c.patch?ds=inline diff --git a/target/linux/au1000-2.6/patches/010-au100_gpio_i2c.patch b/target/linux/au1000-2.6/patches/010-au100_gpio_i2c.patch index aeb021a04..9fd2e8936 100644 --- a/target/linux/au1000-2.6/patches/010-au100_gpio_i2c.patch +++ b/target/linux/au1000-2.6/patches/010-au100_gpio_i2c.patch @@ -1,13 +1,14 @@ diff -urN linux-2.6.19/drivers/i2c/busses/Kconfig linux-2.6.19.new/drivers/i2c/busses/Kconfig --- linux-2.6.19/drivers/i2c/busses/Kconfig 2006-11-29 22:57:37.000000000 +0100 +++ linux-2.6.19.new/drivers/i2c/busses/Kconfig 2006-12-28 17:04:34.000000000 +0100 -@@ -84,6 +84,16 @@ +@@ -84,6 +84,17 @@ This driver can also be built as a module. If so, the module will be called i2c-au1550. +config I2C_AU1X00GPIO + tristate "Au1x00 i2c using GPIO pins" -+ depends on I2C && MTX1 ++ depends on I2C ++ select I2C_ALGOBIT + help + If you say yest to this option, support will be included for the + Au1x00 GPIO interface. @@ -32,7 +33,7 @@ diff -urN linux-2.6.19/drivers/i2c/busses/Makefile linux-2.6.19.new/drivers/i2c/ diff -urN linux-2.6.19/drivers/i2c/busses/i2c-au1x00gpio.c linux-2.6.19.new/drivers/i2c/busses/i2c-au1x00gpio.c --- linux-2.6.19/drivers/i2c/busses/i2c-au1x00gpio.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.19.new/drivers/i2c/busses/i2c-au1x00gpio.c 2006-12-28 17:02:10.000000000 +0100 -@@ -0,0 +1,421 @@ +@@ -0,0 +1,406 @@ +/* ------------------------------------------------------------------------- */ +/* i2c-au1x00gpio.c i2c-hw access for Au1x00 GPIO pins. */ +/* ------------------------------------------------------------------------- */ @@ -77,11 +78,6 @@ diff -urN linux-2.6.19/drivers/i2c/busses/i2c-au1x00gpio.c linux-2.6.19.new/driv +#include +#include + -+#ifndef __exit -+#define __exit __init -+#endif -+ -+ +struct i2c_au1x00gpio +{ + struct i2c_au1x00gpio *next; @@ -397,11 +393,11 @@ diff -urN linux-2.6.19/drivers/i2c/busses/i2c-au1x00gpio.c linux-2.6.19.new/driv + + +#ifndef CONFIG_I2C_AU1X00GPIO_SCL -+#define CONFIG_I2C_AU1X00GPIO_SCL (216) ++#define CONFIG_I2C_AU1X00GPIO_SCL (210) +#endif + +#ifndef CONFIG_I2C_AU1X00GPIO_SDA -+#define CONFIG_I2C_AU1X00GPIO_SDA (217) ++#define CONFIG_I2C_AU1X00GPIO_SDA (9) +#endif + +static int au1x00gpiopin_scl = CONFIG_I2C_AU1X00GPIO_SCL; @@ -409,7 +405,7 @@ diff -urN linux-2.6.19/drivers/i2c/busses/i2c-au1x00gpio.c linux-2.6.19.new/driv + + + -+int __init i2c_bit_au1x00gpio_init(void) ++static int __init i2c_bit_au1x00gpio_init(void) +{ + printk(KERN_INFO "i2c-au1x00gpio.o: i2c Au1x00 GPIO adapter module version\n"); + @@ -427,7 +423,7 @@ diff -urN linux-2.6.19/drivers/i2c/busses/i2c-au1x00gpio.c linux-2.6.19.new/driv +} + + -+void __exit i2c_bit_au1x00gpio_exit(void) ++static void __exit i2c_bit_au1x00gpio_exit(void) +{ + i2c_au1x00gpio_delete (au1x00gpiopin_scl, au1x00gpiopin_sda); +} @@ -442,15 +438,18 @@ diff -urN linux-2.6.19/drivers/i2c/busses/i2c-au1x00gpio.c linux-2.6.19.new/driv +MODULE_DESCRIPTION("I2C-Bus adapter routines for Au1x00 GPIO adapter."); +MODULE_LICENSE("GPL"); + ++module_init(i2c_bit_au1x00gpio_init); ++module_exit(i2c_bit_au1x00gpio_exit); +diff -urN linux-2.6.19/include/linux/i2c-id.h linux-2.6.19.new/include/linux/i2c-id.h +--- linux-2.6.19/include/linux/i2c-id.h 2006-11-29 22:57:37.000000000 +0100 ++++ linux-2.6.19.new/include/linux/i2c-id.h 2006-12-28 03:12:15.000000000 +0100 +@@ -231,6 +231,9 @@ + /* --- Au1550 PSC adapters adapters */ + #define I2C_HW_AU1550_PSC 0x1b0000 + ++/* --- Au1x00 i2c GPIO adapter */ ++#define I2C_HW_B_AU1x00GPIO 0x1b + -+#ifdef MODULE -+int init_module(void) -+{ -+ return i2c_bit_au1x00gpio_init(); -+} -+ -+void cleanup_module(void) -+{ -+ i2c_bit_au1x00gpio_exit(); -+} -+#endif + /* --- SMBus only adapters */ + #define I2C_HW_SMBUS_PIIX4 0x040000 + #define I2C_HW_SMBUS_ALI15X3 0x040001