Title: [4065] trunk/arch/blackfin: TASK [#3478] enable generic GPIO based I2C driver in EZKIT-BF561
Revision
4065
Author
cooloney
Date
2007-12-26 01:10:10 -0600 (Wed, 26 Dec 2007)

Log Message

TASK [#3478] enable generic GPIO based I2C driver in EZKIT-BF561

Diffstat

 Kconfig                   |   25 +++++++++++++++++++++++++
 mach-bf561/boards/ezkit.c |   24 ++++++++++++++++++++++++
 2 files changed, 49 insertions(+)

Modified Paths

Diff

Modified: trunk/arch/blackfin/Kconfig (4064 => 4065)


--- trunk/arch/blackfin/Kconfig	2007-12-26 06:59:56 UTC (rev 4064)
+++ trunk/arch/blackfin/Kconfig	2007-12-26 07:10:10 UTC (rev 4065)
@@ -525,8 +525,33 @@
 
 endchoice
 
+menu "Blackfin I2C GPIO SDA/SCL Selection"
+	depends on I2C_GPIO
+
+config I2C_GPIO_SDA
+	int "SDA GPIO pin number"
+	range 0 15 if (BF533 || BF532 || BF531)
+	range 0 47 if (BF534 || BF536 || BF537)
+	range 0 47 if BF561
+	default 2 if !BF561
+	default 1 if BF561
+
+config I2C_GPIO_SCL
+	int "SCL GPIO pin number"
+	range 0 15 if (BF533 || BF532 || BF531)
+	range 0 47 if (BF534 || BF536 || BF537)
+	range 0 47 if BF561
+	default 3 if !BF561
+	default 0 if BF561
+
+config I2C_GPIO_UDELAY
+	int "Cycle Delay in uSec"
+	range 5 100
+	default 40
+
 endmenu
 
+endmenu
 
 menu "Blackfin Kernel Optimizations"
 

Modified: trunk/arch/blackfin/mach-bf561/boards/ezkit.c (4064 => 4065)


--- trunk/arch/blackfin/mach-bf561/boards/ezkit.c	2007-12-26 06:59:56 UTC (rev 4064)
+++ trunk/arch/blackfin/mach-bf561/boards/ezkit.c	2007-12-26 07:10:10 UTC (rev 4065)
@@ -270,6 +270,26 @@
 };
 #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		= CONFIG_I2C_GPIO_SDA,
+	.scl_pin		= CONFIG_I2C_GPIO_SCL,
+	.sda_is_open_drain	= 1,
+	.scl_is_open_drain	= 1,
+	.udelay			= CONFIG_I2C_GPIO_UDELAY,
+};
+
+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 @@
 #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)
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to