summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-12-30 02:37:25 +0000
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-12-30 02:37:25 +0000
commit2bf7c625c7cedfaa8aac9e3a38806cde421e97c9 (patch)
tree613f89d32118aa17fd8a172ea60c0266d8d6c9f4 /target
parentc3e120ac97ec61037dde9e776c501ac85bdeb8a9 (diff)
Make the i2c driver work, as a module
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5930 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/au1000-2.6/config4
-rw-r--r--target/linux/au1000-2.6/patches/010-au100_gpio_i2c.patch29
2 files changed, 9 insertions, 24 deletions
diff --git a/target/linux/au1000-2.6/config b/target/linux/au1000-2.6/config
index db9841e41..4b675388d 100644
--- a/target/linux/au1000-2.6/config
+++ b/target/linux/au1000-2.6/config
@@ -1142,7 +1142,7 @@ CONFIG_HW_RANDOM=y
#
# I2C support
#
-CONFIG_I2C=y
+CONFIG_I2C=m
CONFIG_I2C_CHARDEV=m
#
@@ -1160,7 +1160,7 @@ CONFIG_I2C_ALGOPCA=m
# CONFIG_I2C_ALI15X3 is not set
# CONFIG_I2C_AMD756 is not set
# CONFIG_I2C_AMD8111 is not set
-CONFIG_I2C_AU1X00GPIO=y
+CONFIG_I2C_AU1X00GPIO=m
# CONFIG_I2C_I801 is not set
# CONFIG_I2C_I810 is not set
# CONFIG_I2C_PIIX4 is not set
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 f4dee3cf6..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
@@ -33,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. */
+/* ------------------------------------------------------------------------- */
@@ -78,11 +78,6 @@ diff -urN linux-2.6.19/drivers/i2c/busses/i2c-au1x00gpio.c linux-2.6.19.new/driv
+#include <linux/i2c.h>
+#include <linux/i2c-algo-bit.h>
+
-+#ifndef __exit
-+#define __exit __init
-+#endif
-+
-+
+struct i2c_au1x00gpio
+{
+ struct i2c_au1x00gpio *next;
@@ -398,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;
@@ -410,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");
+
@@ -428,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);
+}
@@ -443,18 +438,8 @@ 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");
+
-+
-+#ifdef MODULE
-+int init_module(void)
-+{
-+ return i2c_bit_au1x00gpio_init();
-+}
-+
-+void cleanup_module(void)
-+{
-+ i2c_bit_au1x00gpio_exit();
-+}
-+#endif
++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