aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2009-02-12 09:58:20 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-02-19 06:30:25 -0500
commit533ad5e60c0a5ff3cef7583b5b1b0eee84c2bda6 (patch)
tree8fee4ffecf0b42314d20d2a906c46938bad3c543 /arch/arm
parent2514cca06be9dc7ae12908085ebaf0ef49e6d8ae (diff)
[ARM] 5395/1: RealView: Add support for the DS1338 RTC chip
This chip is on the I2C bus on the RealView and Versatile boards. The patch adds the i2c_board_info definition for this device and registers it with the I2C subsystem. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-realview/core.c16
-rw-r--r--arch/arm/mach-realview/realview_pb1176.c1
-rw-r--r--arch/arm/mach-versatile/core.c16
3 files changed, 31 insertions, 2 deletions
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index bd2aa4f16141..27b48be73676 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -158,11 +158,25 @@ static struct resource realview_i2c_resource = {
158 158
159struct platform_device realview_i2c_device = { 159struct platform_device realview_i2c_device = {
160 .name = "versatile-i2c", 160 .name = "versatile-i2c",
161 .id = -1, 161 .id = 0,
162 .num_resources = 1, 162 .num_resources = 1,
163 .resource = &realview_i2c_resource, 163 .resource = &realview_i2c_resource,
164}; 164};
165 165
166static struct i2c_board_info realview_i2c_board_info[] = {
167 {
168 I2C_BOARD_INFO("rtc-ds1307", 0xd0 >> 1),
169 .type = "ds1338",
170 },
171};
172
173static int __init realview_i2c_init(void)
174{
175 return i2c_register_board_info(0, realview_i2c_board_info,
176 ARRAY_SIZE(realview_i2c_board_info));
177}
178arch_initcall(realview_i2c_init);
179
166#define REALVIEW_SYSMCI (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_MCI_OFFSET) 180#define REALVIEW_SYSMCI (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_MCI_OFFSET)
167 181
168static unsigned int realview_mmc_status(struct device *dev) 182static unsigned int realview_mmc_status(struct device *dev)
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index 8f0683c22140..d9d684d29e92 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -260,6 +260,7 @@ static void __init realview_pb1176_init(void)
260 260
261 realview_flash_register(&realview_pb1176_flash_resource, 1); 261 realview_flash_register(&realview_pb1176_flash_resource, 1);
262 realview_eth_register(NULL, realview_pb1176_smsc911x_resources); 262 realview_eth_register(NULL, realview_pb1176_smsc911x_resources);
263 platform_device_register(&realview_i2c_device);
263 264
264 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 265 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
265 struct amba_device *d = amba_devs[i]; 266 struct amba_device *d = amba_devs[i];
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 1c43494f5c42..565776680d8c 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -335,11 +335,25 @@ static struct resource versatile_i2c_resource = {
335 335
336static struct platform_device versatile_i2c_device = { 336static struct platform_device versatile_i2c_device = {
337 .name = "versatile-i2c", 337 .name = "versatile-i2c",
338 .id = -1, 338 .id = 0,
339 .num_resources = 1, 339 .num_resources = 1,
340 .resource = &versatile_i2c_resource, 340 .resource = &versatile_i2c_resource,
341}; 341};
342 342
343static struct i2c_board_info versatile_i2c_board_info[] = {
344 {
345 I2C_BOARD_INFO("rtc-ds1307", 0xd0 >> 1),
346 .type = "ds1338",
347 },
348};
349
350static int __init versatile_i2c_init(void)
351{
352 return i2c_register_board_info(0, versatile_i2c_board_info,
353 ARRAY_SIZE(versatile_i2c_board_info));
354}
355arch_initcall(versatile_i2c_init);
356
343#define VERSATILE_SYSMCI (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_MCI_OFFSET) 357#define VERSATILE_SYSMCI (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_MCI_OFFSET)
344 358
345unsigned int mmc_status(struct device *dev) 359unsigned int mmc_status(struct device *dev)