Commit 4703e73c authored by Girish. S. G's avatar Girish. S. G Committed by Tony Lindgren

ARM: OMAP2: RTC board specific code: rebased

This patch adds rtc-twl4030 driver specific code.
Signed-off-by: default avatarGirish S G <girishsg@ti.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 7f8b2b0f
...@@ -1063,8 +1063,23 @@ CONFIG_MMC_BLOCK_BOUNCE=y ...@@ -1063,8 +1063,23 @@ CONFIG_MMC_BLOCK_BOUNCE=y
CONFIG_MMC_OMAP_HS=m CONFIG_MMC_OMAP_HS=m
# CONFIG_MMC_SPI is not set # CONFIG_MMC_SPI is not set
# CONFIG_NEW_LEDS is not set # CONFIG_NEW_LEDS is not set
#
# RTC interface
#
CONFIG_RTC_LIB=y CONFIG_RTC_LIB=y
# CONFIG_RTC_CLASS is not set CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
#
# I2C RTC driver
#
CONFIG_RTC_DRV_TWL4030=y
# CONFIG_UIO is not set # CONFIG_UIO is not set
# #
......
...@@ -40,9 +40,11 @@ ...@@ -40,9 +40,11 @@
#include <asm/arch/keypad.h> #include <asm/arch/keypad.h>
#include <asm/arch/dma.h> #include <asm/arch/dma.h>
#include <asm/arch/gpmc.h> #include <asm/arch/gpmc.h>
#include <linux/i2c/twl4030-rtc.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/delay.h> #include <asm/delay.h>
#include <asm/arch/control.h>
#include "sdram-qimonda-hyb18m512160af-6.h" #include "sdram-qimonda-hyb18m512160af-6.h"
...@@ -52,6 +54,8 @@ ...@@ -52,6 +54,8 @@
#define ENABLE_VAUX3_DEV_GRP 0x20 #define ENABLE_VAUX3_DEV_GRP 0x20
#define TWL4030_MSECURE_GPIO 22
static struct resource sdp3430_smc91x_resources[] = { static struct resource sdp3430_smc91x_resources[] = {
[0] = { [0] = {
.start = OMAP34XX_ETHR_START, .start = OMAP34XX_ETHR_START,
...@@ -124,6 +128,63 @@ static struct platform_device sdp3430_kp_device = { ...@@ -124,6 +128,63 @@ static struct platform_device sdp3430_kp_device = {
static int ts_gpio; static int ts_gpio;
#ifdef CONFIG_RTC_DRV_TWL4030
static int twl4030_rtc_init(void)
{
int ret = 0;
/* 3430ES2.0 doesn't have msecure/gpio-22 line connected to T2 */
if (is_device_type_gp() && is_sil_rev_less_than(OMAP3430_REV_ES2_0)) {
u32 msecure_pad_config_reg = omap_ctrl_base_get() + 0xA3C;
int mux_mask = 0x04;
u16 tmp;
ret = omap_request_gpio(TWL4030_MSECURE_GPIO);
if (ret < 0) {
printk(KERN_ERR "twl4030_rtc_init: can't"
"reserve GPIO:%d !\n", TWL4030_MSECURE_GPIO);
goto out;
}
/*
* TWL4030 will be in secure mode if msecure line from OMAP
* is low. Make msecure line high in order to change the
* TWL4030 RTC time and calender registers.
*/
omap_set_gpio_direction(TWL4030_MSECURE_GPIO, 0);
tmp = omap_readw(msecure_pad_config_reg);
tmp &= 0xF8; /* To enable mux mode 03/04 = GPIO_RTC */
tmp |= mux_mask;/* To enable mux mode 03/04 = GPIO_RTC */
omap_writew(tmp, msecure_pad_config_reg);
omap_set_gpio_dataout(TWL4030_MSECURE_GPIO, 1);
}
out:
return ret;
}
static void twl4030_rtc_exit(void)
{
if (is_device_type_gp() &&
is_sil_rev_less_than(OMAP3430_REV_ES2_0)) {
omap_free_gpio(TWL4030_MSECURE_GPIO);
}
}
static struct twl4030rtc_platform_data sdp3430_twl4030rtc_data = {
.init = &twl4030_rtc_init,
.exit = &twl4030_rtc_exit,
};
static struct platform_device sdp3430_twl4030rtc_device = {
.name = "twl4030_rtc",
.id = -1,
.dev = {
.platform_data = &sdp3430_twl4030rtc_data,
},
};
#endif
/** /**
* @brief ads7846_dev_init : Requests & sets GPIO line for pen-irq * @brief ads7846_dev_init : Requests & sets GPIO line for pen-irq
* *
...@@ -214,6 +275,9 @@ static struct platform_device *sdp3430_devices[] __initdata = { ...@@ -214,6 +275,9 @@ static struct platform_device *sdp3430_devices[] __initdata = {
&sdp3430_smc91x_device, &sdp3430_smc91x_device,
&sdp3430_kp_device, &sdp3430_kp_device,
&sdp3430_lcd_device, &sdp3430_lcd_device,
#ifdef CONFIG_RTC_DRV_TWL4030
&sdp3430_twl4030rtc_device,
#endif
}; };
static inline void __init sdp3430_init_smc91x(void) static inline void __init sdp3430_init_smc91x(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment