mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mci: imx-esdhc: retire esdhc_platform_data
@ 2024-05-17  5:59 Ahmad Fatoum
  2024-05-21 11:00 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2024-05-17  5:59 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

We have no board in-tree that doesn't probe the imx-esdhc from DT.
The platform data is thus unused as the PBL usage happens without it,
therefore remove that struct definition and the dead code handling it.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/boards/ls1028ardb/lowlevel.c |  1 -
 arch/arm/boards/ls1046ardb/lowlevel.c |  1 -
 arch/arm/boards/tqmls1046a/lowlevel.c |  1 -
 drivers/mci/imx-esdhc.c               | 34 +------------------
 include/platform_data/mmc-esdhc-imx.h | 48 ---------------------------
 5 files changed, 1 insertion(+), 84 deletions(-)
 delete mode 100644 include/platform_data/mmc-esdhc-imx.h

diff --git a/arch/arm/boards/ls1028ardb/lowlevel.c b/arch/arm/boards/ls1028ardb/lowlevel.c
index 00db0b1cf869..e903d9d30196 100644
--- a/arch/arm/boards/ls1028ardb/lowlevel.c
+++ b/arch/arm/boards/ls1028ardb/lowlevel.c
@@ -4,7 +4,6 @@
 #include <debug_ll.h>
 #include <ddr_spd.h>
 #include <image-metadata.h>
-#include <platform_data/mmc-esdhc-imx.h>
 #include <soc/fsl/fsl_ddr_sdram.h>
 #include <soc/fsl/immap_lsch2.h>
 #include <asm/barebox-arm-head.h>
diff --git a/arch/arm/boards/ls1046ardb/lowlevel.c b/arch/arm/boards/ls1046ardb/lowlevel.c
index 408e6017f6cc..56b8320eddb4 100644
--- a/arch/arm/boards/ls1046ardb/lowlevel.c
+++ b/arch/arm/boards/ls1046ardb/lowlevel.c
@@ -4,7 +4,6 @@
 #include <debug_ll.h>
 #include <ddr_spd.h>
 #include <image-metadata.h>
-#include <platform_data/mmc-esdhc-imx.h>
 #include <pbl/i2c.h>
 #include <soc/fsl/fsl_ddr_sdram.h>
 #include <soc/fsl/immap_lsch2.h>
diff --git a/arch/arm/boards/tqmls1046a/lowlevel.c b/arch/arm/boards/tqmls1046a/lowlevel.c
index 4a1496078a61..9fcb52ea3902 100644
--- a/arch/arm/boards/tqmls1046a/lowlevel.c
+++ b/arch/arm/boards/tqmls1046a/lowlevel.c
@@ -1,7 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 #include <common.h>
 #include <debug_ll.h>
-#include <platform_data/mmc-esdhc-imx.h>
 #include <soc/fsl/fsl_ddr_sdram.h>
 #include <soc/fsl/immap_lsch2.h>
 #include <asm/barebox-arm-head.h>
diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c
index b05934a20113..54309aec2f74 100644
--- a/drivers/mci/imx-esdhc.c
+++ b/drivers/mci/imx-esdhc.c
@@ -18,7 +18,6 @@
 #include <io.h>
 #include <linux/clk.h>
 #include <linux/err.h>
-#include <platform_data/mmc-esdhc-imx.h>
 #include <gpio.h>
 #include <of_device.h>
 #include <mach/imx/generic.h>
@@ -195,27 +194,7 @@ static void esdhc_set_ios(struct mci_host *mci, struct mci_ios *ios)
 
 static int esdhc_card_present(struct mci_host *mci)
 {
-	struct fsl_esdhc_host *host = to_fsl_esdhc(mci);
-	struct esdhc_platform_data *pdata = host->dev->platform_data;
-	int ret;
-
-	if (!pdata)
-		return 1;
-
-	switch (pdata->cd_type) {
-	case ESDHC_CD_NONE:
-	case ESDHC_CD_PERMANENT:
-		return 1;
-	case ESDHC_CD_CONTROLLER:
-		return !(sdhci_read32(&host->sdhci, SDHCI_PRESENT_STATE) & SDHCI_WRITE_PROTECT);
-	case ESDHC_CD_GPIO:
-		ret = gpio_direction_input(pdata->cd_gpio);
-		if (ret)
-			return ret;
-		return gpio_get_value(pdata->cd_gpio) ? 0 : 1;
-	}
-
-	return 0;
+	return 1;
 }
 
 static int esdhc_reset(struct fsl_esdhc_host *host)
