* [PATCH 2/4] mmc: sdhci-esdhc-imx: remove redundant write protect code
2023-05-05 8:49 [PATCH 1/4] mmc: sdhci-esdhc-imx: remove unused enum cd_types haibo.chen
@ 2023-05-05 8:49 ` haibo.chen
2023-05-05 8:49 ` [PATCH 3/4] dt-bindings: mmc: fsl-imx-esdhc: remove property "fsl,wp-controller" haibo.chen
2023-05-05 8:49 ` [PATCH 4/4] arm: dts: imx: remove "fsl,wp-controller" since it is dropped haibo.chen
2 siblings, 0 replies; 6+ messages in thread
From: haibo.chen @ 2023-05-05 8:49 UTC (permalink / raw)
To: adrian.hunter, ulf.hansson, linux-mmc, robh+dt,
krzysztof.kozlowski+dt, shawnguo, s.hauer
Cc: linux-imx, haibo.chen, kernel, festevam, cniedermaier, devicetree,
kernel
From: Haibo Chen <haibo.chen@nxp.com>
The logic of the esdhc_pltfm_get_ro() is just the same with common
code sdhci_check_ro(). So remove this redundant code, depends on
mmc_of_parse() and sdhci_check_ro() to cover the write protect
logic.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
drivers/mmc/host/sdhci-esdhc-imx.c | 47 +-----------------------------
1 file changed, 1 insertion(+), 46 deletions(-)
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index c7db742f729c..54531aab70f0 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -201,22 +201,8 @@
/* ERR004536 is not applicable for the IP */
#define ESDHC_FLAG_SKIP_ERR004536 BIT(17)
-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 */
-};
-
-/*
- * struct esdhc_platform_data - platform data for esdhc on i.MX
- *
- * ESDHC_WP(CD)_CONTROLLER type is not available on i.MX25/35.
- *
- * @wp_type: type of write_protect method (see wp_types enum above)
- */
-
+/* struct esdhc_platform_data - platform data for esdhc on i.MX */
struct esdhc_platform_data {
- enum wp_types wp_type;
int max_bus_width;
unsigned int delay_line;
unsigned int tuning_step; /* The delay cell steps in tuning procedure */
@@ -994,25 +980,6 @@ static inline void esdhc_pltfm_set_clock(struct sdhci_host *host,
}
-static unsigned int esdhc_pltfm_get_ro(struct sdhci_host *host)
-{
- struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
- struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host);
- struct esdhc_platform_data *boarddata = &imx_data->boarddata;
-
- switch (boarddata->wp_type) {
- case ESDHC_WP_GPIO:
- return mmc_gpio_get_ro(host->mmc);
- case ESDHC_WP_CONTROLLER:
- return !(readl(host->ioaddr + SDHCI_PRESENT_STATE) &
- SDHCI_WRITE_PROTECT);
- case ESDHC_WP_NONE:
- break;
- }
-
- return -ENOSYS;
-}
-
static void esdhc_pltfm_set_bus_width(struct sdhci_host *host, int width)
{
u32 ctrl;
@@ -1380,7 +1347,6 @@ static struct sdhci_ops sdhci_esdhc_ops = {
.get_max_clock = esdhc_pltfm_get_max_clock,
.get_min_clock = esdhc_pltfm_get_min_clock,
.get_max_timeout_count = esdhc_get_max_timeout_count,
- .get_ro = esdhc_pltfm_get_ro,
.set_timeout = esdhc_set_timeout,
.set_bus_width = esdhc_pltfm_set_bus_width,
.set_uhs_signaling = esdhc_set_uhs_signaling,
@@ -1588,17 +1554,6 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
struct esdhc_platform_data *boarddata = &imx_data->boarddata;
int ret;
- if (of_property_read_bool(np, "fsl,wp-controller"))
- boarddata->wp_type = ESDHC_WP_CONTROLLER;
-
- /*
- * If we have this property, then activate WP check.
- * Retrieveing and requesting the actual WP GPIO will happen
- * in the call to mmc_of_parse().
- */
- if (of_property_read_bool(np, "wp-gpios"))
- boarddata->wp_type = ESDHC_WP_GPIO;
-
of_property_read_u32(np, "fsl,tuning-step", &boarddata->tuning_step);
of_property_read_u32(np, "fsl,tuning-start-tap",
&boarddata->tuning_start_tap);
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 3/4] dt-bindings: mmc: fsl-imx-esdhc: remove property "fsl,wp-controller"
2023-05-05 8:49 [PATCH 1/4] mmc: sdhci-esdhc-imx: remove unused enum cd_types haibo.chen
2023-05-05 8:49 ` [PATCH 2/4] mmc: sdhci-esdhc-imx: remove redundant write protect code haibo.chen
@ 2023-05-05 8:49 ` haibo.chen
2023-05-05 9:33 ` Rob Herring
2023-05-05 8:49 ` [PATCH 4/4] arm: dts: imx: remove "fsl,wp-controller" since it is dropped haibo.chen
2 siblings, 1 reply; 6+ messages in thread
From: haibo.chen @ 2023-05-05 8:49 UTC (permalink / raw)
To: adrian.hunter, ulf.hansson, linux-mmc, robh+dt,
krzysztof.kozlowski+dt, shawnguo, s.hauer
Cc: linux-imx, haibo.chen, kernel, festevam, cniedermaier, devicetree,
kernel
From: Haibo Chen <haibo.chen@nxp.com>
Driver do not use this property, so remove it here.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml | 5 -----
1 file changed, 5 deletions(-)
diff --git a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
index fbfd822b9270..831eadecc7e4 100644
--- a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
+++ b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
@@ -96,11 +96,6 @@ properties:
interrupts:
maxItems: 1
- fsl,wp-controller:
- description: |
- boolean, if present, indicate to use controller internal write protection.
- type: boolean
-
fsl,delay-line:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 4/4] arm: dts: imx: remove "fsl,wp-controller" since it is dropped
2023-05-05 8:49 [PATCH 1/4] mmc: sdhci-esdhc-imx: remove unused enum cd_types haibo.chen
2023-05-05 8:49 ` [PATCH 2/4] mmc: sdhci-esdhc-imx: remove redundant write protect code haibo.chen
2023-05-05 8:49 ` [PATCH 3/4] dt-bindings: mmc: fsl-imx-esdhc: remove property "fsl,wp-controller" haibo.chen
@ 2023-05-05 8:49 ` haibo.chen
2 siblings, 0 replies; 6+ messages in thread
From: haibo.chen @ 2023-05-05 8:49 UTC (permalink / raw)
To: adrian.hunter, ulf.hansson, linux-mmc, robh+dt,
krzysztof.kozlowski+dt, shawnguo, s.hauer
Cc: linux-imx, haibo.chen, kernel, festevam, cniedermaier, devicetree,
kernel
From: Haibo Chen <haibo.chen@nxp.com>
The driver sdhci-esdhc-imx.c drop the "fsl,wp-controller", so do
a clean up in the dts file.
Now the logic of write protect is:
if want to use gpio method to implement the write protect, need
to add "wp-gpios" in dts file, otherwise will use the controller
internal logic to implement the write protect. This controller
method need to config one pin as a specific write protect function
used for the controller. If not do this config or the board do not
has this pin connect to card socket, then the write is enabled.
So now remove "fsl,wp-controller" will not involve any logic change.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
arch/arm/boot/dts/imx53-sk-imx53.dts | 1 -
arch/arm/boot/dts/imx53-tx53.dtsi | 2 --
arch/arm/boot/dts/imx6dl-tx6s-8035.dts | 1 -
arch/arm/boot/dts/imx6dl-tx6u-8033.dts | 1 -
arch/arm/boot/dts/imx6q-bosch-acc.dts | 2 --
arch/arm/boot/dts/imx6q-tx6q-1020-comtft.dts | 1 -
arch/arm/boot/dts/imx6q-tx6q-1020.dts | 1 -
arch/arm/boot/dts/imx6q-tx6q-1036.dts | 1 -
arch/arm/boot/dts/imx6qdl-dhcom-som.dtsi | 1 -
arch/arm/boot/dts/imx6qdl-emcon.dtsi | 2 --
arch/arm/boot/dts/imx6qdl-ts4900.dtsi | 1 -
arch/arm/boot/dts/imx6qdl-ts7970.dtsi | 1 -
arch/arm/boot/dts/imx6qdl-tx6.dtsi | 2 --
arch/arm/boot/dts/imx6qp-tx6qp-8037.dts | 1 -
arch/arm/boot/dts/imx6qp-tx6qp-8137.dts | 1 -
arch/arm/boot/dts/imx6ul-tx6ul-0011.dts | 1 -
arch/arm/boot/dts/imx6ul-tx6ul.dtsi | 1 -
arch/arm/boot/dts/imxrt1050.dtsi | 1 -
18 files changed, 22 deletions(-)
diff --git a/arch/arm/boot/dts/imx53-sk-imx53.dts b/arch/arm/boot/dts/imx53-sk-imx53.dts
index 103e73176e47..071e8b4b0a7e 100644
--- a/arch/arm/boot/dts/imx53-sk-imx53.dts
+++ b/arch/arm/boot/dts/imx53-sk-imx53.dts
@@ -76,7 +76,6 @@ &ecspi2 {
&esdhc1 {
cd-gpios = <&gpio3 14 GPIO_ACTIVE_LOW>;
- fsl,wp-controller;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_esdhc1>;
status = "okay";
diff --git a/arch/arm/boot/dts/imx53-tx53.dtsi b/arch/arm/boot/dts/imx53-tx53.dtsi
index a439a47fb65a..4bef504008cc 100644
--- a/arch/arm/boot/dts/imx53-tx53.dtsi
+++ b/arch/arm/boot/dts/imx53-tx53.dtsi
@@ -196,7 +196,6 @@ &gpio3 19 GPIO_ACTIVE_HIGH
&esdhc1 {
cd-gpios = <&gpio3 24 GPIO_ACTIVE_LOW>;
- fsl,wp-controller;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_esdhc1>;
status = "okay";
@@ -204,7 +203,6 @@ &esdhc1 {
&esdhc2 {
cd-gpios = <&gpio3 25 GPIO_ACTIVE_LOW>;
- fsl,wp-controller;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_esdhc2>;
status = "okay";
diff --git a/arch/arm/boot/dts/imx6dl-tx6s-8035.dts b/arch/arm/boot/dts/imx6dl-tx6s-8035.dts
index a5532ecc18c5..63f043372931 100644
--- a/arch/arm/boot/dts/imx6dl-tx6s-8035.dts
+++ b/arch/arm/boot/dts/imx6dl-tx6s-8035.dts
@@ -67,7 +67,6 @@ &usdhc4 {
bus-width = <4>;
non-removable;
no-1-8-v;
- fsl,wp-controller;
status = "okay";
};
diff --git a/arch/arm/boot/dts/imx6dl-tx6u-8033.dts b/arch/arm/boot/dts/imx6dl-tx6u-8033.dts
index 7030b2654bbd..2d24dae7dbfc 100644
--- a/arch/arm/boot/dts/imx6dl-tx6u-8033.dts
+++ b/arch/arm/boot/dts/imx6dl-tx6u-8033.dts
@@ -63,7 +63,6 @@ &usdhc4 {
bus-width = <4>;
non-removable;
no-1-8-v;
- fsl,wp-controller;
status = "okay";
};
diff --git a/arch/arm/boot/dts/imx6q-bosch-acc.dts b/arch/arm/boot/dts/imx6q-bosch-acc.dts
index 8263bfef9bf8..26794f425a59 100644
--- a/arch/arm/boot/dts/imx6q-bosch-acc.dts
+++ b/arch/arm/boot/dts/imx6q-bosch-acc.dts
@@ -573,7 +573,6 @@ &usdhc2 {
wakeup-source;
voltage-ranges = <3300 3300>;
vmmc-supply = <®_sw4>;
- fsl,wp-controller;
status = "okay";
};
@@ -586,7 +585,6 @@ &usdhc4 {
keep-power-in-suspend;
voltage-ranges = <3300 3300>;
vmmc-supply = <®_sw4>;
- fsl,wp-controller;
status = "okay";
};
diff --git a/arch/arm/boot/dts/imx6q-tx6q-1020-comtft.dts b/arch/arm/boot/dts/imx6q-tx6q-1020-comtft.dts
index a773f252816c..15956a92fe8b 100644
--- a/arch/arm/boot/dts/imx6q-tx6q-1020-comtft.dts
+++ b/arch/arm/boot/dts/imx6q-tx6q-1020-comtft.dts
@@ -91,7 +91,6 @@ &usdhc4 {
pinctrl-0 = <&pinctrl_usdhc4>;
bus-width = <4>;
no-1-8-v;
- fsl,wp-controller;
status = "okay";
};
diff --git a/arch/arm/boot/dts/imx6q-tx6q-1020.dts b/arch/arm/boot/dts/imx6q-tx6q-1020.dts
index 0a4daec8d3ad..9dc92773c2f1 100644
--- a/arch/arm/boot/dts/imx6q-tx6q-1020.dts
+++ b/arch/arm/boot/dts/imx6q-tx6q-1020.dts
@@ -67,7 +67,6 @@ &usdhc4 {
bus-width = <4>;
non-removable;
no-1-8-v;
- fsl,wp-controller;
status = "okay";
};
diff --git a/arch/arm/boot/dts/imx6q-tx6q-1036.dts b/arch/arm/boot/dts/imx6q-tx6q-1036.dts
index cb2fcb4896c6..24eba1d2afd9 100644
--- a/arch/arm/boot/dts/imx6q-tx6q-1036.dts
+++ b/arch/arm/boot/dts/imx6q-tx6q-1036.dts
@@ -67,7 +67,6 @@ &usdhc4 {
bus-width = <4>;
non-removable;
no-1-8-v;
- fsl,wp-controller;
status = "okay";
};
diff --git a/arch/arm/boot/dts/imx6qdl-dhcom-som.dtsi b/arch/arm/boot/dts/imx6qdl-dhcom-som.dtsi
index eaa87b333164..f8b985029f51 100644
--- a/arch/arm/boot/dts/imx6qdl-dhcom-som.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-dhcom-som.dtsi
@@ -412,7 +412,6 @@ &usdhc2 { /* External SD card via DHCOM */
&usdhc3 { /* Micro SD card on module */
cd-gpios = <&gpio7 8 GPIO_ACTIVE_LOW>;
- fsl,wp-controller;
keep-power-in-suspend;
pinctrl-0 = <&pinctrl_usdhc3>;
pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/imx6qdl-emcon.dtsi b/arch/arm/boot/dts/imx6qdl-emcon.dtsi
index ee2dd75cead6..61306e6da6bd 100644
--- a/arch/arm/boot/dts/imx6qdl-emcon.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-emcon.dtsi
@@ -792,13 +792,11 @@ &usbotg {
&usdhc1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc1>;
- fsl,wp-controller;
};
&usdhc2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc2>;
- fsl,wp-controller;
};
&usdhc3 {
diff --git a/arch/arm/boot/dts/imx6qdl-ts4900.dtsi b/arch/arm/boot/dts/imx6qdl-ts4900.dtsi
index f88da757edda..6d2f04434d6c 100644
--- a/arch/arm/boot/dts/imx6qdl-ts4900.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-ts4900.dtsi
@@ -464,7 +464,6 @@ &usdhc2 {
pinctrl-0 = <&pinctrl_usdhc2>;
vmmc-supply = <®_3p3v>;
bus-width = <4>;
- fsl,wp-controller;
status = "okay";
};
diff --git a/arch/arm/boot/dts/imx6qdl-ts7970.dtsi b/arch/arm/boot/dts/imx6qdl-ts7970.dtsi
index 1e0a041e9f60..d4c967971f6a 100644
--- a/arch/arm/boot/dts/imx6qdl-ts7970.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-ts7970.dtsi
@@ -579,7 +579,6 @@ &usdhc2 {
pinctrl-0 = <&pinctrl_usdhc2>;
vmmc-supply = <®_3p3v>;
bus-width = <4>;
- fsl,wp-controller;
status = "okay";
};
diff --git a/arch/arm/boot/dts/imx6qdl-tx6.dtsi b/arch/arm/boot/dts/imx6qdl-tx6.dtsi
index a197bac95cba..e74fb3171656 100644
--- a/arch/arm/boot/dts/imx6qdl-tx6.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-tx6.dtsi
@@ -777,7 +777,6 @@ &usdhc1 {
bus-width = <4>;
no-1-8-v;
cd-gpios = <&gpio7 2 GPIO_ACTIVE_LOW>;
- fsl,wp-controller;
status = "okay";
};
@@ -787,6 +786,5 @@ &usdhc2 {
bus-width = <4>;
no-1-8-v;
cd-gpios = <&gpio7 3 GPIO_ACTIVE_LOW>;
- fsl,wp-controller;
status = "okay";
};
diff --git a/arch/arm/boot/dts/imx6qp-tx6qp-8037.dts b/arch/arm/boot/dts/imx6qp-tx6qp-8037.dts
index ffc0f2ee11d2..18cda0d42826 100644
--- a/arch/arm/boot/dts/imx6qp-tx6qp-8037.dts
+++ b/arch/arm/boot/dts/imx6qp-tx6qp-8037.dts
@@ -67,7 +67,6 @@ &usdhc4 {
bus-width = <4>;
non-removable;
no-1-8-v;
- fsl,wp-controller;
status = "okay";
};
diff --git a/arch/arm/boot/dts/imx6qp-tx6qp-8137.dts b/arch/arm/boot/dts/imx6qp-tx6qp-8137.dts
index dd494d587014..7478ae7535f4 100644
--- a/arch/arm/boot/dts/imx6qp-tx6qp-8137.dts
+++ b/arch/arm/boot/dts/imx6qp-tx6qp-8137.dts
@@ -71,7 +71,6 @@ &usdhc4 {
bus-width = <4>;
non-removable;
no-1-8-v;
- fsl,wp-controller;
status = "okay";
};
diff --git a/arch/arm/boot/dts/imx6ul-tx6ul-0011.dts b/arch/arm/boot/dts/imx6ul-tx6ul-0011.dts
index d82698e7d50f..5a2e8edf149e 100644
--- a/arch/arm/boot/dts/imx6ul-tx6ul-0011.dts
+++ b/arch/arm/boot/dts/imx6ul-tx6ul-0011.dts
@@ -63,6 +63,5 @@ &usdhc2 {
bus-width = <4>;
no-1-8-v;
non-removable;
- fsl,wp-controller;
status = "okay";
};
diff --git a/arch/arm/boot/dts/imx6ul-tx6ul.dtsi b/arch/arm/boot/dts/imx6ul-tx6ul.dtsi
index 70cef5e817bd..62c96884bfda 100644
--- a/arch/arm/boot/dts/imx6ul-tx6ul.dtsi
+++ b/arch/arm/boot/dts/imx6ul-tx6ul.dtsi
@@ -575,7 +575,6 @@ &usdhc1 {
bus-width = <4>;
no-1-8-v;
cd-gpios = <&gpio4 14 GPIO_ACTIVE_LOW>;
- fsl,wp-controller;
status = "okay";
};
diff --git a/arch/arm/boot/dts/imxrt1050.dtsi b/arch/arm/boot/dts/imxrt1050.dtsi
index 852861558b47..7e983c52ebcd 100644
--- a/arch/arm/boot/dts/imxrt1050.dtsi
+++ b/arch/arm/boot/dts/imxrt1050.dtsi
@@ -91,7 +91,6 @@ usdhc1: mmc@402c0000 {
<&clks IMXRT1050_CLK_USDHC1>;
clock-names = "ipg", "ahb", "per";
bus-width = <4>;
- fsl,wp-controller;
no-1-8-v;
max-frequency = <200000000>;
fsl,tuning-start-tap = <20>;
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread