From: Henrik Grimler Date: Sun, 20 Jul 2025 17:00:26 +0000 (+0200) Subject: mmc: s5p_sdhci: remove duplicated card detect code X-Git-Tag: v2025.10-rc1~20^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4381d7bb3327938373dafe6b96cb98fbc5c26a49;p=thirdparty%2Fu-boot.git mmc: s5p_sdhci: remove duplicated card detect code The common sdhci infrastructure is already parsing the cd-gpios property, since commit 451931ea7002 ("mmc: sdhci: Read cd-gpio from devicetree"). The s5p code is therefore duplicated, and also broken since it assumes that the GPIO value is inverted, while the sdhci code correctly follows the ACTIVE_LOW/ACTIVE_HIGH flag specified in the device tree. This fix was originally authored by Simon Shields: https://github.com/fourkbomb/u-boot/commit/2eac9dea7903 The change has been tested on exynos4210-i9100, a device similar to exynos4210-trats. Signed-off-by: Henrik Grimler Reviewed-by: Anand Moon Reviewed-by: Sam Protsenko Signed-off-by: Peng Fan --- diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c index 278019f02ab..b2faecefc00 100644 --- a/drivers/mmc/s5p_sdhci.c +++ b/drivers/mmc/s5p_sdhci.c @@ -141,14 +141,6 @@ static int do_sdhci_init(struct sdhci_host *host) } } - if (dm_gpio_is_valid(&host->cd_gpio)) { - ret = dm_gpio_get_value(&host->cd_gpio); - if (ret) { - debug("no SD card detected (%d)\n", ret); - return -ENODEV; - } - } - return s5p_sdhci_core_init(host); } @@ -183,8 +175,6 @@ static int sdhci_get_config(const void *blob, int node, struct sdhci_host *host) gpio_request_by_name_nodev(offset_to_ofnode(node), "pwr-gpios", 0, &host->pwr_gpio, GPIOD_IS_OUT); - gpio_request_by_name_nodev(offset_to_ofnode(node), "cd-gpios", 0, - &host->cd_gpio, GPIOD_IS_IN); return 0; }