]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[Blackfin] arch: enable generic GPIO based I2C driver in STAMP-BF533, EZKIT-BF533...
authorBryan Wu <bryan.wu@analog.com>
Thu, 24 Jan 2008 08:19:15 +0000 (16:19 +0800)
committerBryan Wu <bryan.wu@analog.com>
Thu, 24 Jan 2008 08:19:15 +0000 (16:19 +0800)
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
arch/blackfin/mach-bf533/boards/ezkit.c
arch/blackfin/mach-bf533/boards/stamp.c
arch/blackfin/mach-bf561/boards/ezkit.c

index ead5c12cbe90316761b10242f6ef03e24247c496..c37dd45c8803fad0817b0eef3e47433e57264a3b 100644 (file)
@@ -280,6 +280,26 @@ static struct platform_device bfin_device_gpiokeys = {
 };
 #endif
 
+#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
+#include <linux/i2c-gpio.h>
+
+static struct i2c_gpio_platform_data i2c_gpio_data = {
+       .sda_pin                = 1,
+       .scl_pin                = 0,
+       .sda_is_open_drain      = 0,
+       .scl_is_open_drain      = 0,
+       .udelay                 = 40,
+};
+
+static struct platform_device i2c_gpio_device = {
+       .name           = "i2c-gpio",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &i2c_gpio_data,
+       },
+};
+#endif
+
 static struct platform_device *ezkit_devices[] __initdata = {
 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
        &smc91x_device,
@@ -308,6 +328,10 @@ static struct platform_device *ezkit_devices[] __initdata = {
 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
        &bfin_device_gpiokeys,
 #endif
+
+#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
+       &i2c_gpio_device,
+#endif
 };
 
 static int __init ezkit_init(void)
index 6898169377036129b54b28d6b08a140dc430deef..cd87df730ef5d333af8296366e4fc72b5cf026bc 100644 (file)
@@ -396,6 +396,26 @@ static struct platform_device bfin_device_gpiokeys = {
 };
 #endif
 
+#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
+#include <linux/i2c-gpio.h>
+
+static struct i2c_gpio_platform_data i2c_gpio_data = {
+       .sda_pin                = 2,
+       .scl_pin                = 3,
+       .sda_is_open_drain      = 0,
+       .scl_is_open_drain      = 0,
+       .udelay                 = 40,
+};
+
+static struct platform_device i2c_gpio_device = {
+       .name           = "i2c-gpio",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &i2c_gpio_data,
+       },
+};
+#endif
+
 static struct platform_device *stamp_devices[] __initdata = {
 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
        &rtc_device,
@@ -433,6 +453,10 @@ static struct platform_device *stamp_devices[] __initdata = {
 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
        &bfin_device_gpiokeys,
 #endif
+
+#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
+       &i2c_gpio_device,
+#endif
 };
 
 static int __init stamp_init(void)
index edfceb08a7d5472b914217be177c19709a7bff34..36114dd4ab3a2ea3862fa65d2d810ce20f366e47 100644 (file)
@@ -270,6 +270,26 @@ static struct platform_device bfin_device_gpiokeys = {
 };
 #endif
 
+#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
+#include <linux/i2c-gpio.h>
+
+static struct i2c_gpio_platform_data i2c_gpio_data = {
+       .sda_pin                = 1,
+       .scl_pin                = 0,
+       .sda_is_open_drain      = 0,
+       .scl_is_open_drain      = 0,
+       .udelay                 = 40,
+};
+
+static struct platform_device i2c_gpio_device = {
+       .name           = "i2c-gpio",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &i2c_gpio_data,
+       },
+};
+#endif
+
 static struct platform_device *ezkit_devices[] __initdata = {
 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
        &smc91x_device,
@@ -294,6 +314,10 @@ static struct platform_device *ezkit_devices[] __initdata = {
 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
        &bfin_device_gpiokeys,
 #endif
+
+#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
+       &i2c_gpio_device,
+#endif
 };
 
 static int __init ezkit_init(void)