From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Arnd Bergmann <arnd@kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
Biju Das <biju.das.jz@bp.renesas.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
"linux-mmc @ vger . kernel . org" <linux-mmc@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mmc: renesas_sdhi: add regulator dependency
Date: Sat, 29 Mar 2025 12:46:56 +0100 [thread overview]
Message-ID: <Z-fdsBZgcO6bruIN@shikoro> (raw)
In-Reply-To: <70367c55-81c9-4387-b332-1e19ab8397d2@app.fastmail.com>
[-- Attachment #1: Type: text/plain, Size: 2033 bytes --]
On Sat, Mar 29, 2025 at 11:46:10AM +0100, Arnd Bergmann wrote:
> On Sat, Mar 29, 2025, at 10:46, Wolfram Sang wrote:
> > On Sat, Mar 29, 2025 at 09:20:52AM +0100, Arnd Bergmann wrote:
> >
> >> config MMC_SDHI
> >> tristate "Renesas SDHI SD/SDIO controller support"
> >> - depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
> >> + depends on SUPERH || (ARCH_RENESAS && RESET_CONTROLLER) || COMPILE_TEST
> >> + depends on REGULATOR
> >
> > Hmm, this is too strict IMO. SuperH does not need REGULATOR.
>
> I haven't tried building on sh, but I don't see why it wouldn't
> need the regulator dependency. The code that calls it is
>
> rcfg.of_node = of_get_child_by_name(dev->of_node, "vqmmc-regulator");
> if (!of_device_is_available(rcfg.of_node)) {
> of_node_put(rcfg.of_node);
> rcfg.of_node = NULL;
> }
>
> if (rcfg.of_node) {
> rcfg.driver_data = priv->host;
> rdev = devm_regulator_register(dev, &renesas_sdhi_vqmmc_regulator, &rcfg);
> ...
>
> which sounds like regulators are always needed when
> of_get_child_by_name() may return a non-NULL pointer, i.e.
> when CONFIG_OF is enabled.
rcfg.of_node will be NULLed when the regulator device is not available.
Which is only true for a few SoC variants. Most other SoCs use
'vmmc-supply' insteand of 'vqmmc-regulator'.
> If this is correct, maybe this is the best variant:
>
> config MMC_SDHI
> tristate "Renesas SDHI SD/SDIO controller support"
> depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
> depends on (REGULATOR && RESET_CONTROLLER) || !OF
>
> CONFIG_ARCH_RENESAS is only set when CONFIG_OF is also set,
> so both subsystem dependencies are covered by that, while
> SUPERH doesn't currently enable OF, but will need the
> regulator and reset controller if that patch is ever merged.
Even given the above, I like this approach and think it still works.
But Biju is the SDHI regulator expert here.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2025-03-29 11:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-29 8:20 [PATCH] mmc: renesas_sdhi: add regulator dependency Arnd Bergmann
2025-03-29 9:46 ` Wolfram Sang
2025-03-29 10:46 ` Arnd Bergmann
2025-03-29 11:46 ` Wolfram Sang [this message]
2025-03-29 12:49 ` Biju Das
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=Z-fdsBZgcO6bruIN@shikoro \
--to=wsa+renesas@sang-engineering.com \
--cc=adrian.hunter@intel.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=biju.das.jz@bp.renesas.com \
--cc=geert+renesas@glider.be \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox