diff options
author | Bryan Wu <bryan.wu@analog.com> | 2008-01-24 03:19:15 -0500 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2008-01-24 03:19:15 -0500 |
commit | e31639540d2b1474766e95c1a7b1b698468ba092 (patch) | |
tree | 7fceee4ec0cc4eef10024b5179ef40225ccb4b06 /arch/blackfin | |
parent | 6b5eace2f15b53d5a6849078d22e78db77625929 (diff) |
[Blackfin] arch: enable generic GPIO based I2C driver in STAMP-BF533, EZKIT-BF533 and EZKIT-BF561 boards
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/mach-bf533/boards/ezkit.c | 24 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/boards/stamp.c | 24 | ||||
-rw-r--r-- | arch/blackfin/mach-bf561/boards/ezkit.c | 24 |
3 files changed, 72 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf533/boards/ezkit.c b/arch/blackfin/mach-bf533/boards/ezkit.c index ead5c12cbe90..c37dd45c8803 100644 --- a/arch/blackfin/mach-bf533/boards/ezkit.c +++ b/arch/blackfin/mach-bf533/boards/ezkit.c | |||
@@ -280,6 +280,26 @@ static struct platform_device bfin_device_gpiokeys = { | |||
280 | }; | 280 | }; |
281 | #endif | 281 | #endif |
282 | 282 | ||
283 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
284 | #include <linux/i2c-gpio.h> | ||
285 | |||
286 | static struct i2c_gpio_platform_data i2c_gpio_data = { | ||
287 | .sda_pin = 1, | ||
288 | .scl_pin = 0, | ||
289 | .sda_is_open_drain = 0, | ||
290 | .scl_is_open_drain = 0, | ||
291 | .udelay = 40, | ||
292 | }; | ||
293 | |||
294 | static struct platform_device i2c_gpio_device = { | ||
295 | .name = "i2c-gpio", | ||
296 | .id = 0, | ||
297 | .dev = { | ||
298 | .platform_data = &i2c_gpio_data, | ||
299 | }, | ||
300 | }; | ||
301 | #endif | ||
302 | |||
283 | static struct platform_device *ezkit_devices[] __initdata = { | 303 | static struct platform_device *ezkit_devices[] __initdata = { |
284 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | 304 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
285 | &smc91x_device, | 305 | &smc91x_device, |
@@ -308,6 +328,10 @@ static struct platform_device *ezkit_devices[] __initdata = { | |||
308 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | 328 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
309 | &bfin_device_gpiokeys, | 329 | &bfin_device_gpiokeys, |
310 | #endif | 330 | #endif |
331 | |||
332 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
333 | &i2c_gpio_device, | ||
334 | #endif | ||
311 | }; | 335 | }; |
312 | 336 | ||
313 | static int __init ezkit_init(void) | 337 | static int __init ezkit_init(void) |
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c index 689816937703..cd87df730ef5 100644 --- a/arch/blackfin/mach-bf533/boards/stamp.c +++ b/arch/blackfin/mach-bf533/boards/stamp.c | |||
@@ -396,6 +396,26 @@ static struct platform_device bfin_device_gpiokeys = { | |||
396 | }; | 396 | }; |
397 | #endif | 397 | #endif |
398 | 398 | ||
399 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
400 | #include <linux/i2c-gpio.h> | ||
401 | |||
402 | static struct i2c_gpio_platform_data i2c_gpio_data = { | ||
403 | .sda_pin = 2, | ||
404 | .scl_pin = 3, | ||
405 | .sda_is_open_drain = 0, | ||
406 | .scl_is_open_drain = 0, | ||
407 | .udelay = 40, | ||
408 | }; | ||
409 | |||
410 | static struct platform_device i2c_gpio_device = { | ||
411 | .name = "i2c-gpio", | ||
412 | .id = 0, | ||
413 | .dev = { | ||
414 | .platform_data = &i2c_gpio_data, | ||
415 | }, | ||
416 | }; | ||
417 | #endif | ||
418 | |||
399 | static struct platform_device *stamp_devices[] __initdata = { | 419 | static struct platform_device *stamp_devices[] __initdata = { |
400 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | 420 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
401 | &rtc_device, | 421 | &rtc_device, |
@@ -433,6 +453,10 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
433 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | 453 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
434 | &bfin_device_gpiokeys, | 454 | &bfin_device_gpiokeys, |
435 | #endif | 455 | #endif |
456 | |||
457 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
458 | &i2c_gpio_device, | ||
459 | #endif | ||
436 | }; | 460 | }; |
437 | 461 | ||
438 | static int __init stamp_init(void) | 462 | static int __init stamp_init(void) |
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c index edfceb08a7d5..36114dd4ab3a 100644 --- a/arch/blackfin/mach-bf561/boards/ezkit.c +++ b/arch/blackfin/mach-bf561/boards/ezkit.c | |||
@@ -270,6 +270,26 @@ static struct platform_device bfin_device_gpiokeys = { | |||
270 | }; | 270 | }; |
271 | #endif | 271 | #endif |
272 | 272 | ||
273 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
274 | #include <linux/i2c-gpio.h> | ||
275 | |||
276 | static struct i2c_gpio_platform_data i2c_gpio_data = { | ||
277 | .sda_pin = 1, | ||
278 | .scl_pin = 0, | ||
279 | .sda_is_open_drain = 0, | ||
280 | .scl_is_open_drain = 0, | ||
281 | .udelay = 40, | ||
282 | }; | ||
283 | |||
284 | static struct platform_device i2c_gpio_device = { | ||
285 | .name = "i2c-gpio", | ||
286 | .id = 0, | ||
287 | .dev = { | ||
288 | .platform_data = &i2c_gpio_data, | ||
289 | }, | ||
290 | }; | ||
291 | #endif | ||
292 | |||
273 | static struct platform_device *ezkit_devices[] __initdata = { | 293 | static struct platform_device *ezkit_devices[] __initdata = { |
274 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | 294 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
275 | &smc91x_device, | 295 | &smc91x_device, |
@@ -294,6 +314,10 @@ static struct platform_device *ezkit_devices[] __initdata = { | |||
294 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | 314 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
295 | &bfin_device_gpiokeys, | 315 | &bfin_device_gpiokeys, |
296 | #endif | 316 | #endif |
317 | |||
318 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
319 | &i2c_gpio_device, | ||
320 | #endif | ||
297 | }; | 321 | }; |
298 | 322 | ||
299 | static int __init ezkit_init(void) | 323 | static int __init ezkit_init(void) |