All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrien Grassein <adrien.grassein@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: ulf.hansson@linaro.org, robh+dt@kernel.org, shawnguo@kernel.org,
	s.hauer@pengutronix.de, kernel@pengutronix.de,
	festevam@gmail.com, linux-imx@nxp.com, linux-mmc@vger.kernel.org,
	devicetree@vger.kernel.org,
	Adrien Grassein <adrien.grassein@gmail.com>
Subject: [PATCH 2/2] mmc: sdhci-esdhc-imx: allow to disable HS400 support
Date: Sun, 29 Nov 2020 21:31:16 +0100	[thread overview]
Message-ID: <20201129203116.11987-2-adrien.grassein@gmail.com> (raw)
In-Reply-To: <20201129203116.11987-1-adrien.grassein@gmail.com>

This patch adds the posibility to remove the HS400
support directly from the devicetree.

This is useful for example for the sdcard slot of the
Nitrogen8M mini that doesn't support the HS400 standard.

Signed-off-by: Adrien Grassein <adrien.grassein@gmail.com>
---
 drivers/mmc/host/sdhci-esdhc-imx.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index fce8fa7e6b30..6fbd4bcca7a1 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -294,6 +294,7 @@ struct pltfm_imx_data {
 	} multiblock_status;
 	u32 is_ddr;
 	struct pm_qos_request pm_qos_req;
+	u32 disable_caps;
 };
 
 static const struct platform_device_id imx_esdhc_devtype[] = {
@@ -454,6 +455,8 @@ static u32 esdhc_readl_le(struct sdhci_host *host, int reg)
 			    IS_ERR_OR_NULL(imx_data->pins_200mhz))
 				val &= ~(SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_DDR50
 					 | SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_HS400);
+
+			val &= ~imx_data->disable_caps;
 		}
 	}
 
@@ -1502,6 +1505,9 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
 	if (of_property_read_u32(np, "fsl,delay-line", &boarddata->delay_line))
 		boarddata->delay_line = 0;
 
+	if (of_find_property(np, "fsl,no-mmc-hs400", NULL))
+		imx_data->disable_caps |= SDHCI_SUPPORT_HS400;
+
 	mmc_of_parse_voltage(np, &host->ocr_mask);
 
 	if (esdhc_is_usdhc(imx_data)) {
-- 
2.20.1


  reply	other threads:[~2020-11-29 20:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-29 20:31 [PATCH 1/2] dt-bindings: mmc: add an option to disable HS400 for fsl Adrien Grassein
2020-11-29 20:31 ` Adrien Grassein [this message]
2020-12-04 13:18 ` Ulf Hansson
2020-12-04 20:06   ` Adrien Grassein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201129203116.11987-2-adrien.grassein@gmail.com \
    --to=adrien.grassein@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-imx@nxp.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.