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

mmc: pxamci: Delete platform data handling of CD and WP

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>

authored by

Linus Walleij and committed by
Ulf Hansson
80a68f38 e114cd33

-21
-19
drivers/mmc/host/pxamci.c
··· 730 730 } 731 731 732 732 if (host->pdata) { 733 - int gpio_cd = host->pdata->gpio_card_detect; 734 - int gpio_ro = host->pdata->gpio_card_ro; 735 733 int gpio_power = host->pdata->gpio_power; 736 734 737 735 host->detect_delay_ms = host->pdata->detect_delay_ms; ··· 753 755 dev_err(dev, "Failed requesting gpio_cd\n"); 754 756 goto out; 755 757 } 756 - if (ret == -ENOENT && gpio_is_valid(gpio_cd)) { 757 - ret = mmc_gpio_request_cd(mmc, gpio_cd, 0); 758 - if (ret) { 759 - dev_err(dev, "Failed requesting gpio_cd %d\n", 760 - gpio_cd); 761 - } 762 - } 763 758 764 759 ret = mmc_gpiod_request_ro(mmc, "wp", 0, false, 0, NULL); 765 760 if (ret && ret != -ENOENT) { 766 761 dev_err(dev, "Failed requesting gpio_ro\n"); 767 762 goto out; 768 - } 769 - /* Try platform data instead */ 770 - if (ret == -ENOENT && gpio_is_valid(gpio_ro)) { 771 - ret = mmc_gpio_request_ro(mmc, gpio_ro); 772 - if (ret) { 773 - dev_err(dev, 774 - "Failed requesting gpio_ro %d\n", 775 - gpio_ro); 776 - goto out; 777 - } 778 763 } 779 764 if (!ret) { 780 765 host->use_ro_gpio = true;
-2
include/linux/platform_data/mmc-pxamci.h
··· 15 15 int (*get_ro)(struct device *); 16 16 int (*setpower)(struct device *, unsigned int); 17 17 void (*exit)(struct device *, void *); 18 - int gpio_card_detect; /* gpio detecting card insertion */ 19 - int gpio_card_ro; /* gpio detecting read only toggle */ 20 18 bool gpio_card_ro_invert; /* gpio ro is inverted */ 21 19 int gpio_power; /* gpio powering up MMC bus */ 22 20 bool gpio_power_invert; /* gpio power is inverted */