aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/board-armadillo800eva.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-04 15:32:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-04 15:32:41 -0400
commit22b154365fbc096a46d936ec1f462ef8b9bd1f05 (patch)
tree69459adc5424e1efc3c74ae3e96bfa44e00672c6 /arch/arm/mach-shmobile/board-armadillo800eva.c
parent6fa52ed33bea997374a88dbacbba5bf8c7ac4fef (diff)
parentcb3daf580a6bd798580d274a164e63a598d165c5 (diff)
Merge tag 'renesas-pinctrl-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC pinctrl changes for Renesas from Olof Johansson: "This is yet another driver change, which is split out just because of its size. As already in 3.9, a lot of changes are going on here, as the shmobile platform gets converted from its own pin control API to the generic drivers/pinctrl subsystem. Based on agreements with Paul Mundt, we are merging the sh-arch-side changes here as well" * tag 'renesas-pinctrl-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (142 commits) ARM: shmobile: r8a7779: Remove INTC function GPIOs ARM: shmobile: r8a7779: Remove LBSC function GPIOs ARM: shmobile: r8a7779: Remove USB function GPIOs ARM: shmobile: r8a7779: Remove HSPI function GPIOs ARM: shmobile: r8a7779: Remove SCIF function GPIOs ARM: shmobile: r8a7779: Remove SDHI and MMCIF function GPIOs ARM: shmobile: r8a7779: Remove DU function GPIOs ARM: shmobile: r8a7779: Remove DU1_DOTCLKOUT1 GPIO ARM: shmobile: r8a7740: Remove SDHI and MMCIF function GPIOs ARM: shmobile: r8a7740: Remove LCD0 and LCD1 function GPIOs ARM: shmobile: sh73a0: Remove IrDA function GPIOs ARM: shmobile: sh73a0: Remove USB function GPIOs ARM: shmobile: sh73a0: Remove BSC function GPIOs ARM: shmobile: sh73a0: Remove KEYSC function GPIOs ARM: shmobile: sh73a0: Remove pull-up function GPIOS ARM: shmobile: sh73a0: Remove FSI function GPIOs ARM: shmobile: sh73a0: Remove I2C function GPIOs ARM: shmobile: sh73a0: Remove SCIFA and SCIFB function GPIOs ARM: shmobile: sh73a0: Remove LCDC and LCDC2 function GPIOs ARM: shmobile: sh7372: Remove SDHI and MMCIF function GPIOs ...
Diffstat (limited to 'arch/arm/mach-shmobile/board-armadillo800eva.c')
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c158
1 files changed, 67 insertions, 91 deletions
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 881e5c0e41dd..80d5c2f5c09c 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -29,6 +29,7 @@
29#include <linux/platform_device.h> 29#include <linux/platform_device.h>
30#include <linux/gpio.h> 30#include <linux/gpio.h>
31#include <linux/gpio_keys.h> 31#include <linux/gpio_keys.h>
32#include <linux/pinctrl/machine.h>
32#include <linux/regulator/fixed.h> 33#include <linux/regulator/fixed.h>
33#include <linux/regulator/machine.h> 34#include <linux/regulator/machine.h>
34#include <linux/sh_eth.h> 35#include <linux/sh_eth.h>
@@ -230,7 +231,7 @@ static int usbhsf_power_ctrl(struct platform_device *pdev,
230 231
231static int usbhsf_get_vbus(struct platform_device *pdev) 232static int usbhsf_get_vbus(struct platform_device *pdev)
232{ 233{
233 return gpio_get_value(GPIO_PORT209); 234 return gpio_get_value(209);
234} 235}
235 236
236static irqreturn_t usbhsf_interrupt(int irq, void *data) 237static irqreturn_t usbhsf_interrupt(int irq, void *data)
@@ -540,10 +541,10 @@ static struct platform_device hdmi_lcdc_device = {
540 { .code = c, .gpio = g, .desc = d, .active_low = 1, __VA_ARGS__ } 541 { .code = c, .gpio = g, .desc = d, .active_low = 1, __VA_ARGS__ }
541 542
542static struct gpio_keys_button gpio_buttons[] = { 543static struct gpio_keys_button gpio_buttons[] = {
543 GPIO_KEY(KEY_POWER, GPIO_PORT99, "SW3", .wakeup = 1), 544 GPIO_KEY(KEY_POWER, 99, "SW3", .wakeup = 1),
544 GPIO_KEY(KEY_BACK, GPIO_PORT100, "SW4"), 545 GPIO_KEY(KEY_BACK, 100, "SW4"),
545 GPIO_KEY(KEY_MENU, GPIO_PORT97, "SW5"), 546 GPIO_KEY(KEY_MENU, 97, "SW5"),
546 GPIO_KEY(KEY_HOME, GPIO_PORT98, "SW6"), 547 GPIO_KEY(KEY_HOME, 98, "SW6"),
547}; 548};
548 549
549static struct gpio_keys_platform_data gpio_key_info = { 550static struct gpio_keys_platform_data gpio_key_info = {
@@ -661,6 +662,17 @@ static struct platform_device sdhi1_device = {
661 .resource = sdhi1_resources, 662 .resource = sdhi1_resources,
662}; 663};
663 664
665static const struct pinctrl_map eva_sdhi1_pinctrl_map[] = {
666 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a7740",
667 "sdhi1_data4", "sdhi1"),
668 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a7740",
669 "sdhi1_ctrl", "sdhi1"),
670 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a7740",
671 "sdhi1_cd", "sdhi1"),
672 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a7740",
673 "sdhi1_wp", "sdhi1"),
674};
675
664/* MMCIF */ 676/* MMCIF */
665static struct sh_mmcif_plat_data sh_mmcif_plat = { 677static struct sh_mmcif_plat_data sh_mmcif_plat = {
666 .sup_pclk = 0, 678 .sup_pclk = 0,
@@ -713,9 +725,9 @@ static int mt9t111_power(struct device *dev, int mode)
713 /* video1 (= CON1 camera) expect 24MHz */ 725 /* video1 (= CON1 camera) expect 24MHz */
714 clk_set_rate(mclk, clk_round_rate(mclk, 24000000)); 726 clk_set_rate(mclk, clk_round_rate(mclk, 24000000));
715 clk_enable(mclk); 727 clk_enable(mclk);
716 gpio_set_value(GPIO_PORT158, 1); 728 gpio_set_value(158, 1);
717 } else { 729 } else {
718 gpio_set_value(GPIO_PORT158, 0); 730 gpio_set_value(158, 0);
719 clk_disable(mclk); 731 clk_disable(mclk);
720 } 732 }
721 733
@@ -869,8 +881,8 @@ static struct platform_device fsi_hdmi_device = {
869 881
870/* RTC: RTC connects i2c-gpio. */ 882/* RTC: RTC connects i2c-gpio. */
871static struct i2c_gpio_platform_data i2c_gpio_data = { 883static struct i2c_gpio_platform_data i2c_gpio_data = {
872 .sda_pin = GPIO_PORT208, 884 .sda_pin = 208,
873 .scl_pin = GPIO_PORT91, 885 .scl_pin = 91,
874 .udelay = 5, /* 100 kHz */ 886 .udelay = 5, /* 100 kHz */
875}; 887};
876 888
@@ -924,6 +936,28 @@ static struct platform_device *eva_devices[] __initdata = {
924 &i2c_gpio_device, 936 &i2c_gpio_device,
925}; 937};
926 938
939static const struct pinctrl_map eva_pinctrl_map[] = {
940 /* LCD0 */
941 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_lcdc_fb.0", "pfc-r8a7740",
942 "lcd0_data24_0", "lcd0"),
943 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_lcdc_fb.0", "pfc-r8a7740",
944 "lcd0_lclk_1", "lcd0"),
945 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_lcdc_fb.0", "pfc-r8a7740",
946 "lcd0_sync", "lcd0"),
947 /* MMCIF */
948 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-r8a7740",
949 "mmc0_data8_1", "mmc0"),
950 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-r8a7740",
951 "mmc0_ctrl_1", "mmc0"),
952 /* SDHI0 */
953 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7740",
954 "sdhi0_data4", "sdhi0"),
955 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7740",
956 "sdhi0_ctrl", "sdhi0"),
957 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7740",
958 "sdhi0_wp", "sdhi0"),
959};
960
927static void __init eva_clock_init(void) 961static void __init eva_clock_init(void)
928{ 962{
929 struct clk *system = clk_get(NULL, "system_clk"); 963 struct clk *system = clk_get(NULL, "system_clk");
@@ -971,6 +1005,8 @@ static void __init eva_init(void)
971 regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers, 1005 regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
972 ARRAY_SIZE(fixed3v3_power_consumers), 3300000); 1006 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
973 1007
1008 pinctrl_register_mappings(eva_pinctrl_map, ARRAY_SIZE(eva_pinctrl_map));
1009
974 r8a7740_pinmux_init(); 1010 r8a7740_pinmux_init();
975 r8a7740_meram_workaround(); 1011 r8a7740_meram_workaround();
976 1012
@@ -980,38 +1016,9 @@ static void __init eva_init(void)
980 1016
981 /* LCDC0 */ 1017 /* LCDC0 */
982 gpio_request(GPIO_FN_LCDC0_SELECT, NULL); 1018 gpio_request(GPIO_FN_LCDC0_SELECT, NULL);
983 gpio_request(GPIO_FN_LCD0_D0, NULL); 1019
984 gpio_request(GPIO_FN_LCD0_D1, NULL); 1020 gpio_request_one(61, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
985 gpio_request(GPIO_FN_LCD0_D2, NULL); 1021 gpio_request_one(202, GPIOF_OUT_INIT_LOW, NULL); /* LCD0_LED_CONT */
986 gpio_request(GPIO_FN_LCD0_D3, NULL);
987 gpio_request(GPIO_FN_LCD0_D4, NULL);
988 gpio_request(GPIO_FN_LCD0_D5, NULL);
989 gpio_request(GPIO_FN_LCD0_D6, NULL);
990 gpio_request(GPIO_FN_LCD0_D7, NULL);
991 gpio_request(GPIO_FN_LCD0_D8, NULL);
992 gpio_request(GPIO_FN_LCD0_D9, NULL);
993 gpio_request(GPIO_FN_LCD0_D10, NULL);
994 gpio_request(GPIO_FN_LCD0_D11, NULL);
995 gpio_request(GPIO_FN_LCD0_D12, NULL);
996 gpio_request(GPIO_FN_LCD0_D13, NULL);
997 gpio_request(GPIO_FN_LCD0_D14, NULL);
998 gpio_request(GPIO_FN_LCD0_D15, NULL);
999 gpio_request(GPIO_FN_LCD0_D16, NULL);
1000 gpio_request(GPIO_FN_LCD0_D17, NULL);
1001 gpio_request(GPIO_FN_LCD0_D18_PORT40, NULL);
1002 gpio_request(GPIO_FN_LCD0_D19_PORT4, NULL);
1003 gpio_request(GPIO_FN_LCD0_D20_PORT3, NULL);
1004 gpio_request(GPIO_FN_LCD0_D21_PORT2, NULL);
1005 gpio_request(GPIO_FN_LCD0_D22_PORT0, NULL);
1006 gpio_request(GPIO_FN_LCD0_D23_PORT1, NULL);
1007 gpio_request(GPIO_FN_LCD0_DCK, NULL);
1008 gpio_request(GPIO_FN_LCD0_VSYN, NULL);
1009 gpio_request(GPIO_FN_LCD0_HSYN, NULL);
1010 gpio_request(GPIO_FN_LCD0_DISP, NULL);
1011 gpio_request(GPIO_FN_LCD0_LCLK_PORT165, NULL);
1012
1013 gpio_request_one(GPIO_PORT61, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
1014 gpio_request_one(GPIO_PORT202, GPIOF_OUT_INIT_LOW, NULL); /* LCD0_LED_CONT */
1015 1022
1016 /* Touchscreen */ 1023 /* Touchscreen */
1017 gpio_request(GPIO_FN_IRQ10, NULL); /* TP_INT */ 1024 gpio_request(GPIO_FN_IRQ10, NULL); /* TP_INT */
@@ -1037,12 +1044,12 @@ static void __init eva_init(void)
1037 gpio_request(GPIO_FN_ET_RX_DV, NULL); 1044 gpio_request(GPIO_FN_ET_RX_DV, NULL);
1038 gpio_request(GPIO_FN_ET_RX_CLK, NULL); 1045 gpio_request(GPIO_FN_ET_RX_CLK, NULL);
1039 1046
1040 gpio_request_one(GPIO_PORT18, GPIOF_OUT_INIT_HIGH, NULL); /* PHY_RST */ 1047 gpio_request_one(18, GPIOF_OUT_INIT_HIGH, NULL); /* PHY_RST */
1041 1048
1042 /* USB */ 1049 /* USB */
1043 gpio_request_one(GPIO_PORT159, GPIOF_IN, NULL); /* USB_DEVICE_MODE */ 1050 gpio_request_one(159, GPIOF_IN, NULL); /* USB_DEVICE_MODE */
1044 1051
1045 if (gpio_get_value(GPIO_PORT159)) { 1052 if (gpio_get_value(159)) {
1046 /* USB Host */ 1053 /* USB Host */
1047 } else { 1054 } else {
1048 /* USB Func */ 1055 /* USB Func */
@@ -1051,47 +1058,22 @@ static void __init eva_init(void)
1051 * OTOH, usbhs interrupt needs its value (HI/LOW) to decide 1058 * OTOH, usbhs interrupt needs its value (HI/LOW) to decide
1052 * USB connection/disconnection (usbhsf_get_vbus()). 1059 * USB connection/disconnection (usbhsf_get_vbus()).
1053 * This means we needs to select GPIO_FN_IRQ7_PORT209 first, 1060 * This means we needs to select GPIO_FN_IRQ7_PORT209 first,
1054 * and select GPIO_PORT209 here 1061 * and select GPIO 209 here
1055 */ 1062 */
1056 gpio_request(GPIO_FN_IRQ7_PORT209, NULL); 1063 gpio_request(GPIO_FN_IRQ7_PORT209, NULL);
1057 gpio_request_one(GPIO_PORT209, GPIOF_IN, NULL); 1064 gpio_request_one(209, GPIOF_IN, NULL);
1058 1065
1059 platform_device_register(&usbhsf_device); 1066 platform_device_register(&usbhsf_device);
1060 usb = &usbhsf_device; 1067 usb = &usbhsf_device;
1061 } 1068 }
1062 1069
1063 /* SDHI0 */ 1070 /* SDHI0 */
1064 gpio_request(GPIO_FN_SDHI0_CMD, NULL); 1071 gpio_request_one(17, GPIOF_OUT_INIT_LOW, NULL); /* SDHI0_18/33_B */
1065 gpio_request(GPIO_FN_SDHI0_CLK, NULL); 1072 gpio_request_one(74, GPIOF_OUT_INIT_HIGH, NULL); /* SDHI0_PON */
1066 gpio_request(GPIO_FN_SDHI0_D0, NULL); 1073 gpio_request_one(75, GPIOF_OUT_INIT_HIGH, NULL); /* SDSLOT1_PON */
1067 gpio_request(GPIO_FN_SDHI0_D1, NULL);
1068 gpio_request(GPIO_FN_SDHI0_D2, NULL);
1069 gpio_request(GPIO_FN_SDHI0_D3, NULL);
1070 gpio_request(GPIO_FN_SDHI0_WP, NULL);
1071
1072 gpio_request_one(GPIO_PORT17, GPIOF_OUT_INIT_LOW, NULL); /* SDHI0_18/33_B */
1073 gpio_request_one(GPIO_PORT74, GPIOF_OUT_INIT_HIGH, NULL); /* SDHI0_PON */
1074 gpio_request_one(GPIO_PORT75, GPIOF_OUT_INIT_HIGH, NULL); /* SDSLOT1_PON */
1075 1074
1076 /* we can use GPIO_FN_IRQ31_PORT167 here for SDHI0 CD irq */ 1075 /* we can use GPIO_FN_IRQ31_PORT167 here for SDHI0 CD irq */
1077 1076
1078 /*
1079 * MMCIF
1080 *
1081 * Here doesn't care SW1.4 status,
1082 * since CON2 is not mounted.
1083 */
1084 gpio_request(GPIO_FN_MMC1_CLK_PORT103, NULL);
1085 gpio_request(GPIO_FN_MMC1_CMD_PORT104, NULL);
1086 gpio_request(GPIO_FN_MMC1_D0_PORT149, NULL);
1087 gpio_request(GPIO_FN_MMC1_D1_PORT148, NULL);
1088 gpio_request(GPIO_FN_MMC1_D2_PORT147, NULL);
1089 gpio_request(GPIO_FN_MMC1_D3_PORT146, NULL);
1090 gpio_request(GPIO_FN_MMC1_D4_PORT145, NULL);
1091 gpio_request(GPIO_FN_MMC1_D5_PORT144, NULL);
1092 gpio_request(GPIO_FN_MMC1_D6_PORT143, NULL);
1093 gpio_request(GPIO_FN_MMC1_D7_PORT142, NULL);
1094
1095 /* CEU0 */ 1077 /* CEU0 */
1096 gpio_request(GPIO_FN_VIO0_D7, NULL); 1078 gpio_request(GPIO_FN_VIO0_D7, NULL);
1097 gpio_request(GPIO_FN_VIO0_D6, NULL); 1079 gpio_request(GPIO_FN_VIO0_D6, NULL);
@@ -1108,10 +1090,10 @@ static void __init eva_init(void)
1108 gpio_request(GPIO_FN_VIO_CKO, NULL); 1090 gpio_request(GPIO_FN_VIO_CKO, NULL);
1109 1091
1110 /* CON1/CON15 Camera */ 1092 /* CON1/CON15 Camera */
1111 gpio_request_one(GPIO_PORT173, GPIOF_OUT_INIT_LOW, NULL); /* STANDBY */ 1093 gpio_request_one(173, GPIOF_OUT_INIT_LOW, NULL); /* STANDBY */
1112 gpio_request_one(GPIO_PORT172, GPIOF_OUT_INIT_HIGH, NULL); /* RST */ 1094 gpio_request_one(172, GPIOF_OUT_INIT_HIGH, NULL); /* RST */
1113 /* see mt9t111_power() */ 1095 /* see mt9t111_power() */
1114 gpio_request_one(GPIO_PORT158, GPIOF_OUT_INIT_LOW, NULL); /* CAM_PON */ 1096 gpio_request_one(158, GPIOF_OUT_INIT_LOW, NULL); /* CAM_PON */
1115 1097
1116 /* FSI-WM8978 */ 1098 /* FSI-WM8978 */
1117 gpio_request(GPIO_FN_FSIAIBT, NULL); 1099 gpio_request(GPIO_FN_FSIAIBT, NULL);
@@ -1120,8 +1102,8 @@ static void __init eva_init(void)
1120 gpio_request(GPIO_FN_FSIAOSLD, NULL); 1102 gpio_request(GPIO_FN_FSIAOSLD, NULL);
1121 gpio_request(GPIO_FN_FSIAISLD_PORT5, NULL); 1103 gpio_request(GPIO_FN_FSIAISLD_PORT5, NULL);
1122 1104
1123 gpio_request(GPIO_PORT7, NULL); 1105 gpio_request(7, NULL);
1124 gpio_request(GPIO_PORT8, NULL); 1106 gpio_request(8, NULL);
1125 gpio_direction_none(GPIO_PORT7CR); /* FSIAOBT needs no direction */ 1107 gpio_direction_none(GPIO_PORT7CR); /* FSIAOBT needs no direction */
1126 gpio_direction_none(GPIO_PORT8CR); /* FSIAOLR needs no direction */ 1108 gpio_direction_none(GPIO_PORT8CR); /* FSIAOLR needs no direction */
1127 1109
@@ -1138,28 +1120,22 @@ static void __init eva_init(void)
1138 * DBGMD/LCDC0/FSIA MUX 1120 * DBGMD/LCDC0/FSIA MUX
1139 * DBGMD_SELECT_B should be set after setting PFC Function. 1121 * DBGMD_SELECT_B should be set after setting PFC Function.
1140 */ 1122 */
1141 gpio_request_one(GPIO_PORT176, GPIOF_OUT_INIT_HIGH, NULL); 1123 gpio_request_one(176, GPIOF_OUT_INIT_HIGH, NULL);
1142 1124
1143 /* 1125 /*
1144 * We can switch CON8/CON14 by SW1.5, 1126 * We can switch CON8/CON14 by SW1.5,
1145 * but it needs after DBGMD_SELECT_B 1127 * but it needs after DBGMD_SELECT_B
1146 */ 1128 */
1147 gpio_request_one(GPIO_PORT6, GPIOF_IN, NULL); 1129 gpio_request_one(6, GPIOF_IN, NULL);
1148 if (gpio_get_value(GPIO_PORT6)) { 1130 if (gpio_get_value(6)) {
1149 /* CON14 enable */ 1131 /* CON14 enable */
1150 } else { 1132 } else {
1151 /* CON8 (SDHI1) enable */ 1133 /* CON8 (SDHI1) enable */
1152 gpio_request(GPIO_FN_SDHI1_CLK, NULL); 1134 pinctrl_register_mappings(eva_sdhi1_pinctrl_map,
1153 gpio_request(GPIO_FN_SDHI1_CMD, NULL); 1135 ARRAY_SIZE(eva_sdhi1_pinctrl_map));
1154 gpio_request(GPIO_FN_SDHI1_D0, NULL);
1155 gpio_request(GPIO_FN_SDHI1_D1, NULL);
1156 gpio_request(GPIO_FN_SDHI1_D2, NULL);
1157 gpio_request(GPIO_FN_SDHI1_D3, NULL);
1158 gpio_request(GPIO_FN_SDHI1_CD, NULL);
1159 gpio_request(GPIO_FN_SDHI1_WP, NULL);
1160 1136
1161 /* SDSLOT2_PON */ 1137 /* SDSLOT2_PON */
1162 gpio_request_one(GPIO_PORT16, GPIOF_OUT_INIT_HIGH, NULL); 1138 gpio_request_one(16, GPIOF_OUT_INIT_HIGH, NULL);
1163 1139
1164 platform_device_register(&sdhi1_device); 1140 platform_device_register(&sdhi1_device);
1165 } 1141 }