aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2011-03-04 18:21:53 -0500
committerOlof Johansson <olof@lixom.net>2011-03-07 18:44:09 -0500
commitf9a795af4d3b886140e790507a9158ebe3bc6a4a (patch)
tree0beb210aeecc7385197afb550077f0006afac503 /arch/arm/mach-tegra
parentef2b1a0f1eb299c2d00addfee3a2631395d9bdb5 (diff)
ARM: tegra: seaboard: register i2c devices
Register the base i2c devices on seaboard. A few more are pending, but it's a start. Signed-off-by: Olof Johansson <olof@lixom.net> Acked-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/board-seaboard-pinmux.c1
-rw-r--r--arch/arm/mach-tegra/board-seaboard.c62
2 files changed, 59 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/board-seaboard-pinmux.c b/arch/arm/mach-tegra/board-seaboard-pinmux.c
index 7e96d4918b9e..0bda495e9742 100644
--- a/arch/arm/mach-tegra/board-seaboard-pinmux.c
+++ b/arch/arm/mach-tegra/board-seaboard-pinmux.c
@@ -166,6 +166,7 @@ static struct tegra_gpio_table gpio_table[] = {
166 { .gpio = TEGRA_GPIO_SD2_POWER, .enable = true }, 166 { .gpio = TEGRA_GPIO_SD2_POWER, .enable = true },
167 { .gpio = TEGRA_GPIO_LIDSWITCH, .enable = true }, 167 { .gpio = TEGRA_GPIO_LIDSWITCH, .enable = true },
168 { .gpio = TEGRA_GPIO_POWERKEY, .enable = true }, 168 { .gpio = TEGRA_GPIO_POWERKEY, .enable = true },
169 { .gpio = TEGRA_GPIO_ISL29018_IRQ, .enable = true },
169}; 170};
170 171
171void __init seaboard_pinmux_init(void) 172void __init seaboard_pinmux_init(void)
diff --git a/arch/arm/mach-tegra/board-seaboard.c b/arch/arm/mach-tegra/board-seaboard.c
index eb28dbdac007..a8d7ace9f958 100644
--- a/arch/arm/mach-tegra/board-seaboard.c
+++ b/arch/arm/mach-tegra/board-seaboard.c
@@ -18,9 +18,12 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/serial_8250.h> 20#include <linux/serial_8250.h>
21#include <linux/i2c.h>
22#include <linux/i2c-tegra.h>
21#include <linux/delay.h> 23#include <linux/delay.h>
22#include <linux/input.h> 24#include <linux/input.h>
23#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/gpio.h>
24#include <linux/gpio_keys.h> 27#include <linux/gpio_keys.h>
25 28
26#include <mach/iomap.h> 29#include <mach/iomap.h>
@@ -63,6 +66,22 @@ static __initdata struct tegra_clk_init_table seaboard_clk_init_table[] = {
63 { NULL, NULL, 0, 0}, 66 { NULL, NULL, 0, 0},
64}; 67};
65 68
69static struct tegra_i2c_platform_data seaboard_i2c1_platform_data = {
70 .bus_clk_rate = 400000.
71};
72
73static struct tegra_i2c_platform_data seaboard_i2c2_platform_data = {
74 .bus_clk_rate = 400000,
75};
76
77static struct tegra_i2c_platform_data seaboard_i2c3_platform_data = {
78 .bus_clk_rate = 400000,
79};
80
81static struct tegra_i2c_platform_data seaboard_dvc_platform_data = {
82 .bus_clk_rate = 400000,
83};
84
66static struct gpio_keys_button seaboard_gpio_keys_buttons[] = { 85static struct gpio_keys_button seaboard_gpio_keys_buttons[] = {
67 { 86 {
68 .code = SW_LID, 87 .code = SW_LID,
@@ -124,7 +143,36 @@ static struct platform_device *seaboard_devices[] __initdata = {
124 &seaboard_gpio_keys_device, 143 &seaboard_gpio_keys_device,
125}; 144};
126 145
127static void __init __tegra_seaboard_init(void) 146static struct i2c_board_info __initdata isl29018_device = {
147 I2C_BOARD_INFO("isl29018", 0x44),
148 .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_ISL29018_IRQ),
149};
150
151static struct i2c_board_info __initdata adt7461_device = {
152 I2C_BOARD_INFO("adt7461", 0x4c),
153};
154
155static void __init seaboard_i2c_init(void)
156{
157 gpio_request(TEGRA_GPIO_ISL29018_IRQ, "isl29018");
158 gpio_direction_input(TEGRA_GPIO_ISL29018_IRQ);
159
160 i2c_register_board_info(0, &isl29018_device, 1);
161
162 i2c_register_board_info(4, &adt7461_device, 1);
163
164 tegra_i2c_device1.dev.platform_data = &seaboard_i2c1_platform_data;
165 tegra_i2c_device2.dev.platform_data = &seaboard_i2c2_platform_data;
166 tegra_i2c_device3.dev.platform_data = &seaboard_i2c3_platform_data;
167 tegra_i2c_device4.dev.platform_data = &seaboard_dvc_platform_data;
168
169 platform_device_register(&tegra_i2c_device1);
170 platform_device_register(&tegra_i2c_device2);
171 platform_device_register(&tegra_i2c_device3);
172 platform_device_register(&tegra_i2c_device4);
173}
174
175static void __init seaboard_common_init(void)
128{ 176{
129 seaboard_pinmux_init(); 177 seaboard_pinmux_init();
130 178
@@ -144,7 +192,9 @@ static void __init tegra_seaboard_init(void)
144 debug_uart_platform_data[0].mapbase = TEGRA_UARTD_BASE; 192 debug_uart_platform_data[0].mapbase = TEGRA_UARTD_BASE;
145 debug_uart_platform_data[0].irq = INT_UARTD; 193 debug_uart_platform_data[0].irq = INT_UARTD;
146 194
147 __tegra_seaboard_init(); 195 seaboard_common_init();
196
197 seaboard_i2c_init();
148} 198}
149 199
150static void __init tegra_kaen_init(void) 200static void __init tegra_kaen_init(void)
@@ -154,7 +204,9 @@ static void __init tegra_kaen_init(void)
154 debug_uart_platform_data[0].mapbase = TEGRA_UARTB_BASE; 204 debug_uart_platform_data[0].mapbase = TEGRA_UARTB_BASE;
155 debug_uart_platform_data[0].irq = INT_UARTB; 205 debug_uart_platform_data[0].irq = INT_UARTB;
156 206
157 __tegra_seaboard_init(); 207 seaboard_common_init();
208
209 seaboard_i2c_init();
158} 210}
159 211
160static void __init tegra_wario_init(void) 212static void __init tegra_wario_init(void)
@@ -164,7 +216,9 @@ static void __init tegra_wario_init(void)
164 debug_uart_platform_data[0].mapbase = TEGRA_UARTB_BASE; 216 debug_uart_platform_data[0].mapbase = TEGRA_UARTB_BASE;
165 debug_uart_platform_data[0].irq = INT_UARTB; 217 debug_uart_platform_data[0].irq = INT_UARTB;
166 218
167 __tegra_seaboard_init(); 219 seaboard_common_init();
220
221 seaboard_i2c_init();
168} 222}
169 223
170 224