diff options
author | Hartley Sweeten <hartleys@visionengravers.com> | 2009-10-07 19:45:00 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-10-10 07:45:13 -0400 |
commit | 6531a991f95f2f34fc00cf0a030b1cdd5e19dc02 (patch) | |
tree | 729b67962bfb16811e96e9f483e463dd6dadbd5f /arch/arm/mach-ep93xx/edb93xx.c | |
parent | 03d38418a5a3361a757336cd87d64b35c1c7d658 (diff) |
ARM: 5754/1: ep93xx: update i2c support
Update the ep93xx i2c support:
1) The platform init code passes the configuration data for the
i2c-gpio driver. This allows any gpio pin do be used for the
sda and scl pins. It also allows the platform to specify the
udelay and timeout.
2) Program the gpio configuration register to enable/disable the
open drain drivers. Note that this really only works if the
sda and scl pins are set to EP93XX_GPIO_LINE_EEDAT and
EP93XX_GPIO_LINE_EECLK.
3) Update the edb93xx.c platform init to use the new support.
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/edb93xx.c')
-rw-r--r-- | arch/arm/mach-ep93xx/edb93xx.c | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c index 73145ae5d3fa..ca71cf1a72a0 100644 --- a/arch/arm/mach-ep93xx/edb93xx.c +++ b/arch/arm/mach-ep93xx/edb93xx.c | |||
@@ -27,8 +27,10 @@ | |||
27 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/platform_device.h> | 29 | #include <linux/platform_device.h> |
30 | #include <linux/i2c.h> | ||
31 | #include <linux/mtd/physmap.h> | 30 | #include <linux/mtd/physmap.h> |
31 | #include <linux/gpio.h> | ||
32 | #include <linux/i2c.h> | ||
33 | #include <linux/i2c-gpio.h> | ||
32 | 34 | ||
33 | #include <mach/hardware.h> | 35 | #include <mach/hardware.h> |
34 | 36 | ||
@@ -76,13 +78,26 @@ static struct ep93xx_eth_data edb93xx_eth_data = { | |||
76 | .phy_id = 1, | 78 | .phy_id = 1, |
77 | }; | 79 | }; |
78 | 80 | ||
79 | static struct i2c_board_info __initdata edb93xxa_i2c_data[] = { | 81 | |
82 | /************************************************************************* | ||
83 | * EDB93xx i2c peripheral handling | ||
84 | *************************************************************************/ | ||
85 | static struct i2c_gpio_platform_data edb93xx_i2c_gpio_data = { | ||
86 | .sda_pin = EP93XX_GPIO_LINE_EEDAT, | ||
87 | .sda_is_open_drain = 0, | ||
88 | .scl_pin = EP93XX_GPIO_LINE_EECLK, | ||
89 | .scl_is_open_drain = 0, | ||
90 | .udelay = 0, /* default to 100 kHz */ | ||
91 | .timeout = 0, /* default to 100 ms */ | ||
92 | }; | ||
93 | |||
94 | static struct i2c_board_info __initdata edb93xxa_i2c_board_info[] = { | ||
80 | { | 95 | { |
81 | I2C_BOARD_INFO("isl1208", 0x6f), | 96 | I2C_BOARD_INFO("isl1208", 0x6f), |
82 | }, | 97 | }, |
83 | }; | 98 | }; |
84 | 99 | ||
85 | static struct i2c_board_info __initdata edb93xx_i2c_data[] = { | 100 | static struct i2c_board_info __initdata edb93xx_i2c_board_info[] = { |
86 | { | 101 | { |
87 | I2C_BOARD_INFO("ds1337", 0x68), | 102 | I2C_BOARD_INFO("ds1337", 0x68), |
88 | }, | 103 | }, |
@@ -92,12 +107,14 @@ static void __init edb93xx_register_i2c(void) | |||
92 | { | 107 | { |
93 | if (machine_is_edb9302a() || machine_is_edb9307a() || | 108 | if (machine_is_edb9302a() || machine_is_edb9307a() || |
94 | machine_is_edb9315a()) { | 109 | machine_is_edb9315a()) { |
95 | ep93xx_register_i2c(edb93xxa_i2c_data, | 110 | ep93xx_register_i2c(&edb93xx_i2c_gpio_data, |
96 | ARRAY_SIZE(edb93xxa_i2c_data)); | 111 | edb93xxa_i2c_board_info, |
112 | ARRAY_SIZE(edb93xxa_i2c_board_info)); | ||
97 | } else if (machine_is_edb9307() || machine_is_edb9312() || | 113 | } else if (machine_is_edb9307() || machine_is_edb9312() || |
98 | machine_is_edb9315()) { | 114 | machine_is_edb9315()) { |
99 | ep93xx_register_i2c(edb93xx_i2c_data, | 115 | ep93xx_register_i2c(&edb93xx_i2c_gpio_data |
100 | ARRAY_SIZE(edb93xx_i2c_data)); | 116 | edb93xx_i2c_board_info, |
117 | ARRAY_SIZE(edb93xx_i2c_board_info)); | ||
101 | } | 118 | } |
102 | } | 119 | } |
103 | 120 | ||