Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: sdhci: convert sdhci_set_uhs_signaling() into a library function

Add sdhci_set_uhs_signaling() and always call the set_uhs_signaling
method. This avoids quirks being added into sdhci_set_uhs_signaling().

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Tested-by: Markus Pargmann <mpa@pengutronix.de>
Tested-by: Stephen Warren <swarren@nvidia.com>
[Ulf Hansson] Resolved conflict
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>

authored by

Russell King and committed by
Chris Ball
96d7b78c 13e64501

+42 -20
+2
drivers/mmc/host/sdhci-acpi.c
··· 106 106 .enable_dma = sdhci_acpi_enable_dma, 107 107 .set_bus_width = sdhci_set_bus_width, 108 108 .reset = sdhci_reset, 109 + .set_uhs_signaling = sdhci_set_uhs_signaling, 109 110 }; 110 111 111 112 static const struct sdhci_ops sdhci_acpi_ops_int = { ··· 114 113 .enable_dma = sdhci_acpi_enable_dma, 115 114 .set_bus_width = sdhci_set_bus_width, 116 115 .reset = sdhci_reset, 116 + .set_uhs_signaling = sdhci_set_uhs_signaling, 117 117 .hw_reset = sdhci_acpi_int_hw_reset, 118 118 }; 119 119
+1
drivers/mmc/host/sdhci-bcm-kona.c
··· 212 212 .platform_send_init_74_clocks = sdhci_bcm_kona_init_74_clocks, 213 213 .set_bus_width = sdhci_set_bus_width, 214 214 .reset = sdhci_reset, 215 + .set_uhs_signaling = sdhci_set_uhs_signaling, 215 216 .card_event = sdhci_bcm_kona_card_event, 216 217 }; 217 218
+1
drivers/mmc/host/sdhci-bcm2835.c
··· 136 136 .get_min_clock = bcm2835_sdhci_get_min_clock, 137 137 .set_bus_width = sdhci_set_bus_width, 138 138 .reset = sdhci_reset, 139 + .set_uhs_signaling = sdhci_set_uhs_signaling, 139 140 }; 140 141 141 142 static const struct sdhci_pltfm_data bcm2835_sdhci_pdata = {
+1
drivers/mmc/host/sdhci-cns3xxx.c
··· 81 81 .set_clock = sdhci_cns3xxx_set_clock, 82 82 .set_bus_width = sdhci_set_bus_width, 83 83 .reset = sdhci_reset, 84 + .set_uhs_signaling = sdhci_set_uhs_signaling, 84 85 }; 85 86 86 87 static const struct sdhci_pltfm_data sdhci_cns3xxx_pdata = {
+1
drivers/mmc/host/sdhci-dove.c
··· 89 89 .set_clock = sdhci_set_clock, 90 90 .set_bus_width = sdhci_set_bus_width, 91 91 .reset = sdhci_reset, 92 + .set_uhs_signaling = sdhci_set_uhs_signaling, 92 93 }; 93 94 94 95 static const struct sdhci_pltfm_data sdhci_dove_pdata = {
+1
drivers/mmc/host/sdhci-of-arasan.c
··· 57 57 .get_timeout_clock = sdhci_arasan_get_timeout_clock, 58 58 .set_bus_width = sdhci_set_bus_width, 59 59 .reset = sdhci_reset, 60 + .set_uhs_signaling = sdhci_set_uhs_signaling, 60 61 }; 61 62 62 63 static struct sdhci_pltfm_data sdhci_arasan_pdata = {
+1
drivers/mmc/host/sdhci-of-esdhc.c
··· 309 309 .adma_workaround = esdhci_of_adma_workaround, 310 310 .set_bus_width = esdhc_pltfm_set_bus_width, 311 311 .reset = sdhci_reset, 312 + .set_uhs_signaling = sdhci_set_uhs_signaling, 312 313 }; 313 314 314 315 static const struct sdhci_pltfm_data sdhci_esdhc_pdata = {
+1
drivers/mmc/host/sdhci-of-hlwd.c
··· 61 61 .set_clock = sdhci_set_clock, 62 62 .set_bus_width = sdhci_set_bus_width, 63 63 .reset = sdhci_reset, 64 + .set_uhs_signaling = sdhci_set_uhs_signaling, 64 65 }; 65 66 66 67 static const struct sdhci_pltfm_data sdhci_hlwd_pdata = {
+1
drivers/mmc/host/sdhci-pci.c
··· 1082 1082 .enable_dma = sdhci_pci_enable_dma, 1083 1083 .set_bus_width = sdhci_pci_set_bus_width, 1084 1084 .reset = sdhci_reset, 1085 + .set_uhs_signaling = sdhci_set_uhs_signaling, 1085 1086 .hw_reset = sdhci_pci_hw_reset, 1086 1087 }; 1087 1088
+1
drivers/mmc/host/sdhci-pltfm.c
··· 48 48 .set_clock = sdhci_set_clock, 49 49 .set_bus_width = sdhci_set_bus_width, 50 50 .reset = sdhci_reset, 51 + .set_uhs_signaling = sdhci_set_uhs_signaling, 51 52 }; 52 53 53 54 #ifdef CONFIG_OF
+1
drivers/mmc/host/sdhci-pxav2.c
··· 116 116 .get_max_clock = sdhci_pltfm_clk_get_max_clock, 117 117 .set_bus_width = pxav2_mmc_set_bus_width, 118 118 .reset = pxav2_reset, 119 + .set_uhs_signaling = sdhci_set_uhs_signaling, 119 120 }; 120 121 121 122 #ifdef CONFIG_OF
+1
drivers/mmc/host/sdhci-pxav3.c
··· 229 229 .get_max_clock = sdhci_pltfm_clk_get_max_clock, 230 230 .set_bus_width = sdhci_set_bus_width, 231 231 .reset = pxav3_reset, 232 + .set_uhs_signaling = sdhci_set_uhs_signaling, 232 233 }; 233 234 234 235 static struct sdhci_pltfm_data sdhci_pxav3_pdata = {
+1
drivers/mmc/host/sdhci-s3c.c
··· 371 371 .get_min_clock = sdhci_s3c_get_min_clock, 372 372 .set_bus_width = sdhci_s3c_set_bus_width, 373 373 .reset = sdhci_reset, 374 + .set_uhs_signaling = sdhci_set_uhs_signaling, 374 375 }; 375 376 376 377 static void sdhci_s3c_notify_change(struct platform_device *dev, int state)
+1
drivers/mmc/host/sdhci-sirf.c
··· 32 32 .get_max_clock = sdhci_sirf_get_max_clk, 33 33 .set_bus_width = sdhci_set_bus_width, 34 34 .reset = sdhci_reset, 35 + .set_uhs_signaling = sdhci_set_uhs_signaling, 35 36 }; 36 37 37 38 static struct sdhci_pltfm_data sdhci_sirf_pdata = {
+1
drivers/mmc/host/sdhci-spear.c
··· 41 41 .set_clock = sdhci_set_clock, 42 42 .set_bus_width = sdhci_set_bus_width, 43 43 .reset = sdhci_reset, 44 + .set_uhs_signaling = sdhci_set_uhs_signaling, 44 45 }; 45 46 46 47 #ifdef CONFIG_OF
+1
drivers/mmc/host/sdhci-tegra.c
··· 156 156 .set_clock = sdhci_set_clock, 157 157 .set_bus_width = tegra_sdhci_set_bus_width, 158 158 .reset = tegra_sdhci_reset, 159 + .set_uhs_signaling = sdhci_set_uhs_signaling, 159 160 }; 160 161 161 162 static const struct sdhci_pltfm_data sdhci_tegra20_pdata = {
+24 -20
drivers/mmc/host/sdhci.c
··· 1404 1404 } 1405 1405 EXPORT_SYMBOL_GPL(sdhci_set_bus_width); 1406 1406 1407 + void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing) 1408 + { 1409 + u16 ctrl_2; 1410 + 1411 + ctrl_2 = sdhci_readw(host, SDHCI_HOST_CONTROL2); 1412 + /* Select Bus Speed Mode for host */ 1413 + ctrl_2 &= ~SDHCI_CTRL_UHS_MASK; 1414 + if ((timing == MMC_TIMING_MMC_HS200) || 1415 + (timing == MMC_TIMING_UHS_SDR104)) 1416 + ctrl_2 |= SDHCI_CTRL_UHS_SDR104; 1417 + else if (timing == MMC_TIMING_UHS_SDR12) 1418 + ctrl_2 |= SDHCI_CTRL_UHS_SDR12; 1419 + else if (timing == MMC_TIMING_UHS_SDR25) 1420 + ctrl_2 |= SDHCI_CTRL_UHS_SDR25; 1421 + else if (timing == MMC_TIMING_UHS_SDR50) 1422 + ctrl_2 |= SDHCI_CTRL_UHS_SDR50; 1423 + else if ((timing == MMC_TIMING_UHS_DDR50) || 1424 + (timing == MMC_TIMING_MMC_DDR52)) 1425 + ctrl_2 |= SDHCI_CTRL_UHS_DDR50; 1426 + sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2); 1427 + } 1428 + EXPORT_SYMBOL_GPL(sdhci_set_uhs_signaling); 1429 + 1407 1430 static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) 1408 1431 { 1409 1432 unsigned long flags; ··· 1537 1514 clk &= ~SDHCI_CLOCK_CARD_EN; 1538 1515 sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); 1539 1516 1540 - if (host->ops->set_uhs_signaling) 1541 - host->ops->set_uhs_signaling(host, ios->timing); 1542 - else { 1543 - ctrl_2 = sdhci_readw(host, SDHCI_HOST_CONTROL2); 1544 - /* Select Bus Speed Mode for host */ 1545 - ctrl_2 &= ~SDHCI_CTRL_UHS_MASK; 1546 - if ((ios->timing == MMC_TIMING_MMC_HS200) || 1547 - (ios->timing == MMC_TIMING_UHS_SDR104)) 1548 - ctrl_2 |= SDHCI_CTRL_UHS_SDR104; 1549 - else if (ios->timing == MMC_TIMING_UHS_SDR12) 1550 - ctrl_2 |= SDHCI_CTRL_UHS_SDR12; 1551 - else if (ios->timing == MMC_TIMING_UHS_SDR25) 1552 - ctrl_2 |= SDHCI_CTRL_UHS_SDR25; 1553 - else if (ios->timing == MMC_TIMING_UHS_SDR50) 1554 - ctrl_2 |= SDHCI_CTRL_UHS_SDR50; 1555 - else if ((ios->timing == MMC_TIMING_UHS_DDR50) || 1556 - (ios->timing == MMC_TIMING_MMC_DDR52)) 1557 - ctrl_2 |= SDHCI_CTRL_UHS_DDR50; 1558 - sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2); 1559 - } 1517 + host->ops->set_uhs_signaling(host, ios->timing); 1560 1518 1561 1519 if (!(host->quirks2 & SDHCI_QUIRK2_PRESET_VALUE_BROKEN) && 1562 1520 ((ios->timing == MMC_TIMING_UHS_SDR12) ||
+1
drivers/mmc/host/sdhci.h
··· 403 403 void sdhci_set_clock(struct sdhci_host *host, unsigned int clock); 404 404 void sdhci_set_bus_width(struct sdhci_host *host, int width); 405 405 void sdhci_reset(struct sdhci_host *host, u8 mask); 406 + void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing); 406 407 407 408 #ifdef CONFIG_PM 408 409 extern int sdhci_suspend_host(struct sdhci_host *host);