Skip to content

Commit

Permalink
[ARM] 5311/1: ep93xx: add core support for built in i2c bus
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hartley Sweeten authored and Russell King committed Dec 1, 2008
1 parent 4c5744e commit d52a26a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions arch/arm/mach-ep93xx/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#include <linux/amba/bus.h>
#include <linux/amba/serial.h>
#include <linux/io.h>
#include <linux/i2c.h>
#include <linux/i2c-gpio.h>

#include <asm/types.h>
#include <asm/setup.h>
Expand Down Expand Up @@ -497,6 +499,26 @@ void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr)
platform_device_register(&ep93xx_eth_device);
}

static struct i2c_gpio_platform_data ep93xx_i2c_data = {
.sda_pin = EP93XX_GPIO_LINE_EEDAT,
.sda_is_open_drain = 0,
.scl_pin = EP93XX_GPIO_LINE_EECLK,
.scl_is_open_drain = 0,
.udelay = 2,
};

static struct platform_device ep93xx_i2c_device = {
.name = "i2c-gpio",
.id = 0,
.dev.platform_data = &ep93xx_i2c_data,
};

void __init ep93xx_register_i2c(struct i2c_board_info *devices, int num)
{
i2c_register_board_info(0, devices, num);
platform_device_register(&ep93xx_i2c_device);
}

extern void ep93xx_gpio_init(void);

void __init ep93xx_init_devices(void)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-ep93xx/include/mach/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ void ep93xx_map_io(void);
void ep93xx_init_irq(void);
void ep93xx_init_time(unsigned long);
void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr);
void ep93xx_register_i2c(struct i2c_board_info *devices, int num);
void ep93xx_init_devices(void);
extern struct sys_timer ep93xx_timer;

Expand Down

0 comments on commit d52a26a

Please sign in to comment.