diff options
author | Mike Rapoport <mike@compulab.co.il> | 2011-04-13 13:52:25 +0300 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-07-12 20:38:59 -0700 |
commit | bea2d6b84bdf1ae7384286394e0048a692e12c3f (patch) | |
tree | 22d83a8641b8ed2d06a8eec17d4da6361aa15c8a /arch/arm/mach-tegra | |
parent | 24fe4325207d4adc095e71009773d6705237c29b (diff) | |
download | op-kernel-dev-bea2d6b84bdf1ae7384286394e0048a692e12c3f.zip op-kernel-dev-bea2d6b84bdf1ae7384286394e0048a692e12c3f.tar.gz |
ARM: tegra: trimslice: register i2c busses and devices
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r-- | arch/arm/mach-tegra/board-trimslice.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-trimslice.c b/arch/arm/mach-tegra/board-trimslice.c index cda4cfd..dcf5fc5 100644 --- a/arch/arm/mach-tegra/board-trimslice.c +++ b/arch/arm/mach-tegra/board-trimslice.c @@ -23,6 +23,8 @@ #include <linux/platform_device.h> #include <linux/serial_8250.h> #include <linux/io.h> +#include <linux/i2c.h> +#include <linux/i2c-tegra.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> @@ -77,6 +79,41 @@ static struct platform_device *trimslice_devices[] __initdata = { &tegra_sdhci_device4, }; +static struct tegra_i2c_platform_data trimslice_i2c1_platform_data = { + .bus_clk_rate = 400000, +}; + +static struct tegra_i2c_platform_data trimslice_i2c2_platform_data = { + .bus_clk_rate = 400000, +}; + +static struct tegra_i2c_platform_data trimslice_i2c3_platform_data = { + .bus_clk_rate = 400000, +}; + +static struct i2c_board_info trimslice_i2c3_board_info[] = { + { + I2C_BOARD_INFO("tlv320aic23", 0x1a), + }, + { + I2C_BOARD_INFO("em3027", 0x56), + }, +}; + +static void trimslice_i2c_init(void) +{ + tegra_i2c_device1.dev.platform_data = &trimslice_i2c1_platform_data; + tegra_i2c_device2.dev.platform_data = &trimslice_i2c2_platform_data; + tegra_i2c_device3.dev.platform_data = &trimslice_i2c3_platform_data; + + platform_device_register(&tegra_i2c_device1); + platform_device_register(&tegra_i2c_device2); + platform_device_register(&tegra_i2c_device3); + + i2c_register_board_info(2, trimslice_i2c3_board_info, + ARRAY_SIZE(trimslice_i2c3_board_info)); +} + static void __init tegra_trimslice_fixup(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi) { @@ -112,6 +149,8 @@ static void __init tegra_trimslice_init(void) tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4; platform_add_devices(trimslice_devices, ARRAY_SIZE(trimslice_devices)); + + trimslice_i2c_init(); } MACHINE_START(TRIMSLICE, "trimslice") |