diff options
Diffstat (limited to 'arch/arm/mach-shmobile/board-ap4evb.c')
-rw-r--r-- | arch/arm/mach-shmobile/board-ap4evb.c | 91 |
1 files changed, 43 insertions, 48 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index 38f1259a0daf..45f78cadec1d 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/i2c.h> | 34 | #include <linux/i2c.h> |
35 | #include <linux/i2c/tsc2007.h> | 35 | #include <linux/i2c/tsc2007.h> |
36 | #include <linux/io.h> | 36 | #include <linux/io.h> |
37 | #include <linux/pinctrl/machine.h> | ||
37 | #include <linux/regulator/fixed.h> | 38 | #include <linux/regulator/fixed.h> |
38 | #include <linux/regulator/machine.h> | 39 | #include <linux/regulator/machine.h> |
39 | #include <linux/smsc911x.h> | 40 | #include <linux/smsc911x.h> |
@@ -273,11 +274,11 @@ static struct platform_device smc911x_device = { | |||
273 | 274 | ||
274 | /* | 275 | /* |
275 | * The card detect pin of the top SD/MMC slot (CN7) is active low and is | 276 | * The card detect pin of the top SD/MMC slot (CN7) is active low and is |
276 | * connected to GPIO A22 of SH7372 (GPIO_PORT41). | 277 | * connected to GPIO A22 of SH7372 (GPIO 41). |
277 | */ | 278 | */ |
278 | static int slot_cn7_get_cd(struct platform_device *pdev) | 279 | static int slot_cn7_get_cd(struct platform_device *pdev) |
279 | { | 280 | { |
280 | return !gpio_get_value(GPIO_PORT41); | 281 | return !gpio_get_value(41); |
281 | } | 282 | } |
282 | /* MERAM */ | 283 | /* MERAM */ |
283 | static struct sh_mobile_meram_info meram_info = { | 284 | static struct sh_mobile_meram_info meram_info = { |
@@ -838,22 +839,22 @@ static struct platform_device fsi_hdmi_device = { | |||
838 | static struct gpio_led ap4evb_leds[] = { | 839 | static struct gpio_led ap4evb_leds[] = { |
839 | { | 840 | { |
840 | .name = "led4", | 841 | .name = "led4", |
841 | .gpio = GPIO_PORT185, | 842 | .gpio = 185, |
842 | .default_state = LEDS_GPIO_DEFSTATE_ON, | 843 | .default_state = LEDS_GPIO_DEFSTATE_ON, |
843 | }, | 844 | }, |
844 | { | 845 | { |
845 | .name = "led2", | 846 | .name = "led2", |
846 | .gpio = GPIO_PORT186, | 847 | .gpio = 186, |
847 | .default_state = LEDS_GPIO_DEFSTATE_ON, | 848 | .default_state = LEDS_GPIO_DEFSTATE_ON, |
848 | }, | 849 | }, |
849 | { | 850 | { |
850 | .name = "led3", | 851 | .name = "led3", |
851 | .gpio = GPIO_PORT187, | 852 | .gpio = 187, |
852 | .default_state = LEDS_GPIO_DEFSTATE_ON, | 853 | .default_state = LEDS_GPIO_DEFSTATE_ON, |
853 | }, | 854 | }, |
854 | { | 855 | { |
855 | .name = "led1", | 856 | .name = "led1", |
856 | .gpio = GPIO_PORT188, | 857 | .gpio = 188, |
857 | .default_state = LEDS_GPIO_DEFSTATE_ON, | 858 | .default_state = LEDS_GPIO_DEFSTATE_ON, |
858 | } | 859 | } |
859 | }; | 860 | }; |
@@ -1026,10 +1027,10 @@ out: | |||
1026 | /* TouchScreen */ | 1027 | /* TouchScreen */ |
1027 | #ifdef CONFIG_AP4EVB_QHD | 1028 | #ifdef CONFIG_AP4EVB_QHD |
1028 | # define GPIO_TSC_IRQ GPIO_FN_IRQ28_123 | 1029 | # define GPIO_TSC_IRQ GPIO_FN_IRQ28_123 |
1029 | # define GPIO_TSC_PORT GPIO_PORT123 | 1030 | # define GPIO_TSC_PORT 123 |
1030 | #else /* WVGA */ | 1031 | #else /* WVGA */ |
1031 | # define GPIO_TSC_IRQ GPIO_FN_IRQ7_40 | 1032 | # define GPIO_TSC_IRQ GPIO_FN_IRQ7_40 |
1032 | # define GPIO_TSC_PORT GPIO_PORT40 | 1033 | # define GPIO_TSC_PORT 40 |
1033 | #endif | 1034 | #endif |
1034 | 1035 | ||
1035 | #define IRQ28 evt2irq(0x3380) /* IRQ28A */ | 1036 | #define IRQ28 evt2irq(0x3380) /* IRQ28A */ |
@@ -1084,6 +1085,28 @@ static struct i2c_board_info i2c1_devices[] = { | |||
1084 | }; | 1085 | }; |
1085 | 1086 | ||
1086 | 1087 | ||
1088 | static const struct pinctrl_map ap4evb_pinctrl_map[] = { | ||
1089 | /* MMCIF */ | ||
1090 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh7372", | ||
1091 | "mmc0_data8_0", "mmc0"), | ||
1092 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh7372", | ||
1093 | "mmc0_ctrl_0", "mmc0"), | ||
1094 | /* SDHI0 */ | ||
1095 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh7372", | ||
1096 | "sdhi0_data4", "sdhi0"), | ||
1097 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh7372", | ||
1098 | "sdhi0_ctrl", "sdhi0"), | ||
1099 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh7372", | ||
1100 | "sdhi0_cd", "sdhi0"), | ||
1101 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh7372", | ||
1102 | "sdhi0_wp", "sdhi0"), | ||
1103 | /* SDHI1 */ | ||
1104 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh7372", | ||
1105 | "sdhi1_data4", "sdhi1"), | ||
1106 | PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh7372", | ||
1107 | "sdhi1_ctrl", "sdhi1"), | ||
1108 | }; | ||
1109 | |||
1087 | #define GPIO_PORT9CR IOMEM(0xE6051009) | 1110 | #define GPIO_PORT9CR IOMEM(0xE6051009) |
1088 | #define GPIO_PORT10CR IOMEM(0xE605100A) | 1111 | #define GPIO_PORT10CR IOMEM(0xE605100A) |
1089 | #define USCCR1 IOMEM(0xE6058144) | 1112 | #define USCCR1 IOMEM(0xE6058144) |
@@ -1110,6 +1133,8 @@ static void __init ap4evb_init(void) | |||
1110 | /* External clock source */ | 1133 | /* External clock source */ |
1111 | clk_set_rate(&sh7372_dv_clki_clk, 27000000); | 1134 | clk_set_rate(&sh7372_dv_clki_clk, 27000000); |
1112 | 1135 | ||
1136 | pinctrl_register_mappings(ap4evb_pinctrl_map, | ||
1137 | ARRAY_SIZE(ap4evb_pinctrl_map)); | ||
1113 | sh7372_pinmux_init(); | 1138 | sh7372_pinmux_init(); |
1114 | 1139 | ||
1115 | /* enable SCIFA0 */ | 1140 | /* enable SCIFA0 */ |
@@ -1121,40 +1146,10 @@ static void __init ap4evb_init(void) | |||
1121 | gpio_request(GPIO_FN_IRQ6_39, NULL); | 1146 | gpio_request(GPIO_FN_IRQ6_39, NULL); |
1122 | 1147 | ||
1123 | /* enable Debug switch (S6) */ | 1148 | /* enable Debug switch (S6) */ |
1124 | gpio_request_one(GPIO_PORT32, GPIOF_IN | GPIOF_EXPORT, NULL); | 1149 | gpio_request_one(32, GPIOF_IN | GPIOF_EXPORT, NULL); |
1125 | gpio_request_one(GPIO_PORT33, GPIOF_IN | GPIOF_EXPORT, NULL); | 1150 | gpio_request_one(33, GPIOF_IN | GPIOF_EXPORT, NULL); |
1126 | gpio_request_one(GPIO_PORT34, GPIOF_IN | GPIOF_EXPORT, NULL); | 1151 | gpio_request_one(34, GPIOF_IN | GPIOF_EXPORT, NULL); |
1127 | gpio_request_one(GPIO_PORT35, GPIOF_IN | GPIOF_EXPORT, NULL); | 1152 | gpio_request_one(35, GPIOF_IN | GPIOF_EXPORT, NULL); |
1128 | |||
1129 | /* SDHI0 */ | ||
1130 | gpio_request(GPIO_FN_SDHICD0, NULL); | ||
1131 | gpio_request(GPIO_FN_SDHIWP0, NULL); | ||
1132 | gpio_request(GPIO_FN_SDHICMD0, NULL); | ||
1133 | gpio_request(GPIO_FN_SDHICLK0, NULL); | ||
1134 | gpio_request(GPIO_FN_SDHID0_3, NULL); | ||
1135 | gpio_request(GPIO_FN_SDHID0_2, NULL); | ||
1136 | gpio_request(GPIO_FN_SDHID0_1, NULL); | ||
1137 | gpio_request(GPIO_FN_SDHID0_0, NULL); | ||
1138 | |||
1139 | /* SDHI1 */ | ||
1140 | gpio_request(GPIO_FN_SDHICMD1, NULL); | ||
1141 | gpio_request(GPIO_FN_SDHICLK1, NULL); | ||
1142 | gpio_request(GPIO_FN_SDHID1_3, NULL); | ||
1143 | gpio_request(GPIO_FN_SDHID1_2, NULL); | ||
1144 | gpio_request(GPIO_FN_SDHID1_1, NULL); | ||
1145 | gpio_request(GPIO_FN_SDHID1_0, NULL); | ||
1146 | |||
1147 | /* MMCIF */ | ||
1148 | gpio_request(GPIO_FN_MMCD0_0, NULL); | ||
1149 | gpio_request(GPIO_FN_MMCD0_1, NULL); | ||
1150 | gpio_request(GPIO_FN_MMCD0_2, NULL); | ||
1151 | gpio_request(GPIO_FN_MMCD0_3, NULL); | ||
1152 | gpio_request(GPIO_FN_MMCD0_4, NULL); | ||
1153 | gpio_request(GPIO_FN_MMCD0_5, NULL); | ||
1154 | gpio_request(GPIO_FN_MMCD0_6, NULL); | ||
1155 | gpio_request(GPIO_FN_MMCD0_7, NULL); | ||
1156 | gpio_request(GPIO_FN_MMCCMD0, NULL); | ||
1157 | gpio_request(GPIO_FN_MMCCLK0, NULL); | ||
1158 | 1153 | ||
1159 | /* USB enable */ | 1154 | /* USB enable */ |
1160 | gpio_request(GPIO_FN_VBUS0_1, NULL); | 1155 | gpio_request(GPIO_FN_VBUS0_1, NULL); |
@@ -1172,15 +1167,15 @@ static void __init ap4evb_init(void) | |||
1172 | gpio_request(GPIO_FN_FSIAILR, NULL); | 1167 | gpio_request(GPIO_FN_FSIAILR, NULL); |
1173 | gpio_request(GPIO_FN_FSIAISLD, NULL); | 1168 | gpio_request(GPIO_FN_FSIAISLD, NULL); |
1174 | gpio_request(GPIO_FN_FSIAOSLD, NULL); | 1169 | gpio_request(GPIO_FN_FSIAOSLD, NULL); |
1175 | gpio_request_one(GPIO_PORT161, GPIOF_OUT_INIT_LOW, NULL); /* slave */ | 1170 | gpio_request_one(161, GPIOF_OUT_INIT_LOW, NULL); /* slave */ |
1176 | 1171 | ||
1177 | gpio_request(GPIO_PORT9, NULL); | 1172 | gpio_request(9, NULL); |
1178 | gpio_request(GPIO_PORT10, NULL); | 1173 | gpio_request(10, NULL); |
1179 | gpio_direction_none(GPIO_PORT9CR); /* FSIAOBT needs no direction */ | 1174 | gpio_direction_none(GPIO_PORT9CR); /* FSIAOBT needs no direction */ |
1180 | gpio_direction_none(GPIO_PORT10CR); /* FSIAOLR needs no direction */ | 1175 | gpio_direction_none(GPIO_PORT10CR); /* FSIAOLR needs no direction */ |
1181 | 1176 | ||
1182 | /* card detect pin for MMC slot (CN7) */ | 1177 | /* card detect pin for MMC slot (CN7) */ |
1183 | gpio_request_one(GPIO_PORT41, GPIOF_IN, NULL); | 1178 | gpio_request_one(41, GPIOF_IN, NULL); |
1184 | 1179 | ||
1185 | /* setup FSI2 port B (HDMI) */ | 1180 | /* setup FSI2 port B (HDMI) */ |
1186 | gpio_request(GPIO_FN_FSIBCK, NULL); | 1181 | gpio_request(GPIO_FN_FSIBCK, NULL); |
@@ -1268,8 +1263,8 @@ static void __init ap4evb_init(void) | |||
1268 | gpio_request(GPIO_FN_LCDDISP, NULL); | 1263 | gpio_request(GPIO_FN_LCDDISP, NULL); |
1269 | gpio_request(GPIO_FN_LCDDCK, NULL); | 1264 | gpio_request(GPIO_FN_LCDDCK, NULL); |
1270 | 1265 | ||
1271 | gpio_request_one(GPIO_PORT189, GPIOF_OUT_INIT_HIGH, NULL); /* backlight */ | 1266 | gpio_request_one(189, GPIOF_OUT_INIT_HIGH, NULL); /* backlight */ |
1272 | gpio_request_one(GPIO_PORT151, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */ | 1267 | gpio_request_one(151, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */ |
1273 | 1268 | ||
1274 | lcdc_info.clock_source = LCDC_CLK_BUS; | 1269 | lcdc_info.clock_source = LCDC_CLK_BUS; |
1275 | lcdc_info.ch[0].interface_type = RGB18; | 1270 | lcdc_info.ch[0].interface_type = RGB18; |