diff options
author | Paul Mundt <lethal@linux-sh.org> | 2008-03-25 03:49:30 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-04-18 12:50:05 -0400 |
commit | c2933965de89a60688d51c810d535c1f2cce8448 (patch) | |
tree | 3446c1e7f25b83e3cee7132cbf0a11beacaacb22 /arch/sh | |
parent | b026a23c07d1bf21188c57e90118782c58db6061 (diff) |
sh: r7780rp: Hook up the I2C and SMBus platform devices.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/boards/renesas/r7780rp/setup.c | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/arch/sh/boards/renesas/r7780rp/setup.c b/arch/sh/boards/renesas/r7780rp/setup.c index 2f68bea7890c..a5c5e9236501 100644 --- a/arch/sh/boards/renesas/r7780rp/setup.c +++ b/arch/sh/boards/renesas/r7780rp/setup.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Renesas Solutions Highlander Support. | 4 | * Renesas Solutions Highlander Support. |
5 | * | 5 | * |
6 | * Copyright (C) 2002 Atom Create Engineering Co., Ltd. | 6 | * Copyright (C) 2002 Atom Create Engineering Co., Ltd. |
7 | * Copyright (C) 2005 - 2007 Paul Mundt | 7 | * Copyright (C) 2005 - 2008 Paul Mundt |
8 | * | 8 | * |
9 | * This contains support for the R7780RP-1, R7780MP, and R7785RP | 9 | * This contains support for the R7780RP-1, R7780MP, and R7785RP |
10 | * Highlander modules. | 10 | * Highlander modules. |
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/ata_platform.h> | 18 | #include <linux/ata_platform.h> |
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <linux/i2c.h> | ||
20 | #include <net/ax88796.h> | 21 | #include <net/ax88796.h> |
21 | #include <asm/machvec.h> | 22 | #include <asm/machvec.h> |
22 | #include <asm/r7780rp.h> | 23 | #include <asm/r7780rp.h> |
@@ -176,11 +177,38 @@ static struct platform_device ax88796_device = { | |||
176 | .resource = ax88796_resources, | 177 | .resource = ax88796_resources, |
177 | }; | 178 | }; |
178 | 179 | ||
180 | static struct resource smbus_resources[] = { | ||
181 | [0] = { | ||
182 | .start = PA_SMCR, | ||
183 | .end = PA_SMCR + 0x100 - 1, | ||
184 | .flags = IORESOURCE_MEM, | ||
185 | }, | ||
186 | [1] = { | ||
187 | .start = IRQ_SMBUS, | ||
188 | .end = IRQ_SMBUS, | ||
189 | .flags = IORESOURCE_IRQ, | ||
190 | }, | ||
191 | }; | ||
192 | |||
193 | static struct platform_device smbus_device = { | ||
194 | .name = "i2c-highlander", | ||
195 | .id = 0, | ||
196 | .num_resources = ARRAY_SIZE(smbus_resources), | ||
197 | .resource = smbus_resources, | ||
198 | }; | ||
199 | |||
200 | static struct i2c_board_info __initdata highlander_i2c_devices[] = { | ||
201 | { | ||
202 | I2C_BOARD_INFO("rtc-rs5c372", 0x32), | ||
203 | .type = "r2025sd", | ||
204 | }, | ||
205 | }; | ||
179 | 206 | ||
180 | static struct platform_device *r7780rp_devices[] __initdata = { | 207 | static struct platform_device *r7780rp_devices[] __initdata = { |
181 | &r8a66597_usb_host_device, | 208 | &r8a66597_usb_host_device, |
182 | &m66592_usb_peripheral_device, | 209 | &m66592_usb_peripheral_device, |
183 | &heartbeat_device, | 210 | &heartbeat_device, |
211 | &smbus_device, | ||
184 | #ifndef CONFIG_SH_R7780RP | 212 | #ifndef CONFIG_SH_R7780RP |
185 | &ax88796_device, | 213 | &ax88796_device, |
186 | #endif | 214 | #endif |
@@ -199,12 +227,20 @@ static struct trapped_io cf_trapped_io = { | |||
199 | 227 | ||
200 | static int __init r7780rp_devices_setup(void) | 228 | static int __init r7780rp_devices_setup(void) |
201 | { | 229 | { |
230 | int ret = 0; | ||
231 | |||
202 | #ifndef CONFIG_SH_R7780RP | 232 | #ifndef CONFIG_SH_R7780RP |
203 | if (register_trapped_io(&cf_trapped_io) == 0) | 233 | if (register_trapped_io(&cf_trapped_io) == 0) |
204 | platform_device_register(&cf_ide_device); | 234 | ret |= platform_device_register(&cf_ide_device); |
205 | #endif | 235 | #endif |
206 | return platform_add_devices(r7780rp_devices, | 236 | |
237 | ret |= platform_add_devices(r7780rp_devices, | ||
207 | ARRAY_SIZE(r7780rp_devices)); | 238 | ARRAY_SIZE(r7780rp_devices)); |
239 | |||
240 | ret |= i2c_register_board_info(0, highlander_i2c_devices, | ||
241 | ARRAY_SIZE(highlander_i2c_devices)); | ||
242 | |||
243 | return ret; | ||
208 | } | 244 | } |
209 | device_initcall(r7780rp_devices_setup); | 245 | device_initcall(r7780rp_devices_setup); |
210 | 246 | ||