From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [PATCH] regulator: fix: Move code to enable gpio regulator to pre_probe from ofdata_to_platdata
Date: Tue, 11 Feb 2020 07:33:17 -0500 [thread overview]
Message-ID: <20200211123317.GA13379@bill-the-cat> (raw)
In-Reply-To: <20200125080058.956-1-lukma@denx.de>
On Sat, Jan 25, 2020 at 09:00:58AM +0100, Lukasz Majewski wrote:
> The commit e8e9715df2d4 ("regulator: fixed: Modify enable-active-high behavior")
> fixed the regulator driver behavior when 'enable-active-high' is defined.
> Unfortunately, this patch used dm_regulator_platdata()'s "boot_on" member
> to set GPIOD_IS_OUT_ACTIVE flag and enable the regulator.
>
> The issue here is that regulator_common_ofdata_to_platdata() is called
> _before_ regulator_pre_probe() function in which the 'regulator-boot-on'
> property is asserted.
>
> As a result the GPIOD_IS_OUT_ACTIVE flag is not set and gpio_request_by_name()
> called in the former function is not enabling the regulator.
> This is problematic for e.g. i.MX ethernet driver, which then tries to
> perform initialization without power (and fails).
>
> The solution here is to explicitly enable regulator in regulator_pre_probe()
> callback only when 'regulator-boot-on' property is present in device tree.
> The GPIOD_IS_OUT_ACTIVE flag is not set at all, but relevant gpio is
> requested.
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
> Tested-by: Patrice Chotard <patrice.chotard@st.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200211/69408238/attachment.sig>
prev parent reply other threads:[~2020-02-11 12:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-25 8:00 [PATCH] regulator: fix: Move code to enable gpio regulator to pre_probe from ofdata_to_platdata Lukasz Majewski
2020-01-27 12:48 ` Patrice CHOTARD
2020-02-10 10:10 ` Lukasz Majewski
2020-02-11 12:33 ` Tom Rini [this message]
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=20200211123317.GA13379@bill-the-cat \
--to=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/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