diff options
author | Hartley Sweeten <hartleys@visionengravers.com> | 2008-10-16 18:57:03 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-12-01 12:22:08 -0500 |
commit | d52a26a956d3925c6eaf8770e95e4d5f13740696 (patch) | |
tree | 0b9ef416c97745295d042a1e0f9c04c868caaf57 /arch/arm/mach-ep93xx | |
parent | 4c5744ed59ac8c7312399f279b96e6e3d8f95b5d (diff) |
[ARM] 5311/1: ep93xx: add core support for built in i2c bus
Allow the ep93xx platform init code to register the built-in i2c bus.
The EP93xx processor has two GPIO pins dedicated for an I2C bus. This
patch registers the platform supplied i2c_board_info and the necessary
platform_device information for the i2c-gpio driver to use these pins.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-ep93xx')
-rw-r--r-- | arch/arm/mach-ep93xx/core.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-ep93xx/include/mach/platform.h | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index 48345fb34613..61da67f31ce0 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c | |||
@@ -34,6 +34,8 @@ | |||
34 | #include <linux/amba/bus.h> | 34 | #include <linux/amba/bus.h> |
35 | #include <linux/amba/serial.h> | 35 | #include <linux/amba/serial.h> |
36 | #include <linux/io.h> | 36 | #include <linux/io.h> |
37 | #include <linux/i2c.h> | ||
38 | #include <linux/i2c-gpio.h> | ||
37 | 39 | ||
38 | #include <asm/types.h> | 40 | #include <asm/types.h> |
39 | #include <asm/setup.h> | 41 | #include <asm/setup.h> |
@@ -497,6 +499,26 @@ void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr) | |||
497 | platform_device_register(&ep93xx_eth_device); | 499 | platform_device_register(&ep93xx_eth_device); |
498 | } | 500 | } |
499 | 501 | ||
502 | static struct i2c_gpio_platform_data ep93xx_i2c_data = { | ||
503 | .sda_pin = EP93XX_GPIO_LINE_EEDAT, | ||
504 | .sda_is_open_drain = 0, | ||
505 | .scl_pin = EP93XX_GPIO_LINE_EECLK, | ||
506 | .scl_is_open_drain = 0, | ||
507 | .udelay = 2, | ||
508 | }; | ||
509 | |||
510 | static struct platform_device ep93xx_i2c_device = { | ||
511 | .name = "i2c-gpio", | ||
512 | .id = 0, | ||
513 | .dev.platform_data = &ep93xx_i2c_data, | ||
514 | }; | ||
515 | |||
516 | void __init ep93xx_register_i2c(struct i2c_board_info *devices, int num) | ||
517 | { | ||
518 | i2c_register_board_info(0, devices, num); | ||
519 | platform_device_register(&ep93xx_i2c_device); | ||
520 | } | ||
521 | |||
500 | extern void ep93xx_gpio_init(void); | 522 | extern void ep93xx_gpio_init(void); |
501 | 523 | ||
502 | void __init ep93xx_init_devices(void) | 524 | void __init ep93xx_init_devices(void) |
diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/include/mach/platform.h index db2489d3bda7..88f7e88f152f 100644 --- a/arch/arm/mach-ep93xx/include/mach/platform.h +++ b/arch/arm/mach-ep93xx/include/mach/platform.h | |||
@@ -14,6 +14,7 @@ void ep93xx_map_io(void); | |||
14 | void ep93xx_init_irq(void); | 14 | void ep93xx_init_irq(void); |
15 | void ep93xx_init_time(unsigned long); | 15 | void ep93xx_init_time(unsigned long); |
16 | void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr); | 16 | void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr); |
17 | void ep93xx_register_i2c(struct i2c_board_info *devices, int num); | ||
17 | void ep93xx_init_devices(void); | 18 | void ep93xx_init_devices(void); |
18 | extern struct sys_timer ep93xx_timer; | 19 | extern struct sys_timer ep93xx_timer; |
19 | 20 | ||