diff options
author | Alberto Panizzo <maramaopercheseimorto@gmail.com> | 2009-10-15 13:33:24 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-11-14 04:29:13 -0500 |
commit | 2097abcb8c5a1ccd8c126f6680df28ff6b6b96d0 (patch) | |
tree | 40beecbd55c84468aa42ae8bebd0b7851b8abb97 /arch/arm/mach-mx3/armadillo5x0.c | |
parent | e9a6c5d0c8c3f7f4d4ed5c5b1514327d58b76df3 (diff) |
Armadillo500 Add support for Seiko Instruments S-35390A rtc over i2c.
The RTC chip Seiko Instruments S-35390A is connected to the Application
Processor over the second bus i2c with the hard coded address 0x30.
Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx3/armadillo5x0.c')
-rw-r--r-- | arch/arm/mach-mx3/armadillo5x0.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/mach-mx3/armadillo5x0.c b/arch/arm/mach-mx3/armadillo5x0.c index fa973e40329e..54aab401dbdf 100644 --- a/arch/arm/mach-mx3/armadillo5x0.c +++ b/arch/arm/mach-mx3/armadillo5x0.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/io.h> | 35 | #include <linux/io.h> |
36 | #include <linux/input.h> | 36 | #include <linux/input.h> |
37 | #include <linux/gpio_keys.h> | 37 | #include <linux/gpio_keys.h> |
38 | #include <linux/i2c.h> | ||
38 | 39 | ||
39 | #include <mach/hardware.h> | 40 | #include <mach/hardware.h> |
40 | #include <asm/mach-types.h> | 41 | #include <asm/mach-types.h> |
@@ -104,6 +105,13 @@ static int armadillo5x0_pins[] = { | |||
104 | MX31_PIN_CSPI2_MISO__SDA, | 105 | MX31_PIN_CSPI2_MISO__SDA, |
105 | }; | 106 | }; |
106 | 107 | ||
108 | /* RTC over I2C*/ | ||
109 | #define ARMADILLO5X0_RTC_GPIO IOMUX_TO_GPIO(MX31_PIN_SRXD4) | ||
110 | |||
111 | static struct i2c_board_info armadillo5x0_i2c_rtc = { | ||
112 | I2C_BOARD_INFO("s35390a", 0x30), | ||
113 | }; | ||
114 | |||
107 | /* GPIO BUTTONS */ | 115 | /* GPIO BUTTONS */ |
108 | static struct gpio_keys_button armadillo5x0_buttons[] = { | 116 | static struct gpio_keys_button armadillo5x0_buttons[] = { |
109 | { | 117 | { |
@@ -373,6 +381,18 @@ static void __init armadillo5x0_init(void) | |||
373 | 381 | ||
374 | /* set NAND page size to 2k if not configured via boot mode pins */ | 382 | /* set NAND page size to 2k if not configured via boot mode pins */ |
375 | __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR); | 383 | __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR); |
384 | |||
385 | /* RTC */ | ||
386 | /* Get RTC IRQ and register the chip */ | ||
387 | if (gpio_request(ARMADILLO5X0_RTC_GPIO, "rtc") == 0) { | ||
388 | if (gpio_direction_input(ARMADILLO5X0_RTC_GPIO) == 0) | ||
389 | armadillo5x0_i2c_rtc.irq = gpio_to_irq(ARMADILLO5X0_RTC_GPIO); | ||
390 | else | ||
391 | gpio_free(ARMADILLO5X0_RTC_GPIO); | ||
392 | } | ||
393 | if (armadillo5x0_i2c_rtc.irq == 0) | ||
394 | pr_warning("armadillo5x0_init: failed to get RTC IRQ\n"); | ||
395 | i2c_register_board_info(1, &armadillo5x0_i2c_rtc, 1); | ||
376 | } | 396 | } |
377 | 397 | ||
378 | static void __init armadillo5x0_timer_init(void) | 398 | static void __init armadillo5x0_timer_init(void) |