]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap2/board-2430sdp.c
twl4030: improve rtc device setup
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / board-2430sdp.c
index 73df3269d081b3f1799ded83cb4957401bda211b..4a48adf333495e6a31b00f794218b6fa88828fb7 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/clk.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
-#include <linux/i2c/twl4030-rtc.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -191,13 +190,14 @@ static struct platform_device sdp2430_kp_device = {
        },
 };
 
-static int twl4030_rtc_init(void)
+static int __init msecure_init(void)
 {
        int ret = 0;
 
-       ret = omap_request_gpio(TWL4030_MSECURE_GPIO);
+#ifdef CONFIG_RTC_DRV_TWL4030
+       ret = gpio_request(TWL4030_MSECURE_GPIO, "msecure");
        if (ret < 0) {
-               printk(KERN_ERR "twl4030_rtc_init: can't reserve GPIO:%d !\n",
+               printk(KERN_ERR "msecure_init: can't reserve GPIO:%d !\n",
                        TWL4030_MSECURE_GPIO);
                goto out;
        }
@@ -206,36 +206,18 @@ static int twl4030_rtc_init(void)
         * Make msecure line high in order to change the TWL4030 RTC time
         * and calender registers.
         */
-       omap_set_gpio_direction(TWL4030_MSECURE_GPIO, 0);       /*dir out */
-       omap_set_gpio_dataout(TWL4030_MSECURE_GPIO, 1);
+       gpio_direction_output(TWL4030_MSECURE_GPIO, 1);
 out:
-       return ret;
-}
+#endif
 
-static void twl4030_rtc_exit(void)
-{
-       omap_free_gpio(TWL4030_MSECURE_GPIO);
+       return ret;
 }
 
-static struct twl4030rtc_platform_data sdp2430_twl4030rtc_data = {
-       .init = &twl4030_rtc_init,
-       .exit = &twl4030_rtc_exit,
-};
-
-static struct platform_device sdp2430_twl4030rtc_device = {
-       .name           = "twl4030_rtc",
-       .id             = -1,
-       .dev            = {
-               .platform_data  = &sdp2430_twl4030rtc_data,
-       },
-};
-
 static struct platform_device *sdp2430_devices[] __initdata = {
        &sdp2430_smc91x_device,
        &sdp2430_flash_device,
        &sdp2430_kp_device,
        &sdp2430_lcd_device,
-       &sdp2430_twl4030rtc_device,     
 };
 
 static void ads7846_dev_init(void)
@@ -391,6 +373,8 @@ static void __init omap_2430sdp_init(void)
        omap_board_config_size = ARRAY_SIZE(sdp2430_config);
        omap_serial_init();
 
+       msecure_init();
+
        sdp2430_flash_init();
        usb_musb_init();