From: Mark Brown <broonie@kernel.org>
To: Anand K Mistry <amistry@google.com>
Cc: drinkcat@chromium.org, Liam Girdwood <lgirdwood@gmail.com>,
linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
Matthias Brugger <matthias.bgg@gmail.com>,
hsin-hsiung.wang@mediatek.com
Subject: Re: [PATCH] regulator: mt6397: Implement of_map_mode regulator_desc function
Date: Tue, 30 Jun 2020 11:38:34 +0100 [thread overview]
Message-ID: <20200630103834.GC5272@sirena.org.uk> (raw)
In-Reply-To: <20200630111047.1.I05d781ac794389337a4adc2f6402f673117e2937@changeid>
[-- Attachment #1.1: Type: text/plain, Size: 702 bytes --]
On Tue, Jun 30, 2020 at 11:10:51AM +1000, Anand K Mistry wrote:
> Without a of_map_mode implementation, the regulator-allowed-modes
> devicetree field is skipped, and attempting to change the regulator mode
> results in an error:
> [ 1.439165] vpca15: mode operation not allowed
The modes aren't documented in the binding document, any new device tree
property needs to be added to the binding document.
> +static unsigned int mt6397_map_mode(unsigned int mode)
> +{
> + return mode == MT6397_BUCK_MODE_AUTO ?
> + REGULATOR_MODE_NORMAL : REGULATOR_MODE_FAST;
> +}
> +
Please write normal conditional statements to improve legibility, the
ternery operator has uses but they're pretty specialist.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
prev parent reply other threads:[~2020-06-30 10:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-30 1:10 [PATCH] regulator: mt6397: Implement of_map_mode regulator_desc function Anand K Mistry
2020-06-30 10:38 ` Mark Brown [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=20200630103834.GC5272@sirena.org.uk \
--to=broonie@kernel.org \
--cc=amistry@google.com \
--cc=drinkcat@chromium.org \
--cc=hsin-hsiung.wang@mediatek.com \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).