From: "Bengt Jönsson" <bengt.g.jonsson@stericsson.com>
To: Axel Lin <axel.lin@ingics.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
Lee Jones <lee.jones@linaro.org>,
Yvan FILLION <yvan.fillion@stericsson.com>,
Mattias WALLIN <mattias.wallin@stericsson.com>,
Liam Girdwood <lgirdwood@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFC/RFT] regulator: ab8500: Remove is_enabled from struct ab8500_regulator_info
Date: Tue, 26 Mar 2013 08:43:33 +0100 [thread overview]
Message-ID: <515151A5.3090306@stericsson.com> (raw)
In-Reply-To: <1364280647.16881.1.camel@phoenix>
On 03/26/2013 07:50 AM, Axel Lin wrote:
> The is_enabled flag looks not necessary at all, it also introduces some issues
> because current code updates info->is_enabled flag in error paths of
> ab8500_regulator_enable() and ab8500_regulator_disable().
> Thus this patch removes is_enabled from struct ab8500_regulator_info.
>
> This patch also removes info->is_enabled checking in ab8500_regulator_set_mode(),
> so it allows setting mode even the regulator is disabled.
This patch will change the behaviour of set_mode as the ab8500
regulators share mode and enable in the same register bits:
- off = 0b00
- low power mode= 0b11
- full powermode = 0b01
- (HW control mode = 0b10)
To keep regulator_enable/disable apart from regulator_set_mode I think
this patch should not go in.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> Hi,
> This patch also removes info->is_enabled checking in ab8500_regulator_set_mode().
> I'm not very clear if we should avoid setting mode when the regulator is disabled.
> It looks to me if we don't want to allow setting mode when regulator is disabled,
> this checking should be done in regulator-core.
Checking in regulator-core seems like a good idea to me.It would make
the ab8500 code more clean, but I don't know how other drivers will be
affected.
> Seems current code in other regulator drivers does not check if regulator is
> enabled or not in set_mode callback implementation.
> Axel
I know some other hardware has separate register bits for mode and
enable which matches the framework better.
Bengt
next prev parent reply other threads:[~2013-03-26 7:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-26 6:50 [PATCH RFC/RFT] regulator: ab8500: Remove is_enabled from struct ab8500_regulator_info Axel Lin
2013-03-26 7:43 ` Bengt Jönsson [this message]
2013-03-26 7:50 ` Axel Lin
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=515151A5.3090306@stericsson.com \
--to=bengt.g.jonsson@stericsson.com \
--cc=axel.lin@ingics.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mattias.wallin@stericsson.com \
--cc=yvan.fillion@stericsson.com \
/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.