aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2013-03-29 17:05:52 -0400
committerSimon Horman <horms+renesas@verge.net.au>2013-04-02 21:50:44 -0400
commit00ae962f8051bb143fa1c43c6a9c8274c3a9c593 (patch)
tree29713d76003fdfea5fa4d8b895acfee5a4b93624
parent757688c8b51073450b77940dcb94f33bf4c3de88 (diff)
ARM: shmobile: mackerel: clean up MMCIF vs. SDHI1 selection
MMCIF and SDHI1 share the same slot on mackerel. One of them is selected by a jumper, which cannot be queried from software. Currently in software one of the two interfaces is selected, depending whether or not the MMCIF driver is enabled. This is not optimal, since the kernel has to be rebuilt to switch from one interface to another. Still, so far there isn't a better option. At least make this selection consistent. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index b976ad682016..5b452e1e7d8a 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -999,7 +999,7 @@ static struct platform_device sdhi0_device = {
999 }, 999 },
1000}; 1000};
1001 1001
1002#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 1002#if !IS_ENABLED(CONFIG_MMC_SH_MMCIF)
1003/* SDHI1 */ 1003/* SDHI1 */
1004 1004
1005/* GPIO 41 can trigger IRQ8, but it is used by USBHS1, we have to poll */ 1005/* GPIO 41 can trigger IRQ8, but it is used by USBHS1, we have to poll */
@@ -1062,10 +1062,6 @@ static struct resource sdhi2_resources[] = {
1062 .end = 0xe68700ff, 1062 .end = 0xe68700ff,
1063 .flags = IORESOURCE_MEM, 1063 .flags = IORESOURCE_MEM,
1064 }, { 1064 }, {
1065 .name = SH_MOBILE_SDHI_IRQ_CARD_DETECT,
1066 .start = evt2irq(0x1200), /* SDHI2_SDHI2I0 */
1067 .flags = IORESOURCE_IRQ,
1068 }, {
1069 .name = SH_MOBILE_SDHI_IRQ_SDCARD, 1065 .name = SH_MOBILE_SDHI_IRQ_SDCARD,
1070 .start = evt2irq(0x1220), /* SDHI2_SDHI2I1 */ 1066 .start = evt2irq(0x1220), /* SDHI2_SDHI2I1 */
1071 .flags = IORESOURCE_IRQ, 1067 .flags = IORESOURCE_IRQ,
@@ -1087,6 +1083,7 @@ static struct platform_device sdhi2_device = {
1087}; 1083};
1088 1084
1089/* SH_MMCIF */ 1085/* SH_MMCIF */
1086#if IS_ENABLED(CONFIG_MMC_SH_MMCIF)
1090static struct resource sh_mmcif_resources[] = { 1087static struct resource sh_mmcif_resources[] = {
1091 [0] = { 1088 [0] = {
1092 .name = "MMCIF", 1089 .name = "MMCIF",
@@ -1118,7 +1115,7 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = {
1118 .slave_id_rx = SHDMA_SLAVE_MMCIF_RX, 1115 .slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
1119}; 1116};
1120 1117
1121static struct platform_device sh_mmcif_device __maybe_unused = { 1118static struct platform_device sh_mmcif_device = {
1122 .name = "sh_mmcif", 1119 .name = "sh_mmcif",
1123 .id = 0, 1120 .id = 0,
1124 .dev = { 1121 .dev = {
@@ -1129,7 +1126,7 @@ static struct platform_device sh_mmcif_device __maybe_unused = {
1129 .num_resources = ARRAY_SIZE(sh_mmcif_resources), 1126 .num_resources = ARRAY_SIZE(sh_mmcif_resources),
1130 .resource = sh_mmcif_resources, 1127 .resource = sh_mmcif_resources,
1131}; 1128};
1132 1129#endif
1133 1130
1134static int mackerel_camera_add(struct soc_camera_device *icd); 1131static int mackerel_camera_add(struct soc_camera_device *icd);
1135static void mackerel_camera_del(struct soc_camera_device *icd); 1132static void mackerel_camera_del(struct soc_camera_device *icd);
@@ -1236,11 +1233,12 @@ static struct platform_device *mackerel_devices[] __initdata = {
1236 &fsi_hdmi_device, 1233 &fsi_hdmi_device,
1237 &nand_flash_device, 1234 &nand_flash_device,
1238 &sdhi0_device, 1235 &sdhi0_device,
1239#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 1236#if !IS_ENABLED(CONFIG_MMC_SH_MMCIF)
1240 &sdhi1_device, 1237 &sdhi1_device,
1238#else
1239 &sh_mmcif_device,
1241#endif 1240#endif
1242 &sdhi2_device, 1241 &sdhi2_device,
1243 &sh_mmcif_device,
1244 &ceu_device, 1242 &ceu_device,
1245 &mackerel_camera, 1243 &mackerel_camera,
1246 &hdmi_device, 1244 &hdmi_device,
@@ -1305,11 +1303,6 @@ static struct i2c_board_info i2c1_devices[] = {
1305}; 1303};
1306 1304
1307static const struct pinctrl_map mackerel_pinctrl_map[] = { 1305static const struct pinctrl_map mackerel_pinctrl_map[] = {
1308 /* MMCIF */
1309 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh7372",
1310 "mmc0_data8_0", "mmc0"),
1311 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh7372",
1312 "mmc0_ctrl_0", "mmc0"),
1313 /* SDHI0 */ 1306 /* SDHI0 */
1314 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh7372", 1307 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh7372",
1315 "sdhi0_data4", "sdhi0"), 1308 "sdhi0_data4", "sdhi0"),
@@ -1318,11 +1311,17 @@ static const struct pinctrl_map mackerel_pinctrl_map[] = {
1318 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh7372", 1311 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh7372",
1319 "sdhi0_wp", "sdhi0"), 1312 "sdhi0_wp", "sdhi0"),
1320 /* SDHI1 */ 1313 /* SDHI1 */
1321#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 1314#if !IS_ENABLED(CONFIG_MMC_SH_MMCIF)
1322 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh7372", 1315 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh7372",
1323 "sdhi1_data4", "sdhi1"), 1316 "sdhi1_data4", "sdhi1"),
1324 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh7372", 1317 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh7372",
1325 "sdhi1_ctrl", "sdhi1"), 1318 "sdhi1_ctrl", "sdhi1"),
1319#else
1320 /* MMCIF */
1321 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh7372",
1322 "mmc0_data8_0", "mmc0"),
1323 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh7372",
1324 "mmc0_ctrl_0", "mmc0"),
1326#endif 1325#endif
1327 /* SDHI2 */ 1326 /* SDHI2 */
1328 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-sh7372", 1327 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-sh7372",
@@ -1347,10 +1346,11 @@ static void __init mackerel_init(void)
1347 { "A3SP", &usbhs0_device, }, 1346 { "A3SP", &usbhs0_device, },
1348 { "A3SP", &usbhs1_device, }, 1347 { "A3SP", &usbhs1_device, },
1349 { "A3SP", &nand_flash_device, }, 1348 { "A3SP", &nand_flash_device, },
1350 { "A3SP", &sh_mmcif_device, },
1351 { "A3SP", &sdhi0_device, }, 1349 { "A3SP", &sdhi0_device, },
1352#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 1350#if !IS_ENABLED(CONFIG_MMC_SH_MMCIF)
1353 { "A3SP", &sdhi1_device, }, 1351 { "A3SP", &sdhi1_device, },
1352#else
1353 { "A3SP", &sh_mmcif_device, },
1354#endif 1354#endif
1355 { "A3SP", &sdhi2_device, }, 1355 { "A3SP", &sdhi2_device, },
1356 { "A4R", &ceu_device, }, 1356 { "A4R", &ceu_device, },