Skip to content

Commit

Permalink
mmc: pxamci: Delete platform data handling of CD and WP
Browse files Browse the repository at this point in the history
This deletes the code dealing with handling card detect
and write protect passed in as platform data and makes
the host rely on just GPIO descriptors.

The card read only inversion flag has to be kept around
for now, as the core cannot handle the inversion flags
on the descriptors yet.

Since we can now rely on the descriptors to have the
right polarity, we set the "override_active_level" to
false in mmc_gpiod_request_cd() and mmc_gpiod_request_ro().

Cc: Daniel Mack <daniel@zonque.org>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Linus Walleij authored and Ulf Hansson committed Dec 17, 2018
1 parent e114cd3 commit 80a68f3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
19 changes: 0 additions & 19 deletions drivers/mmc/host/pxamci.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,6 @@ static int pxamci_probe(struct platform_device *pdev)
}

if (host->pdata) {
int gpio_cd = host->pdata->gpio_card_detect;
int gpio_ro = host->pdata->gpio_card_ro;
int gpio_power = host->pdata->gpio_power;

host->detect_delay_ms = host->pdata->detect_delay_ms;
Expand All @@ -755,29 +753,12 @@ static int pxamci_probe(struct platform_device *pdev)
dev_err(dev, "Failed requesting gpio_cd\n");
goto out;
}
if (ret == -ENOENT && gpio_is_valid(gpio_cd)) {
ret = mmc_gpio_request_cd(mmc, gpio_cd, 0);
if (ret) {
dev_err(dev, "Failed requesting gpio_cd %d\n",
gpio_cd);
}
}

ret = mmc_gpiod_request_ro(mmc, "wp", 0, false, 0, NULL);
if (ret && ret != -ENOENT) {
dev_err(dev, "Failed requesting gpio_ro\n");
goto out;
}
/* Try platform data instead */
if (ret == -ENOENT && gpio_is_valid(gpio_ro)) {
ret = mmc_gpio_request_ro(mmc, gpio_ro);
if (ret) {
dev_err(dev,
"Failed requesting gpio_ro %d\n",
gpio_ro);
goto out;
}
}
if (!ret) {
host->use_ro_gpio = true;
mmc->caps2 |= host->pdata->gpio_card_ro_invert ?
Expand Down
2 changes: 0 additions & 2 deletions include/linux/platform_data/mmc-pxamci.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ struct pxamci_platform_data {
int (*get_ro)(struct device *);
int (*setpower)(struct device *, unsigned int);
void (*exit)(struct device *, void *);
int gpio_card_detect; /* gpio detecting card insertion */
int gpio_card_ro; /* gpio detecting read only toggle */
bool gpio_card_ro_invert; /* gpio ro is inverted */
int gpio_power; /* gpio powering up MMC bus */
bool gpio_power_invert; /* gpio power is inverted */
Expand Down

0 comments on commit 80a68f3

Please sign in to comment.