Skip to content

Commit 9ef986a

Browse files
linuswstorulf
authored andcommitted
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>
1 parent 07be55b commit 9ef986a

File tree

4 files changed

+8
-43
lines changed

4 files changed

+8
-43
lines changed

arch/arm/mach-integrator/integrator_cp.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ static unsigned int mmc_status(struct device *dev)
8080
static struct mmci_platform_data mmc_data = {
8181
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
8282
.status = mmc_status,
83-
.gpio_wp = -1,
84-
.gpio_cd = -1,
8583
};
8684

8785
static u64 notrace intcp_read_sched_clock(void)

arch/arm/mach-versatile/versatile_dt.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,11 @@ unsigned int mmc_status(struct device *dev)
8989
static struct mmci_platform_data mmc0_plat_data = {
9090
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
9191
.status = mmc_status,
92-
.gpio_wp = -1,
93-
.gpio_cd = -1,
9492
};
9593

9694
static struct mmci_platform_data mmc1_plat_data = {
9795
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
9896
.status = mmc_status,
99-
.gpio_wp = -1,
100-
.gpio_cd = -1,
10197
};
10298

10399
/*

drivers/mmc/host/mmci.c

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
#include <linux/amba/bus.h>
2929
#include <linux/clk.h>
3030
#include <linux/scatterlist.h>
31-
#include <linux/gpio.h>
32-
#include <linux/of_gpio.h>
31+
#include <linux/of.h>
3332
#include <linux/regulator/consumer.h>
3433
#include <linux/dmaengine.h>
3534
#include <linux/dma-mapping.h>
@@ -1675,13 +1674,6 @@ static int mmci_probe(struct amba_device *dev,
16751674
else if (plat->ocr_mask)
16761675
dev_warn(mmc_dev(mmc), "Platform OCR mask is ignored\n");
16771676

1678-
/* DT takes precedence over platform data. */
1679-
if (!np) {
1680-
if (!plat->cd_invert)
1681-
mmc->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
1682-
mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
1683-
}
1684-
16851677
/* We support these capabilities. */
16861678
mmc->caps |= MMC_CAP_CMD23;
16871679

@@ -1749,30 +1741,16 @@ static int mmci_probe(struct amba_device *dev,
17491741
* - not using DT but using a descriptor table, or
17501742
* - using a table of descriptors ALONGSIDE DT, or
17511743
* look up these descriptors named "cd" and "wp" right here, fail
1752-
* silently of these do not exist and proceed to try platform data
1744+
* silently of these do not exist
17531745
*/
17541746
if (!np) {
17551747
ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0, NULL);
1756-
if (ret < 0) {
1757-
if (ret == -EPROBE_DEFER)
1758-
goto clk_disable;
1759-
else if (gpio_is_valid(plat->gpio_cd)) {
1760-
ret = mmc_gpio_request_cd(mmc, plat->gpio_cd, 0);
1761-
if (ret)
1762-
goto clk_disable;
1763-
}
1764-
}
1748+
if (ret == -EPROBE_DEFER)
1749+
goto clk_disable;
17651750

17661751
ret = mmc_gpiod_request_ro(mmc, "wp", 0, false, 0, NULL);
1767-
if (ret < 0) {
1768-
if (ret == -EPROBE_DEFER)
1769-
goto clk_disable;
1770-
else if (gpio_is_valid(plat->gpio_wp)) {
1771-
ret = mmc_gpio_request_ro(mmc, plat->gpio_wp);
1772-
if (ret)
1773-
goto clk_disable;
1774-
}
1775-
}
1752+
if (ret == -EPROBE_DEFER)
1753+
goto clk_disable;
17761754
}
17771755

17781756
ret = devm_request_irq(&dev->dev, dev->irq[0], mmci_irq, IRQF_SHARED,

include/linux/amba/mmci.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,13 @@
1818
* mask into a value to be binary (or set some other custom bits
1919
* in MMCIPWR) or:ed and written into the MMCIPWR register of the
2020
* 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
2723
*/
2824
struct mmci_platform_data {
2925
unsigned int ocr_mask;
3026
int (*ios_handler)(struct device *, struct mmc_ios *);
3127
unsigned int (*status)(struct device *);
32-
int gpio_wp;
33-
int gpio_cd;
34-
bool cd_invert;
3528
};
3629

3730
#endif

0 commit comments

Comments
 (0)