]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mmc: mmci: Drop support for pdata GPIO numbers
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 20 Sep 2018 23:01:10 +0000 (16:01 -0700)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 8 Oct 2018 09:40:43 +0000 (11:40 +0200)
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>
arch/arm/mach-integrator/integrator_cp.c
arch/arm/mach-versatile/versatile_dt.c
drivers/mmc/host/mmci.c
include/linux/amba/mmci.h

index 772a7cf2010e78a7f3c6aa32f3ae49fe263355a4..976ded5c591634dccf5d480fe30c108f6206c076 100644 (file)
@@ -80,8 +80,6 @@ static unsigned int mmc_status(struct device *dev)
 static struct mmci_platform_data mmc_data = {
        .ocr_mask       = MMC_VDD_32_33|MMC_VDD_33_34,
        .status         = mmc_status,
-       .gpio_wp        = -1,
-       .gpio_cd        = -1,
 };
 
 static u64 notrace intcp_read_sched_clock(void)
index 3c8d39c129094d3dbf3bbe26dac09e144c526ae0..e9d60687e416a24edc195d32030631e2a0a7c9fb 100644 (file)
@@ -89,15 +89,11 @@ unsigned int mmc_status(struct device *dev)
 static struct mmci_platform_data mmc0_plat_data = {
        .ocr_mask       = MMC_VDD_32_33|MMC_VDD_33_34,
        .status         = mmc_status,
-       .gpio_wp        = -1,
-       .gpio_cd        = -1,
 };
 
 static struct mmci_platform_data mmc1_plat_data = {
        .ocr_mask       = MMC_VDD_32_33|MMC_VDD_33_34,
        .status         = mmc_status,
-       .gpio_wp        = -1,
-       .gpio_cd        = -1,
 };
 
 /*
index 1841d250e9e2c67690d06e10f382e45857b6f6d9..4b843712dc0159ecf99b9fb8e908e33402bf7eb6 100644 (file)
@@ -28,8 +28,7 @@
 #include <linux/amba/bus.h>
 #include <linux/clk.h>
 #include <linux/scatterlist.h>
-#include <linux/gpio.h>
-#include <linux/of_gpio.h>
+#include <linux/of.h>
 #include <linux/regulator/consumer.h>
 #include <linux/dmaengine.h>
 #include <linux/dma-mapping.h>
@@ -1675,13 +1674,6 @@ static int mmci_probe(struct amba_device *dev,
        else if (plat->ocr_mask)
                dev_warn(mmc_dev(mmc), "Platform OCR mask is ignored\n");
 
-       /* DT takes precedence over platform data. */
-       if (!np) {
-               if (!plat->cd_invert)
-                       mmc->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
-               mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
-       }
-
        /* We support these capabilities. */
        mmc->caps |= MMC_CAP_CMD23;
 
@@ -1749,30 +1741,16 @@ static int mmci_probe(struct amba_device *dev,
         * - not using DT but using a descriptor table, or
         * - using a table of descriptors ALONGSIDE DT, or
         * look up these descriptors named "cd" and "wp" right here, fail
-        * silently of these do not exist and proceed to try platform data
+        * silently of these do not exist
         */
        if (!np) {
                ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0, NULL);
-               if (ret < 0) {
-                       if (ret == -EPROBE_DEFER)
-                               goto clk_disable;
-                       else if (gpio_is_valid(plat->gpio_cd)) {
-                               ret = mmc_gpio_request_cd(mmc, plat->gpio_cd, 0);
-                               if (ret)
-                                       goto clk_disable;
-                       }
-               }
+               if (ret == -EPROBE_DEFER)
+                       goto clk_disable;
 
                ret = mmc_gpiod_request_ro(mmc, "wp", 0, false, 0, NULL);
-               if (ret < 0) {
-                       if (ret == -EPROBE_DEFER)
-                               goto clk_disable;
-                       else if (gpio_is_valid(plat->gpio_wp)) {
-                               ret = mmc_gpio_request_ro(mmc, plat->gpio_wp);
-                               if (ret)
-                                       goto clk_disable;
-                       }
-               }
+               if (ret == -EPROBE_DEFER)
+                       goto clk_disable;
        }
 
        ret = devm_request_irq(&dev->dev, dev->irq[0], mmci_irq, IRQF_SHARED,
index da8357ba11bcb45b52a2c23d2e0aedb9c51096e0..c92ebc39fc1fdbc5aeba2dbcb099ed6da4714081 100644 (file)
  * mask into a value to be binary (or set some other custom bits
  * in MMCIPWR) or:ed and written into the MMCIPWR register of the
  * block.  May also control external power based on the power_mode.
- * @status: if no GPIO read function was given to the block in
- * gpio_wp (below) this function will be called to determine
- * whether a card is present in the MMC slot or not
- * @gpio_wp: read this GPIO pin to see if the card is write protected
- * @gpio_cd: read this GPIO pin to detect card insertion
- * @cd_invert: true if the gpio_cd pin value is active low
+ * @status: if no GPIO line was given to the block in this function will
+ * be called to determine whether a card is present in the MMC slot or not
  */
 struct mmci_platform_data {
        unsigned int ocr_mask;
        int (*ios_handler)(struct device *, struct mmc_ios *);
        unsigned int (*status)(struct device *);
-       int     gpio_wp;
-       int     gpio_cd;
-       bool    cd_invert;
 };
 
 #endif