@@ -302,7 +281,6 @@ static int fsl_esdhc_probe(struct device *dev)
 	struct mci_host *mci;
 	int ret;
 	unsigned long rate;
-	struct esdhc_platform_data *pdata = dev->platform_data;
 	const struct esdhc_soc_data *socdata;
 
 	ret = dev_get_drvdata(dev, (const void **)&socdata);
@@ -338,12 +316,6 @@ static int fsl_esdhc_probe(struct device *dev)
 
 	esdhc_populate_sdhci(host);
 
-	if (pdata) {
-		mci->host_caps = pdata->caps;
-		if (pdata->devname)
-			mci->devname = pdata->devname;
-	}
-
 	host->mci.ops = fsl_esdhc_ops;
 	host->mci.hw_dev = dev;
 	host->sdhci.mci = &host->mci;
@@ -360,10 +332,6 @@ static int fsl_esdhc_probe(struct device *dev)
 	if (host->mci.f_min < 200000)
 		host->mci.f_min = 200000;
 	host->mci.f_max = rate;
-	if (pdata) {
-		host->mci.use_dsr = pdata->use_dsr;
-		host->mci.dsr_val = pdata->dsr_val;
-	}
 
 	mci_of_parse(&host->mci);
 
diff --git a/include/platform_data/mmc-esdhc-imx.h b/include/platform_data/mmc-esdhc-imx.h
deleted file mode 100644
index fb7380a18201..000000000000
--- a/include/platform_data/mmc-esdhc-imx.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2010 Wolfram Sang <w.sang@pengutronix.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; version 2
- * of the License.
- */
-
-#ifndef __ASM_ARCH_IMX_ESDHC_H
-#define __ASM_ARCH_IMX_ESDHC_H
-
-enum wp_types {
-	ESDHC_WP_NONE,		/* no WP, neither controller nor gpio */
-	ESDHC_WP_CONTROLLER,	/* mmc controller internal WP */
-	ESDHC_WP_GPIO,		/* external gpio pin for WP */
-};
-
-enum cd_types {
-	ESDHC_CD_NONE,		/* no CD, neither controller nor gpio */
-	ESDHC_CD_CONTROLLER,	/* mmc controller internal CD */
-	ESDHC_CD_GPIO,		/* external gpio pin for CD */
-	ESDHC_CD_PERMANENT,	/* no CD, card permanently wired to host */
-};
-
-/**
- * struct esdhc_platform_data - platform data for esdhc on i.MX
- *
- * ESDHC_WP(CD)_CONTROLLER type is not available on i.MX25/35.
- *
- * @wp_gpio:	gpio for write_protect
- * @cd_gpio:	gpio for card_detect interrupt
- * @wp_type:	type of write_protect method (see wp_types enum above)
- * @cd_type:	type of card_detect method (see cd_types enum above)
- * @caps:	supported bus width capabilities (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)
- */
-
-struct esdhc_platform_data {
-	unsigned int wp_gpio;
-	unsigned int cd_gpio;
-	enum wp_types wp_type;
-	enum cd_types cd_type;
-	unsigned caps;
-	char *devname;
-	unsigned dsr_val;
-	int use_dsr;
-};
-#endif /* __ASM_ARCH_IMX_ESDHC_H */
-- 
2.39.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mci: imx-esdhc: retire esdhc_platform_data
  2024-05-17  5:59 [PATCH] mci: imx-esdhc: retire esdhc_platform_data Ahmad Fatoum
@ 2024-05-21 11:00 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-05-21 11:00 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Fri, 17 May 2024 07:59:51 +0200, Ahmad Fatoum wrote:
> We have no board in-tree that doesn't probe the imx-esdhc from DT.
> The platform data is thus unused as the PBL usage happens without it,
> therefore remove that struct definition and the dead code handling it.
> 
> 

Applied, thanks!

[1/1] mci: imx-esdhc: retire esdhc_platform_data
      https://git.pengutronix.de/cgit/barebox/commit/?id=4cce368d53c1 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-21 11:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-17  5:59 [PATCH] mci: imx-esdhc: retire esdhc_platform_data Ahmad Fatoum
2024-05-21 11:00 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox