From: maxime.ripard@free-electrons.com (Maxime Ripard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] regulator: core: Allow use of "status = disabled" in regulator dts nodes
Date: Tue, 29 Mar 2016 11:57:11 +0200 [thread overview]
Message-ID: <20160329095711.GI30977@lukather> (raw)
In-Reply-To: <1457730069-31760-1-git-send-email-hdegoede@redhat.com>
Hi Mark,
On Fri, Mar 11, 2016 at 10:01:07PM +0100, Hans de Goede wrote:
> The axp20x and axp22x pmics have ldo regulators which are muxed to the
> outside via gpio pins. Unfortunately regulator enable / disable is
> implemented in the hardware via selecting a specific pin-mux option.
>
> So if we want to use these pins as gpio pins we must not register
> a regulator for these pins at all, otherwise any gpio use (switching
> to input, or writing a value) gets undone when the regulator subsys
> disables unused regulators at the end of kernel-init.
>
> This commits allows the use of "status = disabled" in regulator dts
> nodes and makes regulator_register return ENODEV when this is set.
>
> Note that this commit changes the loop to find the of-node in
> regulator_of_get_init_data from using for_each_available_child_of_node
> to using for_each_child_of_node. regulator_register is the only user
> of regulator_of_get_init_data and the use of for_each_available_child...
> makes little sense there since this will only cause the constraints
> from regulator dts nodes marked as disabled to not be used, the
> actual registration of the regulator would still continue.
>
> So in a way this patch could be seen as a bugfix as it actually makes
> regulators with an of_node which is marked as not available not register,
> but this behavior change may cause some issues in some places.
>
> Note that individual regulator drivers / callers of regulator_register
> which may encounter disabled regulator (child) nodes need to be patched to
> handle ENODEV (to not make it fail their probe method).
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Any comments on this one?
Thanks,
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160329/b78cb4eb/attachment.sig>
WARNING: multiple messages have this Message-ID (diff)
From: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Mark Brown <broonie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
Liam Girdwood <lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: [PATCH 1/3] regulator: core: Allow use of "status = disabled" in regulator dts nodes
Date: Tue, 29 Mar 2016 11:57:11 +0200 [thread overview]
Message-ID: <20160329095711.GI30977@lukather> (raw)
In-Reply-To: <1457730069-31760-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1842 bytes --]
Hi Mark,
On Fri, Mar 11, 2016 at 10:01:07PM +0100, Hans de Goede wrote:
> The axp20x and axp22x pmics have ldo regulators which are muxed to the
> outside via gpio pins. Unfortunately regulator enable / disable is
> implemented in the hardware via selecting a specific pin-mux option.
>
> So if we want to use these pins as gpio pins we must not register
> a regulator for these pins at all, otherwise any gpio use (switching
> to input, or writing a value) gets undone when the regulator subsys
> disables unused regulators at the end of kernel-init.
>
> This commits allows the use of "status = disabled" in regulator dts
> nodes and makes regulator_register return ENODEV when this is set.
>
> Note that this commit changes the loop to find the of-node in
> regulator_of_get_init_data from using for_each_available_child_of_node
> to using for_each_child_of_node. regulator_register is the only user
> of regulator_of_get_init_data and the use of for_each_available_child...
> makes little sense there since this will only cause the constraints
> from regulator dts nodes marked as disabled to not be used, the
> actual registration of the regulator would still continue.
>
> So in a way this patch could be seen as a bugfix as it actually makes
> regulators with an of_node which is marked as not available not register,
> but this behavior change may cause some issues in some places.
>
> Note that individual regulator drivers / callers of regulator_register
> which may encounter disabled regulator (child) nodes need to be patched to
> handle ENODEV (to not make it fail their probe method).
>
> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Any comments on this one?
Thanks,
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2016-03-29 9:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-11 21:01 [PATCH 1/3] regulator: core: Allow use of "status = disabled" in regulator dts nodes Hans de Goede
2016-03-11 21:01 ` Hans de Goede
2016-03-11 21:01 ` [PATCH 2/3] regulator: axp20x: Handle regulator_register returning ENODEV Hans de Goede
2016-03-11 21:01 ` Hans de Goede
2016-03-11 21:01 ` [PATCH 3/3] ARM: dts: sunxi: Disable axp22x ldo_io# regulators by default Hans de Goede
2016-03-11 21:01 ` Hans de Goede
2016-03-29 9:57 ` Maxime Ripard [this message]
2016-03-29 9:57 ` [PATCH 1/3] regulator: core: Allow use of "status = disabled" in regulator dts nodes Maxime Ripard
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=20160329095711.GI30977@lukather \
--to=maxime.ripard@free-electrons.com \
--cc=linux-arm-kernel@lists.infradead.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.