diff options
author | Mike Rapoport <mike@compulab.co.il> | 2011-04-13 06:52:25 -0400 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-07-12 23:38:59 -0400 |
commit | bea2d6b84bdf1ae7384286394e0048a692e12c3f (patch) | |
tree | 22d83a8641b8ed2d06a8eec17d4da6361aa15c8a /arch/arm/mach-tegra/board-trimslice.c | |
parent | 24fe4325207d4adc095e71009773d6705237c29b (diff) |
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/board-trimslice.c')
-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 cda4cfd78e84..dcf5fc53f8f6 100644 --- a/arch/arm/mach-tegra/board-trimslice.c +++ b/arch/arm/mach-tegra/board-trimslice.c | |||
@@ -23,6 +23,8 @@ | |||
23 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
24 | #include <linux/serial_8250.h> | 24 | #include <linux/serial_8250.h> |
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | #include <linux/i2c.h> | ||
27 | #include <linux/i2c-tegra.h> | ||
26 | 28 | ||
27 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
28 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
@@ -77,6 +79,41 @@ static struct platform_device *trimslice_devices[] __initdata = { | |||
77 | &tegra_sdhci_device4, | 79 | &tegra_sdhci_device4, |
78 | }; | 80 | }; |
79 | 81 | ||
82 | static struct tegra_i2c_platform_data trimslice_i2c1_platform_data = { | ||
83 | .bus_clk_rate = 400000, | ||
84 | }; | ||
85 | |||
86 | static struct tegra_i2c_platform_data trimslice_i2c2_platform_data = { | ||
87 | .bus_clk_rate = 400000, | ||
88 | }; | ||
89 | |||
90 | static struct tegra_i2c_platform_data trimslice_i2c3_platform_data = { | ||
91 | .bus_clk_rate = 400000, | ||
92 | }; | ||
93 | |||
94 | static struct i2c_board_info trimslice_i2c3_board_info[] = { | ||
95 | { | ||
96 | I2C_BOARD_INFO("tlv320aic23", 0x1a), | ||
97 | }, | ||
98 | { | ||
99 | I2C_BOARD_INFO("em3027", 0x56), | ||
100 | }, | ||
101 | }; | ||
102 | |||
103 | static void trimslice_i2c_init(void) | ||
104 | { | ||
105 | tegra_i2c_device1.dev.platform_data = &trimslice_i2c1_platform_data; | ||
106 | tegra_i2c_device2.dev.platform_data = &trimslice_i2c2_platform_data; | ||
107 | tegra_i2c_device3.dev.platform_data = &trimslice_i2c3_platform_data; | ||
108 | |||
109 | platform_device_register(&tegra_i2c_device1); | ||
110 | platform_device_register(&tegra_i2c_device2); | ||
111 | platform_device_register(&tegra_i2c_device3); | ||
112 | |||
113 | i2c_register_board_info(2, trimslice_i2c3_board_info, | ||
114 | ARRAY_SIZE(trimslice_i2c3_board_info)); | ||
115 | } | ||
116 | |||
80 | static void __init tegra_trimslice_fixup(struct machine_desc *desc, | 117 | static void __init tegra_trimslice_fixup(struct machine_desc *desc, |
81 | struct tag *tags, char **cmdline, struct meminfo *mi) | 118 | struct tag *tags, char **cmdline, struct meminfo *mi) |
82 | { | 119 | { |
@@ -112,6 +149,8 @@ static void __init tegra_trimslice_init(void) | |||
112 | tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4; | 149 | tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4; |
113 | 150 | ||
114 | platform_add_devices(trimslice_devices, ARRAY_SIZE(trimslice_devices)); | 151 | platform_add_devices(trimslice_devices, ARRAY_SIZE(trimslice_devices)); |
152 | |||
153 | trimslice_i2c_init(); | ||
115 | } | 154 | } |
116 | 155 | ||
117 | MACHINE_START(TRIMSLICE, "trimslice") | 156 | MACHINE_START(TRIMSLICE, "trimslice") |