diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-11-06 02:00:48 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-11-06 02:00:48 -0500 |
commit | 02cee68998010c4a2cc2383c86babc2ecc737183 (patch) | |
tree | 13c6483472f672c3b2570b075ed2ad4fd4c5405e /arch/arm/mach-ep93xx/core.c | |
parent | f5ba35023697e54a24487bcd822194390a333893 (diff) | |
parent | b419148e567728f6af0c3b01965c1cc141e3e13a (diff) |
Merge commit 'v2.6.32-rc6' into next
Diffstat (limited to 'arch/arm/mach-ep93xx/core.c')
-rw-r--r-- | arch/arm/mach-ep93xx/core.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index f7ebed942f66..b4357c388d2e 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c | |||
@@ -206,7 +206,6 @@ static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc) | |||
206 | for (i = 0; i < 8; i++) { | 206 | for (i = 0; i < 8; i++) { |
207 | if (status & (1 << i)) { | 207 | if (status & (1 << i)) { |
208 | int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_B(0)) + i; | 208 | int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_B(0)) + i; |
209 | desc = irq_desc + gpio_irq; | ||
210 | generic_handle_irq(gpio_irq); | 209 | generic_handle_irq(gpio_irq); |
211 | } | 210 | } |
212 | } | 211 | } |
@@ -550,13 +549,11 @@ void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr) | |||
550 | platform_device_register(&ep93xx_eth_device); | 549 | platform_device_register(&ep93xx_eth_device); |
551 | } | 550 | } |
552 | 551 | ||
553 | static struct i2c_gpio_platform_data ep93xx_i2c_data = { | 552 | |
554 | .sda_pin = EP93XX_GPIO_LINE_EEDAT, | 553 | /************************************************************************* |
555 | .sda_is_open_drain = 0, | 554 | * EP93xx i2c peripheral handling |
556 | .scl_pin = EP93XX_GPIO_LINE_EECLK, | 555 | *************************************************************************/ |
557 | .scl_is_open_drain = 0, | 556 | static struct i2c_gpio_platform_data ep93xx_i2c_data; |
558 | .udelay = 2, | ||
559 | }; | ||
560 | 557 | ||
561 | static struct platform_device ep93xx_i2c_device = { | 558 | static struct platform_device ep93xx_i2c_device = { |
562 | .name = "i2c-gpio", | 559 | .name = "i2c-gpio", |
@@ -564,8 +561,25 @@ static struct platform_device ep93xx_i2c_device = { | |||
564 | .dev.platform_data = &ep93xx_i2c_data, | 561 | .dev.platform_data = &ep93xx_i2c_data, |
565 | }; | 562 | }; |
566 | 563 | ||
567 | void __init ep93xx_register_i2c(struct i2c_board_info *devices, int num) | 564 | void __init ep93xx_register_i2c(struct i2c_gpio_platform_data *data, |
565 | struct i2c_board_info *devices, int num) | ||
568 | { | 566 | { |
567 | /* | ||
568 | * Set the EEPROM interface pin drive type control. | ||
569 | * Defines the driver type for the EECLK and EEDAT pins as either | ||
570 | * open drain, which will require an external pull-up, or a normal | ||
571 | * CMOS driver. | ||
572 | */ | ||
573 | if (data->sda_is_open_drain && data->sda_pin != EP93XX_GPIO_LINE_EEDAT) | ||
574 | pr_warning("ep93xx: sda != EEDAT, open drain has no effect\n"); | ||
575 | if (data->scl_is_open_drain && data->scl_pin != EP93XX_GPIO_LINE_EECLK) | ||
576 | pr_warning("ep93xx: scl != EECLK, open drain has no effect\n"); | ||
577 | |||
578 | __raw_writel((data->sda_is_open_drain << 1) | | ||
579 | (data->scl_is_open_drain << 0), | ||
580 | EP93XX_GPIO_EEDRIVE); | ||
581 | |||
582 | ep93xx_i2c_data = *data; | ||
569 | i2c_register_board_info(0, devices, num); | 583 | i2c_register_board_info(0, devices, num); |
570 | platform_device_register(&ep93xx_i2c_device); | 584 | platform_device_register(&ep93xx_i2c_device); |
571 | } | 585 | } |