aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-09-10 16:33:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-10 16:33:09 -0400
commitd0048f0b91ee35ab940ec6cbdfdd238c55b12a14 (patch)
tree72914692414729a14ec1308c326d92359a3825a3 /arch/sh/boards
parent7426d62871dafbeeed087d609c6469a515c88389 (diff)
parent9d731e7539713acc0ec7b67a5a91357c455d2334 (diff)
Merge tag 'mmc-updates-for-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
Pull MMC updates from Chris Ball: "MMC highlights for 3.12: Core: - Support Allocation Units 8MB-64MB in SD3.0, previous max was 4MB. - The slot-gpio helper can now handle GPIO debouncing card-detect. - Read supported voltages from DT "voltage-ranges" property. Drivers: - dw_mmc: Add support for ARC architecture, and support exynos5420. - mmc_spi: Support CD/RO GPIOs. - sh_mobile_sdhi: Add compatibility for more Renesas SoCs. - sh_mmcif: Add DT support for DMA channels" * tag 'mmc-updates-for-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (50 commits) Revert "mmc: tmio-mmc: Remove .set_pwr() callback from platform data" mmc: dw_mmc: Add support for ARC mmc: sdhci-s3c: initialize host->quirks2 for using quirks2 mmc: sdhci-s3c: fix the wrong register value, when clock is disabled mmc: esdhc: add support to get voltage from device-tree mmc: sdhci: get voltage from sdhc host mmc: core: parse voltage from device-tree mmc: omap_hsmmc: use the generic config for omap2plus devices mmc: omap_hsmmc: clear status flags before starting a new command mmc: dw_mmc: exynos: Add a new compatible string for exynos5420 mmc: sh_mmcif: revision-specific CLK_CTRL2 handling mmc: sh_mmcif: revision-specific Command Completion Signal handling mmc: sh_mmcif: add support for Device Tree DMA bindings mmc: sh_mmcif: move header include from header into .c mmc: SDHI: add DT compatibility strings for further SoCs mmc: dw_mmc-pci: enable bus-mastering mode mmc: dw_mmc-pci: get resources from a proper BAR mmc: tmio-mmc: Remove .set_pwr() callback from platform data mmc: tmio-mmc: Remove .get_cd() callback from platform data mmc: sh_mobile_sdhi: Remove .set_pwr() callback from platform data ...
Diffstat (limited to 'arch/sh/boards')
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c89
1 files changed, 8 insertions, 81 deletions
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 65dd81baa7f6..1fa8be409771 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -600,37 +600,13 @@ static struct platform_device sdhi0_power = {
600 }, 600 },
601}; 601};
602 602
603static void sdhi0_set_pwr(struct platform_device *pdev, int state)
604{
605 static int power_gpio = -EINVAL;
606
607 if (power_gpio < 0) {
608 int ret = gpio_request(GPIO_PTB6, NULL);
609 if (!ret) {
610 power_gpio = GPIO_PTB6;
611 gpio_direction_output(power_gpio, 0);
612 }
613 }
614
615 /*
616 * Toggle the GPIO regardless, whether we managed to grab it above or
617 * the fixed regulator driver did.
618 */
619 gpio_set_value(GPIO_PTB6, state);
620}
621
622static int sdhi0_get_cd(struct platform_device *pdev)
623{
624 return !gpio_get_value(GPIO_PTY7);
625}
626
627static struct sh_mobile_sdhi_info sdhi0_info = { 603static struct sh_mobile_sdhi_info sdhi0_info = {
628 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, 604 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
629 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, 605 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
630 .set_pwr = sdhi0_set_pwr,
631 .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD | 606 .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD |
632 MMC_CAP_NEEDS_POLL, 607 MMC_CAP_NEEDS_POLL,
633 .get_cd = sdhi0_get_cd, 608 .tmio_flags = TMIO_MMC_USE_GPIO_CD,
609 .cd_gpio = GPIO_PTY7,
634}; 610};
635 611
636static struct resource sdhi0_resources[] = { 612static struct resource sdhi0_resources[] = {
@@ -656,39 +632,15 @@ static struct platform_device sdhi0_device = {
656 }, 632 },
657}; 633};
658 634
659static void cn12_set_pwr(struct platform_device *pdev, int state)
660{
661 static int power_gpio = -EINVAL;
662
663 if (power_gpio < 0) {
664 int ret = gpio_request(GPIO_PTB7, NULL);
665 if (!ret) {
666 power_gpio = GPIO_PTB7;
667 gpio_direction_output(power_gpio, 0);
668 }
669 }
670
671 /*
672 * Toggle the GPIO regardless, whether we managed to grab it above or
673 * the fixed regulator driver did.
674 */
675 gpio_set_value(GPIO_PTB7, state);
676}
677
678#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 635#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
679/* SDHI1 */ 636/* SDHI1 */
680static int sdhi1_get_cd(struct platform_device *pdev)
681{
682 return !gpio_get_value(GPIO_PTW7);
683}
684
685static struct sh_mobile_sdhi_info sdhi1_info = { 637static struct sh_mobile_sdhi_info sdhi1_info = {
686 .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX, 638 .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX,
687 .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX, 639 .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX,
688 .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD | 640 .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD |
689 MMC_CAP_NEEDS_POLL, 641 MMC_CAP_NEEDS_POLL,
690 .set_pwr = cn12_set_pwr, 642 .tmio_flags = TMIO_MMC_USE_GPIO_CD,
691 .get_cd = sdhi1_get_cd, 643 .cd_gpio = GPIO_PTW7,
692}; 644};
693 645
694static struct resource sdhi1_resources[] = { 646static struct resource sdhi1_resources[] = {
@@ -718,27 +670,19 @@ static struct platform_device sdhi1_device = {
718#else 670#else
719 671
720/* MMC SPI */ 672/* MMC SPI */
721static int mmc_spi_get_ro(struct device *dev)
722{
723 return gpio_get_value(GPIO_PTY6);
724}
725
726static int mmc_spi_get_cd(struct device *dev)
727{
728 return !gpio_get_value(GPIO_PTY7);
729}
730
731static void mmc_spi_setpower(struct device *dev, unsigned int maskval) 673static void mmc_spi_setpower(struct device *dev, unsigned int maskval)
732{ 674{
733 gpio_set_value(GPIO_PTB6, maskval ? 1 : 0); 675 gpio_set_value(GPIO_PTB6, maskval ? 1 : 0);
734} 676}
735 677
736static struct mmc_spi_platform_data mmc_spi_info = { 678static struct mmc_spi_platform_data mmc_spi_info = {
737 .get_ro = mmc_spi_get_ro,
738 .get_cd = mmc_spi_get_cd,
739 .caps = MMC_CAP_NEEDS_POLL, 679 .caps = MMC_CAP_NEEDS_POLL,
680 .caps2 = MMC_CAP2_RO_ACTIVE_HIGH,
740 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, /* 3.3V only */ 681 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, /* 3.3V only */
741 .setpower = mmc_spi_setpower, 682 .setpower = mmc_spi_setpower,
683 .flags = MMC_SPI_USE_CD_GPIO | MMC_SPI_USE_RO_GPIO,
684 .cd_gpio = GPIO_PTY7,
685 .ro_gpio = GPIO_PTY6,
742}; 686};
743 687
744static struct spi_board_info spi_bus[] = { 688static struct spi_board_info spi_bus[] = {
@@ -998,11 +942,6 @@ static struct platform_device vou_device = {
998 942
999#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE) 943#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
1000/* SH_MMCIF */ 944/* SH_MMCIF */
1001static void mmcif_down_pwr(struct platform_device *pdev)
1002{
1003 cn12_set_pwr(pdev, 0);
1004}
1005
1006static struct resource sh_mmcif_resources[] = { 945static struct resource sh_mmcif_resources[] = {
1007 [0] = { 946 [0] = {
1008 .name = "SH_MMCIF", 947 .name = "SH_MMCIF",
@@ -1023,8 +962,6 @@ static struct resource sh_mmcif_resources[] = {
1023}; 962};
1024 963
1025static struct sh_mmcif_plat_data sh_mmcif_plat = { 964static struct sh_mmcif_plat_data sh_mmcif_plat = {
1026 .set_pwr = cn12_set_pwr,
1027 .down_pwr = mmcif_down_pwr,
1028 .sup_pclk = 0, /* SH7724: Max Pclk/2 */ 965 .sup_pclk = 0, /* SH7724: Max Pclk/2 */
1029 .caps = MMC_CAP_4_BIT_DATA | 966 .caps = MMC_CAP_4_BIT_DATA |
1030 MMC_CAP_8_BIT_DATA | 967 MMC_CAP_8_BIT_DATA |
@@ -1341,10 +1278,6 @@ static int __init arch_setup(void)
1341 gpio_direction_input(GPIO_PTR6); 1278 gpio_direction_input(GPIO_PTR6);
1342 1279
1343 /* SD-card slot CN11 */ 1280 /* SD-card slot CN11 */
1344 /* Card-detect, used on CN11, either with SDHI0 or with SPI */
1345 gpio_request(GPIO_PTY7, NULL);
1346 gpio_direction_input(GPIO_PTY7);
1347
1348#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) 1281#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
1349 /* enable SDHI0 on CN11 (needs DS2.4 set to ON) */ 1282 /* enable SDHI0 on CN11 (needs DS2.4 set to ON) */
1350 gpio_request(GPIO_FN_SDHI0WP, NULL); 1283 gpio_request(GPIO_FN_SDHI0WP, NULL);
@@ -1363,8 +1296,6 @@ static int __init arch_setup(void)
1363 gpio_direction_output(GPIO_PTM4, 1); /* active low CS */ 1296 gpio_direction_output(GPIO_PTM4, 1); /* active low CS */
1364 gpio_request(GPIO_PTB6, NULL); /* 3.3V power control */ 1297 gpio_request(GPIO_PTB6, NULL); /* 3.3V power control */
1365 gpio_direction_output(GPIO_PTB6, 0); /* disable power by default */ 1298 gpio_direction_output(GPIO_PTB6, 0); /* disable power by default */
1366 gpio_request(GPIO_PTY6, NULL); /* write protect */
1367 gpio_direction_input(GPIO_PTY6);
1368 1299
1369 spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus)); 1300 spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus));
1370#endif 1301#endif
@@ -1394,10 +1325,6 @@ static int __init arch_setup(void)
1394 gpio_request(GPIO_FN_SDHI1D1, NULL); 1325 gpio_request(GPIO_FN_SDHI1D1, NULL);
1395 gpio_request(GPIO_FN_SDHI1D0, NULL); 1326 gpio_request(GPIO_FN_SDHI1D0, NULL);
1396 1327
1397 /* Card-detect, used on CN12 with SDHI1 */
1398 gpio_request(GPIO_PTW7, NULL);
1399 gpio_direction_input(GPIO_PTW7);
1400
1401 cn12_enabled = true; 1328 cn12_enabled = true;
1402#endif 1329#endif
1403 1330