[PATCH 03/10] mmc: sdhci-of-k1: add regulator framework support
Iker Pedrosa
ikerpedrosam at gmail.com
Tue Mar 3 05:58:13 PST 2026
El mar, 3 mar 2026 a las 5:11, Yao Zi (<me at ziyao.cc>) escribió:
>
> On Mon, Mar 02, 2026 at 04:13:24PM +0100, Iker Pedrosa wrote:
> > Add regulator framework support for voltage switching operations. This
> > enables proper PMIC control for UHS voltage switching between 3.3V and
> > 1.8V signaling levels.
> >
> > - Add regulator supply parsing
> > - Implement voltage switching callback
> > - Enable mmc regulator framework integration
> >
> > Signed-off-by: Iker Pedrosa <ikerpedrosam at gmail.com>
> > ---
> > drivers/mmc/host/sdhci-of-k1.c | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
>
> It seems PATCH 4 should be squashed into this one, or the functionality
> of voltage switching isn't really complete.
That makes sense. I'm still learning the best way to structure these
series for the kernel, so I appreciate the guidance. I'll squash patch
4 into this one for v2 to ensure the voltage switching logic is
atomic.
>
> > diff --git a/drivers/mmc/host/sdhci-of-k1.c b/drivers/mmc/host/sdhci-of-k1.c
> > index b703b78282ed8d89183c816477c149c0a565618a..c260cb89704ae7a25bec0f07831d495553405bbd 100644
> > --- a/drivers/mmc/host/sdhci-of-k1.c
> > +++ b/drivers/mmc/host/sdhci-of-k1.c
>
> ...
>
> > @@ -291,6 +297,12 @@ static int spacemit_sdhci_probe(struct platform_device *pdev)
> >
> > host->mmc->caps |= MMC_CAP_NEED_RSP_BUSY;
> >
> > + ret = mmc_regulator_get_supply(host->mmc);
> > + if (ret)
> > + dev_warn(dev, "Failed to get regulators: %d\n", ret);
> > +
> > + host->mmc_host_ops.start_signal_voltage_switch = spacemit_sdhci_start_signal_voltage_switch;
>
> Why not assign start_signal_voltage_switch in the declaration of
> spacemit_sdhci_ops?
You're right, that’s much cleaner. I'll move the assignment into the
spacemit_sdhci_ops declaration for v2. Thanks for the suggestion!
>
> > ret = spacemit_sdhci_get_clocks(dev, pltfm_host);
> > if (ret)
> > goto err_pltfm;
> >
> > --
> > 2.53.0
>
> Best regards,
> Yao Zi
>
More information about the linux-riscv
mailing list