From: Adrian Hunter <adrian.hunter@intel.com>
To: Tanmay Kathpalia <tanmay.kathpalia@altera.com>,
<linux-mmc@vger.kernel.org>
Cc: <ulf.hansson@linaro.org>, Ulf Hansson <ulfh@kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 6/9] mmc: sdhci-cadence: rename V4 functions for V6 controller groundwork
Date: Sat, 4 Jul 2026 14:17:36 +0300 [thread overview]
Message-ID: <a2002144-5600-4af3-9fb1-03677fb61866@intel.com> (raw)
In-Reply-To: <20260627201457.12318-7-tanmay.kathpalia@altera.com>
On 27/06/2026 23:14, Tanmay Kathpalia wrote:
> PHY-related functions and data structures in the driver are not
> explicitly scoped to the SD4HC (V4) controller, making it unclear
> which code is shared and which is version-specific.
>
> Rename them with a "cdns4" prefix to distinguish SD4HC-specific
> implementation from the shared driver core, and to avoid naming
> conflicts when SD6HC (V6) support is introduced.
>
> Signed-off-by: Tanmay Kathpalia <tanmay.kathpalia@altera.com>
> ---
> drivers/mmc/host/sdhci-cadence.c | 56 ++++++++++++++++----------------
> 1 file changed, 28 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c
> index 435603c8c00b..b00dc2eec922 100644
> --- a/drivers/mmc/host/sdhci-cadence.c
> +++ b/drivers/mmc/host/sdhci-cadence.c
> @@ -78,7 +78,7 @@
> */
> #define SDHCI_CDNS_MAX_TUNING_LOOP 40
>
> -struct sdhci_cdns_phy_param {
> +struct sdhci_cdns4_phy_param {
> u8 addr;
> u8 data;
> };
> @@ -91,10 +91,10 @@ struct sdhci_cdns_priv {
> void (*priv_writel)(struct sdhci_cdns_priv *priv, u32 val, void __iomem *reg);
> struct reset_control *rst_hw;
> unsigned int nr_phy_params;
> - struct sdhci_cdns_phy_param phy_params[];
> + struct sdhci_cdns4_phy_param phy_params[];
> };
>
> -struct sdhci_cdns_phy_cfg {
> +struct sdhci_cdns4_phy_cfg {
> const char *property;
> u8 addr;
> };
> @@ -104,7 +104,7 @@ struct sdhci_cdns_drv_data {
> const struct sdhci_pltfm_data pltfm_data;
> };
>
> -static const struct sdhci_cdns_phy_cfg sdhci_cdns_phy_cfgs[] = {
> +static const struct sdhci_cdns4_phy_cfg sdhci_cdns4_phy_cfgs[] = {
> { "cdns,phy-input-delay-sd-highspeed", SDHCI_CDNS_PHY_DLY_SD_HS, },
> { "cdns,phy-input-delay-legacy", SDHCI_CDNS_PHY_DLY_SD_DEFAULT, },
> { "cdns,phy-input-delay-sd-uhs-sdr12", SDHCI_CDNS_PHY_DLY_UHS_SDR12, },
> @@ -124,8 +124,8 @@ static inline void cdns_writel(struct sdhci_cdns_priv *priv, u32 val,
> writel(val, reg);
> }
>
> -static int sdhci_cdns_write_phy_reg(struct sdhci_cdns_priv *priv,
> - u8 addr, u8 data)
> +static int sdhci_cdns4_write_phy_reg(struct sdhci_cdns_priv *priv,
> + u8 addr, u8 data)
Could be all one line
> {
> void __iomem *reg = priv->hrs_addr + SDHCI_CDNS_HRS04;
> u32 tmp;
> @@ -156,44 +156,44 @@ static int sdhci_cdns_write_phy_reg(struct sdhci_cdns_priv *priv,
> return ret;
> }
>
> -static unsigned int sdhci_cdns_phy_param_count(struct device_node *np)
> +static unsigned int sdhci_cdns4_phy_param_count(struct device_node *np)
> {
> unsigned int count = 0;
> int i;
>
> - for (i = 0; i < ARRAY_SIZE(sdhci_cdns_phy_cfgs); i++)
> - if (of_property_present(np, sdhci_cdns_phy_cfgs[i].property))
> + for (i = 0; i < ARRAY_SIZE(sdhci_cdns4_phy_cfgs); i++)
> + if (of_property_present(np, sdhci_cdns4_phy_cfgs[i].property))
> count++;
>
> return count;
> }
>
> -static void sdhci_cdns_phy_param_parse(struct device_node *np,
> - struct sdhci_cdns_priv *priv)
> +static void sdhci_cdns4_phy_param_parse(struct device_node *np,
> + struct sdhci_cdns_priv *priv)
Could be all one line
> {
> - struct sdhci_cdns_phy_param *p = priv->phy_params;
> + struct sdhci_cdns4_phy_param *p = priv->phy_params;
> u32 val;
> int ret, i;
>
> - for (i = 0; i < ARRAY_SIZE(sdhci_cdns_phy_cfgs); i++) {
> - ret = of_property_read_u32(np, sdhci_cdns_phy_cfgs[i].property,
> + for (i = 0; i < ARRAY_SIZE(sdhci_cdns4_phy_cfgs); i++) {
> + ret = of_property_read_u32(np, sdhci_cdns4_phy_cfgs[i].property,
> &val);
Could be all one line
> if (ret)
> continue;
>
> - p->addr = sdhci_cdns_phy_cfgs[i].addr;
> + p->addr = sdhci_cdns4_phy_cfgs[i].addr;
> p->data = val;
> p++;
> }
> }
>
> -static int sdhci_cdns_phy_init(struct sdhci_cdns_priv *priv)
> +static int sdhci_cdns4_phy_init(struct sdhci_cdns_priv *priv)
> {
> int ret, i;
>
> for (i = 0; i < priv->nr_phy_params; i++) {
> - ret = sdhci_cdns_write_phy_reg(priv, priv->phy_params[i].addr,
> - priv->phy_params[i].data);
> + ret = sdhci_cdns4_write_phy_reg(priv, priv->phy_params[i].addr,
> + priv->phy_params[i].data);
> if (ret)
> return ret;
> }
> @@ -470,7 +470,7 @@ static int elba_drv_init(struct platform_device *pdev)
> return 0;
> }
>
> -static const struct sdhci_ops sdhci_cdns_ops = {
> +static const struct sdhci_ops sdhci_cdns4_ops = {
> .set_clock = sdhci_set_clock,
> .get_timeout_clock = sdhci_cdns_get_timeout_clock,
> .set_bus_width = sdhci_set_bus_width,
> @@ -481,7 +481,7 @@ static const struct sdhci_ops sdhci_cdns_ops = {
>
> static const struct sdhci_cdns_drv_data sdhci_cdns_uniphier_drv_data = {
> .pltfm_data = {
> - .ops = &sdhci_cdns_ops,
> + .ops = &sdhci_cdns4_ops,
> .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
> },
> };
> @@ -495,14 +495,14 @@ static const struct sdhci_cdns_drv_data sdhci_elba_drv_data = {
>
> static const struct sdhci_cdns_drv_data sdhci_eyeq_drv_data = {
> .pltfm_data = {
> - .ops = &sdhci_cdns_ops,
> + .ops = &sdhci_cdns4_ops,
> .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
> },
> };
>
> -static const struct sdhci_cdns_drv_data sdhci_cdns_drv_data = {
> +static const struct sdhci_cdns_drv_data sdhci_cdns4_drv_data = {
> .pltfm_data = {
> - .ops = &sdhci_cdns_ops,
> + .ops = &sdhci_cdns4_ops,
> },
> };
>
> @@ -560,9 +560,9 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
>
> data = of_device_get_match_data(dev);
> if (!data)
> - data = &sdhci_cdns_drv_data;
> + data = &sdhci_cdns4_drv_data;
>
> - nr_phy_params = sdhci_cdns_phy_param_count(dev->of_node);
> + nr_phy_params = sdhci_cdns4_phy_param_count(dev->of_node);
> host = sdhci_pltfm_init(pdev, &data->pltfm_data,
> struct_size(priv, phy_params, nr_phy_params));
> if (IS_ERR(host))
> @@ -593,9 +593,9 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
> if (ret)
> return ret;
>
> - sdhci_cdns_phy_param_parse(dev->of_node, priv);
> + sdhci_cdns4_phy_param_parse(dev->of_node, priv);
>
> - ret = sdhci_cdns_phy_init(priv);
> + ret = sdhci_cdns4_phy_init(priv);
> if (ret)
> return ret;
>
> @@ -622,7 +622,7 @@ static int sdhci_cdns_resume(struct device *dev)
> if (ret)
> return ret;
>
> - ret = sdhci_cdns_phy_init(priv);
> + ret = sdhci_cdns4_phy_init(priv);
> if (ret)
> goto disable_clk;
>
next prev parent reply other threads:[~2026-07-04 11:17 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-27 20:14 [PATCH v2 0/9] mmc: sdhci-cadence: add SD6HC support and Agilex5 enablement Tanmay Kathpalia
2026-06-27 20:14 ` [PATCH v2 1/9] dt-bindings: reset: altr: add COMBOPHY_RESET for Agilex5 Tanmay Kathpalia
2026-07-02 15:53 ` (subset) " Philipp Zabel
2026-06-27 20:14 ` [PATCH v2 2/9] dt-bindings: mmc: cdns,sdhci: add SD6HC support and PHY properties Tanmay Kathpalia
2026-06-27 20:26 ` sashiko-bot
2026-06-28 9:46 ` Kathpalia, Tanmay
2026-06-29 7:04 ` Krzysztof Kozlowski
2026-07-02 8:58 ` Kathpalia, Tanmay
2026-06-27 20:14 ` [PATCH v2 3/9] arm64: dts: agilex5: add Cadence SD6HC controller and SOCDK enablement Tanmay Kathpalia
2026-06-27 20:24 ` sashiko-bot
2026-06-28 9:55 ` Kathpalia, Tanmay
2026-06-29 7:06 ` Krzysztof Kozlowski
2026-07-02 9:01 ` Kathpalia, Tanmay
2026-06-27 20:14 ` [PATCH v2 4/9] dt-bindings: arm: intel: add Agilex5 SOCDK eMMC board variant Tanmay Kathpalia
2026-06-29 7:06 ` Krzysztof Kozlowski
2026-07-02 9:07 ` Kathpalia, Tanmay
2026-06-27 20:14 ` [PATCH v2 5/9] arm64: dts: agilex5: add SOCDK eMMC daughter board support Tanmay Kathpalia
2026-06-29 7:07 ` Krzysztof Kozlowski
2026-07-02 9:07 ` Kathpalia, Tanmay
2026-06-27 20:14 ` [PATCH v2 6/9] mmc: sdhci-cadence: rename V4 functions for V6 controller groundwork Tanmay Kathpalia
2026-07-04 11:17 ` Adrian Hunter [this message]
2026-06-27 20:14 ` [PATCH v2 7/9] mmc: sdhci-cadence: refactor driver structure for V6 controller support Tanmay Kathpalia
2026-06-27 20:14 ` [PATCH v2 8/9] mmc: sdhci-cadence: add Cadence SD6HC support Tanmay Kathpalia
2026-07-04 11:18 ` Adrian Hunter
2026-06-27 20:14 ` [PATCH v2 9/9] mmc: sdhci-cadence: add Altera Agilex5 " Tanmay Kathpalia
2026-06-29 7:08 ` Krzysztof Kozlowski
2026-07-02 9:04 ` Kathpalia, Tanmay
2026-07-04 11:18 ` Adrian Hunter
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=a2002144-5600-4af3-9fb1-03677fb61866@intel.com \
--to=adrian.hunter@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=tanmay.kathpalia@altera.com \
--cc=ulf.hansson@linaro.org \
--cc=ulfh@kernel.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.