Re: [PATCH v24 08/15] mmc: renesas_sdhi: Add TMIO_MMC_INTERNAL_DIVIDER flag

From: Wolfram Sang

Date: Thu Sep 03 2026 - 05:50:40 EST



> +static bool renesas_sdhi_is_internal_divider_enabled(struct tmio_mmc_host *host)
> +{
> + bool enable = false;
> +
> + if (host->pdata->flags & TMIO_MMC_INTERNAL_DIVIDER)
> + enable = true;
> +
> + return enable;
> +}
> +
> +static unsigned int renesas_sdhi_clk_get_rate(struct tmio_mmc_host *host,
> + struct clk *clk)
> +{
> + unsigned int freq = clk_get_rate(clk);
> +
> + if (renesas_sdhi_is_internal_divider_enabled(host))
> + freq /= 2;
> +
> + return freq;
> +}

???

static unsigned int renesas_sdhi_clk_get_rate(struct tmio_mmc_host *host,
struct clk *clk)
{
unsigned int freq = clk_get_rate(clk);

return host->pdata->flags & TMIO_MMC_INTERNAL_DIVIDER ? freq / 2 : freq;
}

Was this AI generated?

> @@ -184,10 +205,14 @@ static unsigned int renesas_sdhi_clk_update(struct tmio_mmc_host *host,
>
> clk_set_rate(ref_clk, best_freq);
>
> - if (priv->clkh)
> + if (priv->clkh) {
> + if (host->pdata->flags & TMIO_MMC_INTERNAL_DIVIDER)
> + clkh_shift = 1;

No, this needs to be handled a bit above where clkh_shift is initially
set up, so we have it all in one block.

Attachment: signature.asc
Description: PGP signature