aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>2012-09-13 01:10:10 -0400
committerSimon Horman <horms@verge.net.au>2012-09-13 02:02:25 -0400
commitb22f6bb030ee0c98839fe2445571c57c9f89594e (patch)
tree3fc93563d09576ee23aca26f65a6bc4f2e15cf94
parenteb8ca943bae2b84c3fc14dfd7a908cb334465fef (diff)
ARM: shmobile: armadillo800eva: Add support RTC
The armadillo800eva has S35390A which is RTC. This is controlled using I2C of GPIO. This commit supports RTC of armadillo800eva. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--arch/arm/configs/armadillo800eva_defconfig3
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c25
2 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/configs/armadillo800eva_defconfig b/arch/arm/configs/armadillo800eva_defconfig
index 7d8718468e0d..05f523d7d87f 100644
--- a/arch/arm/configs/armadillo800eva_defconfig
+++ b/arch/arm/configs/armadillo800eva_defconfig
@@ -85,6 +85,7 @@ CONFIG_SERIAL_SH_SCI_NR_UARTS=8
85CONFIG_SERIAL_SH_SCI_CONSOLE=y 85CONFIG_SERIAL_SH_SCI_CONSOLE=y
86# CONFIG_HW_RANDOM is not set 86# CONFIG_HW_RANDOM is not set
87CONFIG_I2C=y 87CONFIG_I2C=y
88CONFIG_I2C_GPIO=y
88CONFIG_I2C_SH_MOBILE=y 89CONFIG_I2C_SH_MOBILE=y
89# CONFIG_HWMON is not set 90# CONFIG_HWMON is not set
90CONFIG_MEDIA_SUPPORT=y 91CONFIG_MEDIA_SUPPORT=y
@@ -120,6 +121,8 @@ CONFIG_USB_ETH=m
120CONFIG_MMC=y 121CONFIG_MMC=y
121CONFIG_MMC_SDHI=y 122CONFIG_MMC_SDHI=y
122CONFIG_MMC_SH_MMCIF=y 123CONFIG_MMC_SH_MMCIF=y
124CONFIG_RTC_CLASS=y
125CONFIG_RTC_DRV_S35390A=y
123CONFIG_DMADEVICES=y 126CONFIG_DMADEVICES=y
124CONFIG_SH_DMAE=y 127CONFIG_SH_DMAE=y
125CONFIG_UIO=y 128CONFIG_UIO=y
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index cf10f92856dc..81dfb88ce813 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -37,6 +37,7 @@
37#include <linux/mmc/host.h> 37#include <linux/mmc/host.h>
38#include <linux/mmc/sh_mmcif.h> 38#include <linux/mmc/sh_mmcif.h>
39#include <linux/mmc/sh_mobile_sdhi.h> 39#include <linux/mmc/sh_mobile_sdhi.h>
40#include <linux/i2c-gpio.h>
40#include <mach/common.h> 41#include <mach/common.h>
41#include <mach/irqs.h> 42#include <mach/irqs.h>
42#include <mach/r8a7740.h> 43#include <mach/r8a7740.h>
@@ -876,6 +877,21 @@ static struct platform_device fsi_hdmi_device = {
876 }, 877 },
877}; 878};
878 879
880/* RTC: RTC connects i2c-gpio. */
881static struct i2c_gpio_platform_data i2c_gpio_data = {
882 .sda_pin = GPIO_PORT208,
883 .scl_pin = GPIO_PORT91,
884 .udelay = 5, /* 100 kHz */
885};
886
887static struct platform_device i2c_gpio_device = {
888 .name = "i2c-gpio",
889 .id = 2,
890 .dev = {
891 .platform_data = &i2c_gpio_data,
892 },
893};
894
879/* I2C */ 895/* I2C */
880static struct i2c_board_info i2c0_devices[] = { 896static struct i2c_board_info i2c0_devices[] = {
881 { 897 {
@@ -887,6 +903,13 @@ static struct i2c_board_info i2c0_devices[] = {
887 }, 903 },
888}; 904};
889 905
906static struct i2c_board_info i2c2_devices[] = {
907 {
908 I2C_BOARD_INFO("s35390a", 0x30),
909 .type = "s35390a",
910 },
911};
912
890/* 913/*
891 * board devices 914 * board devices
892 */ 915 */
@@ -903,6 +926,7 @@ static struct platform_device *eva_devices[] __initdata = {
903 &fsi_device, 926 &fsi_device,
904 &fsi_hdmi_device, 927 &fsi_hdmi_device,
905 &fsi_wm8978_device, 928 &fsi_wm8978_device,
929 &i2c_gpio_device,
906}; 930};
907 931
908static void __init eva_clock_init(void) 932static void __init eva_clock_init(void)
@@ -1173,6 +1197,7 @@ static void __init eva_init(void)
1173#endif 1197#endif
1174 1198
1175 i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices)); 1199 i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices));
1200 i2c_register_board_info(2, i2c2_devices, ARRAY_SIZE(i2c2_devices));
1176 1201
1177 r8a7740_add_standard_devices(); 1202 r8a7740_add_standard_devices();
1178 1203