acrn-kernel/drivers/mmc/core
Martin Blumenstingl e3e4767bd5 mmc: core: don't override the CD GPIO level when "cd-inverted" is set
Since commit 89a5e15bcb ("gpio/mmc/of: Respect polarity in the device
tree") gpiolib-of parses the "cd-gpios" property and flips the polarity
if "cd-inverted" is also set. This results in the "cd-inverted" property
being evaluated twice, which effectively makes it a no-op:
- first in drivers/gpio/gpiolib-of.c (of_xlate_and_get_gpiod_flags) when
  setting up the CD GPIO
- then again in drivers/mmc/core/slot-gpio.c (mmc_gpio_get_cd) when
  reading the CD GPIO value at runtime

On boards which are using device-tree with the "cd-inverted" property
being set any inserted card are not detected anymore. This is due to the
MMC core treating the CD GPIO with the wrong polarity.

Disable "override_cd_active_level" for the card detection GPIO which is
parsed using mmc_of_parse. This fixes SD card detection on the boards
which are currently using the "cd-inverted" device-tree property (tested
on Meson8b Odroid-C1 and Meson8b EC-100).

This does not remove the CD GPIO inversion logic from the MMC core
because there's at least one driver (sdhci-pci-core for Intel BayTrail
based boards) which still passes "override_cd_active_level = true" to
mmc_gpiod_request_cd(). Due to lack of hardware for testing this is left
untouched.
In the future the GPIO inversion logic for both, card and read-only
detection can be removed once no driver is using it anymore.

Fixes: 89a5e15bcb ("gpio/mmc/of: Respect polarity in the device tree")
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Tested-by: Loys Ollivier <loys.ollivier@gmail.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-01-11 15:27:35 +01:00
..
Kconfig mmc: core: Allow building PWRSEQ_SD8787 with LIBERTAS_SDIO 2018-10-08 11:40:43 +02:00
Makefile
block.c MMC core: 2018-12-28 16:52:18 -08:00
block.h
bus.c
bus.h
card.h mmc: core: Cleanup BKOPS support 2018-12-17 09:01:15 +01:00
core.c mmc: core: Introduce MMC_CAP_SYNC_RUNTIME_PM 2018-12-17 08:26:24 +01:00
core.h mmc: core: remove obsolete mmc_set_blockcount() function 2018-12-17 08:26:24 +01:00
debugfs.c
host.c mmc: core: don't override the CD GPIO level when "cd-inverted" is set 2019-01-11 15:27:35 +01:00
host.h
mmc.c mmc: core: Cleanup BKOPS support 2018-12-17 09:01:15 +01:00
mmc_ops.c mmc: core: Cleanup BKOPS support 2018-12-17 09:01:15 +01:00
mmc_ops.h mmc: core: Cleanup BKOPS support 2018-12-17 09:01:15 +01:00
mmc_test.c mmc: convert to DEFINE_SHOW_ATTRIBUTE 2018-12-17 08:26:24 +01:00
pwrseq.c
pwrseq.h
pwrseq_emmc.c
pwrseq_sd8787.c
pwrseq_simple.c mmc: pwrseq_simple: Fix incorrect handling of GPIO bitmap 2018-10-15 16:26:00 +02:00
queue.c mmc: stop abusing the request queue_lock pointer 2018-11-17 07:20:45 -07:00
queue.h mmc: stop abusing the request queue_lock pointer 2018-11-17 07:20:45 -07:00
quirks.h mmc: core: sdio: Set SDIO clock of SDR104 to 150MHz for Marvell 8887 chip 2018-05-02 15:08:39 +02:00
sd.c mmc: core: Rename ->reset() bus ops to ->hw_reset() 2018-05-08 09:33:29 +02:00
sd.h
sd_ops.c
sd_ops.h
sdio.c mmc: core: Drop the unused mmc_power_save|restore_host() 2018-07-16 11:21:45 +02:00
sdio_bus.c mmc: sdio: Respect all error codes from dev_pm_domain_attach() 2018-05-14 22:58:45 +02:00
sdio_bus.h
sdio_cis.c
sdio_cis.h
sdio_io.c
sdio_irq.c
sdio_ops.c
sdio_ops.h
sdio_uart.c tty: replace ->proc_fops with ->proc_show 2018-05-16 07:24:30 +02:00
slot-gpio.c mmc: slot-gpio: Delete legacy GPIO handling 2018-12-17 08:26:24 +01:00
slot-gpio.h