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

mmc: mmci: Drop support for pdata GPIO numbers

All the machines using the MMCI are passing GPIOs for the
card detect and write protect using the device tree or
descriptor table (one single case, Integrator/AP IM-PD1).

Drop support for passing global GPIO numbers through
platform data, noone is using it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Linus Walleij and committed by
Ulf Hansson
9ef986a6 07be55b5

+8 -43
-2
arch/arm/mach-integrator/integrator_cp.c
··· 80 80 static struct mmci_platform_data mmc_data = { 81 81 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, 82 82 .status = mmc_status, 83 - .gpio_wp = -1, 84 - .gpio_cd = -1, 85 83 }; 86 84 87 85 static u64 notrace intcp_read_sched_clock(void)
-4
arch/arm/mach-versatile/versatile_dt.c
··· 89 89 static struct mmci_platform_data mmc0_plat_data = { 90 90 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, 91 91 .status = mmc_status, 92 - .gpio_wp = -1, 93 - .gpio_cd = -1, 94 92 }; 95 93 96 94 static struct mmci_platform_data mmc1_plat_data = { 97 95 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, 98 96 .status = mmc_status, 99 - .gpio_wp = -1, 100 - .gpio_cd = -1, 101 97 }; 102 98 103 99 /*
+6 -28
drivers/mmc/host/mmci.c
··· 28 28 #include <linux/amba/bus.h> 29 29 #include <linux/clk.h> 30 30 #include <linux/scatterlist.h> 31 - #include <linux/gpio.h> 32 - #include <linux/of_gpio.h> 31 + #include <linux/of.h> 33 32 #include <linux/regulator/consumer.h> 34 33 #include <linux/dmaengine.h> 35 34 #include <linux/dma-mapping.h> ··· 1674 1675 else if (plat->ocr_mask) 1675 1676 dev_warn(mmc_dev(mmc), "Platform OCR mask is ignored\n"); 1676 1677 1677 - /* DT takes precedence over platform data. */ 1678 - if (!np) { 1679 - if (!plat->cd_invert) 1680 - mmc->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH; 1681 - mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH; 1682 - } 1683 - 1684 1678 /* We support these capabilities. */ 1685 1679 mmc->caps |= MMC_CAP_CMD23; 1686 1680 ··· 1741 1749 * - not using DT but using a descriptor table, or 1742 1750 * - using a table of descriptors ALONGSIDE DT, or 1743 1751 * look up these descriptors named "cd" and "wp" right here, fail 1744 - * silently of these do not exist and proceed to try platform data 1752 + * silently of these do not exist 1745 1753 */ 1746 1754 if (!np) { 1747 1755 ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0, NULL); 1748 - if (ret < 0) { 1749 - if (ret == -EPROBE_DEFER) 1750 - goto clk_disable; 1751 - else if (gpio_is_valid(plat->gpio_cd)) { 1752 - ret = mmc_gpio_request_cd(mmc, plat->gpio_cd, 0); 1753 - if (ret) 1754 - goto clk_disable; 1755 - } 1756 - } 1756 + if (ret == -EPROBE_DEFER) 1757 + goto clk_disable; 1757 1758 1758 1759 ret = mmc_gpiod_request_ro(mmc, "wp", 0, false, 0, NULL); 1759 - if (ret < 0) { 1760 - if (ret == -EPROBE_DEFER) 1761 - goto clk_disable; 1762 - else if (gpio_is_valid(plat->gpio_wp)) { 1763 - ret = mmc_gpio_request_ro(mmc, plat->gpio_wp); 1764 - if (ret) 1765 - goto clk_disable; 1766 - } 1767 - } 1760 + if (ret == -EPROBE_DEFER) 1761 + goto clk_disable; 1768 1762 } 1769 1763 1770 1764 ret = devm_request_irq(&dev->dev, dev->irq[0], mmci_irq, IRQF_SHARED,
+2 -9
include/linux/amba/mmci.h
··· 18 18 * mask into a value to be binary (or set some other custom bits 19 19 * in MMCIPWR) or:ed and written into the MMCIPWR register of the 20 20 * block. May also control external power based on the power_mode. 21 - * @status: if no GPIO read function was given to the block in 22 - * gpio_wp (below) this function will be called to determine 23 - * whether a card is present in the MMC slot or not 24 - * @gpio_wp: read this GPIO pin to see if the card is write protected 25 - * @gpio_cd: read this GPIO pin to detect card insertion 26 - * @cd_invert: true if the gpio_cd pin value is active low 21 + * @status: if no GPIO line was given to the block in this function will 22 + * be called to determine whether a card is present in the MMC slot or not 27 23 */ 28 24 struct mmci_platform_data { 29 25 unsigned int ocr_mask; 30 26 int (*ios_handler)(struct device *, struct mmc_ios *); 31 27 unsigned int (*status)(struct device *); 32 - int gpio_wp; 33 - int gpio_cd; 34 - bool cd_invert; 35 28 }; 36 29 37 30 #endif