From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Subject: Re: [PATCH v2 11/14] regulator: s2mps11: Add opmode for S2MPS14 regulators Date: Thu, 13 Feb 2014 12:43:20 +0000 Message-ID: <20140213124320.GB3403@lee--X1> References: <1392282847-25444-1-git-send-email-k.kozlowski@samsung.com> <1392282847-25444-12-git-send-email-k.kozlowski@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail-we0-f174.google.com ([74.125.82.174]:46476 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753261AbaBMMn2 (ORCPT ); Thu, 13 Feb 2014 07:43:28 -0500 Received: by mail-we0-f174.google.com with SMTP id w61so1740200wes.33 for ; Thu, 13 Feb 2014 04:43:27 -0800 (PST) Content-Disposition: inline In-Reply-To: <1392282847-25444-12-git-send-email-k.kozlowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org List-Id: linux-samsung-soc@vger.kernel.org To: Krzysztof Kozlowski Cc: Sangbeom Kim , Samuel Ortiz , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Kyungmin Park , Marek Szyprowski , Bartlomiej Zolnierkiewicz , Chanwoo Choi , Mark Brown , Liam Girdwood > S2MPS11/S2MPS14 regulators support different modes of operation: > - Always off; > - On/Off controlled by pin/GPIO (PWREN/LDOEN/EMMCEN); > - Always on; > This is very similar to S5M8767 regulator driver which also supports > opmodes (although S5M8767 have also low-power mode). >=20 > This patch adds parsing the operation mode from DTS by reading a > "op_mode" property from regulator child node. >=20 > The op_mode is then used for enabling the S2MPS14 regulators. > On S2MPS11 the DTS "op_mode" property is parsed but not used for > enabling, as this was not tested. >=20 > Signed-off-by: Krzysztof Kozlowski > Signed-off-by: Chanwoo Choi > Cc: Mark Brown > Cc: Liam Girdwood > --- > drivers/regulator/s2mps11.c | 97 +++++++++++++++++++++++++= +++++++++- > include/linux/mfd/samsung/s2mps14.h | 19 +++++++ > 2 files changed, 115 insertions(+), 1 deletion(-) > +++ b/include/linux/mfd/samsung/s2mps14.h > @@ -149,4 +149,23 @@ enum s2mps14_regulators { > #define S2MPS14_LDO_N_VOLTAGES (S2MPS14_LDO_VSEL_MASK + 1) > #define S2MPS14_BUCK_N_VOLTAGES (S2MPS14_BUCK_VSEL_MASK + 1) > =20 > +#define S2MPS14_ENCTRL_SHIFT 6 > +#define S2MPS14_ENCTRL_MASK (0x3 << S2MPS14_ENCTRL_SHIFT) > + > +/* > + * Values of regulator operation modes match device tree bindings. > + */ > +enum s2mps14_regulator_opmode { > + S2MPS14_REGULATOR_OPMODE_OFF =3D 0, > + S2MPS14_REGULATOR_OPMODE_ON =3D 1, > + /* > + * Reserved for compatibility with S5M8767 where this > + * is a low power mode. > + */ > + S2MPS14_REGULATOR_OPMODE_RESERVED =3D 2, > + S2MPS14_REGULATOR_OPMODE_SUSPEND =3D 3, You don't need to number these like this. If you want to force the numbering to start at '0' initialise the top value, then the rest should be sequential. > + S2MPS14_REGULATOR_OPMODE_MAX, > +}; > + > #endif /* __LINUX_MFD_S2MPS14_H */ --=20 Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org =E2=94=82 Open source software for ARM SoCs =46ollow Linaro: Facebook | Twitter | Blog