From: Mark Brown <broonie@kernel.org>
To: Claudiu.Beznea@microchip.com
Cc: lgirdwood@gmail.com, Nicolas.Ferre@microchip.com,
alexandre.belloni@bootlin.com, robh+dt@kernel.org,
mark.rutland@arm.com, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
boris.brezillon@bootlin.com
Subject: Re: [PATCH 1/2] regulator: act8945: Implement PM functionalities
Date: Wed, 7 Nov 2018 14:53:49 +0000 [thread overview]
Message-ID: <20181107145349.GA6809@sirena.org.uk> (raw)
In-Reply-To: <1540570753-16370-2-git-send-email-claudiu.beznea@microchip.com>
[-- Attachment #1: Type: text/plain, Size: 1179 bytes --]
On Fri, Oct 26, 2018 at 04:19:48PM +0000, Claudiu.Beznea@microchip.com wrote:
> +static unsigned int act8945a_of_map_mode(unsigned int mode)
> +{
> + if (mode == ACT8945A_DCDC_MODE_POWER_SAVING)
> + return REGULATOR_MODE_STANDBY;
> +
> + return REGULATOR_MODE_NORMAL;
> +}
This should error out if it gets an unknown value rather than silently
mapping it to normal - we don't know what the user intended to set here.
There should also be some binding documentation updates saying what the
values that can be set are.
> +static void act8945a_pmic_shutdown(struct platform_device *pdev)
> +{
> + struct act8945a_pmic *act8945a = platform_get_drvdata(pdev);
> + struct regmap *regmap = act8945a->regmap;
> +
> + /*
> + * Ask the PMIC to shutdown everything on the next PWRHLD transition.
> + */
> + regmap_write(regmap, ACT8945A_SYS_CTRL, 0x0);
> }
>
This shutdown function appears to be independant of the mode setting and
would be better split out as a separate patch (you could have one patch
adding the regmap stuff, one for this and one for the mode setting).
It makes review a lot simpler if each patch does a minimal set of
changes.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2018-11-07 14:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-26 16:19 [PATCH 0/2] add PM functionality for act8945 Claudiu.Beznea
2018-10-26 16:19 ` [PATCH 1/2] regulator: act8945: Implement PM functionalities Claudiu.Beznea
2018-11-07 14:53 ` Mark Brown [this message]
2018-11-07 15:03 ` Claudiu.Beznea
2018-10-26 16:19 ` [PATCH 2/2] ARM: dts: at91: sama5d2_xplained: Add proper regulator states for suspend-to-mem Claudiu.Beznea
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=20181107145349.GA6809@sirena.org.uk \
--to=broonie@kernel.org \
--cc=Claudiu.Beznea@microchip.com \
--cc=Nicolas.Ferre@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=boris.brezillon@bootlin.com \
--cc=devicetree@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.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 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).