diff options
-rw-r--r-- | arch/arm/mach-pxa/cm-x300.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c index 5295304731f6..cd39fa22ba2d 100644 --- a/arch/arm/mach-pxa/cm-x300.c +++ b/arch/arm/mach-pxa/cm-x300.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
22 | #include <linux/dm9000.h> | 22 | #include <linux/dm9000.h> |
23 | #include <linux/leds.h> | 23 | #include <linux/leds.h> |
24 | #include <linux/rtc-v3020.h> | ||
24 | 25 | ||
25 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
26 | #include <linux/i2c/pca953x.h> | 27 | #include <linux/i2c/pca953x.h> |
@@ -46,6 +47,11 @@ | |||
46 | 47 | ||
47 | #define CM_X300_MMC2_IRQ IRQ_GPIO(GPIO82_MMC2_IRQ) | 48 | #define CM_X300_MMC2_IRQ IRQ_GPIO(GPIO82_MMC2_IRQ) |
48 | 49 | ||
50 | #define GPIO95_RTC_CS (95) | ||
51 | #define GPIO96_RTC_WR (96) | ||
52 | #define GPIO97_RTC_RD (97) | ||
53 | #define GPIO98_RTC_IO (98) | ||
54 | |||
49 | static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = { | 55 | static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = { |
50 | /* LCD */ | 56 | /* LCD */ |
51 | GPIO54_LCD_LDD_0, | 57 | GPIO54_LCD_LDD_0, |
@@ -135,6 +141,12 @@ static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = { | |||
135 | GPIO85_GPIO, /* MMC WP */ | 141 | GPIO85_GPIO, /* MMC WP */ |
136 | GPIO99_GPIO, /* Ethernet IRQ */ | 142 | GPIO99_GPIO, /* Ethernet IRQ */ |
137 | 143 | ||
144 | /* RTC GPIOs */ | ||
145 | GPIO95_GPIO, /* RTC CS */ | ||
146 | GPIO96_GPIO, /* RTC WR */ | ||
147 | GPIO97_GPIO, /* RTC RD */ | ||
148 | GPIO98_GPIO, /* RTC IO */ | ||
149 | |||
138 | /* Standard I2C */ | 150 | /* Standard I2C */ |
139 | GPIO21_I2C_SCL, | 151 | GPIO21_I2C_SCL, |
140 | GPIO22_I2C_SDA, | 152 | GPIO22_I2C_SDA, |
@@ -442,6 +454,31 @@ static void __init cm_x300_init_i2c(void) | |||
442 | static inline void cm_x300_init_i2c(void) {} | 454 | static inline void cm_x300_init_i2c(void) {} |
443 | #endif | 455 | #endif |
444 | 456 | ||
457 | #if defined(CONFIG_RTC_DRV_V3020) || defined(CONFIG_RTC_DRV_V3020_MODULE) | ||
458 | struct v3020_platform_data cm_x300_v3020_pdata = { | ||
459 | .use_gpio = 1, | ||
460 | .gpio_cs = GPIO95_RTC_CS, | ||
461 | .gpio_wr = GPIO96_RTC_WR, | ||
462 | .gpio_rd = GPIO97_RTC_RD, | ||
463 | .gpio_io = GPIO98_RTC_IO, | ||
464 | }; | ||
465 | |||
466 | static struct platform_device cm_x300_rtc_device = { | ||
467 | .name = "v3020", | ||
468 | .id = -1, | ||
469 | .dev = { | ||
470 | .platform_data = &cm_x300_v3020_pdata, | ||
471 | } | ||
472 | }; | ||
473 | |||
474 | static void __init cm_x300_init_rtc(void) | ||
475 | { | ||
476 | platform_device_register(&cm_x300_rtc_device); | ||
477 | } | ||
478 | #else | ||
479 | static inline void cm_x300_init_rtc(void) {} | ||
480 | #endif | ||
481 | |||
445 | static void __init cm_x300_init(void) | 482 | static void __init cm_x300_init(void) |
446 | { | 483 | { |
447 | /* board-processor specific GPIO initialization */ | 484 | /* board-processor specific GPIO initialization */ |
@@ -454,6 +491,7 @@ static void __init cm_x300_init(void) | |||
454 | cm_x300_init_nand(); | 491 | cm_x300_init_nand(); |
455 | cm_x300_init_leds(); | 492 | cm_x300_init_leds(); |
456 | cm_x300_init_i2c(); | 493 | cm_x300_init_i2c(); |
494 | cm_x300_init_rtc(); | ||
457 | } | 495 | } |
458 | 496 | ||
459 | MACHINE_START(CM_X300, "CM-X300 module") | 497 | MACHINE_START(CM_X300, "CM-X300 module") |