[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200630103834.GC5272@sirena.org.uk>
Date: Tue, 30 Jun 2020 11:38:34 +0100
From: Mark Brown <broonie@...nel.org>
To: Anand K Mistry <amistry@...gle.com>
Cc: linux-mediatek@...ts.infradead.org, drinkcat@...omium.org,
hsin-hsiung.wang@...iatek.com, Liam Girdwood <lgirdwood@...il.com>,
Matthias Brugger <matthias.bgg@...il.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] regulator: mt6397: Implement of_map_mode regulator_desc
function
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.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists