From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Brown Subject: Re: [PATCH v3 2/3] regulator: add support for SY8106A regulator Date: Wed, 25 Apr 2018 11:53:09 +0100 Message-ID: <20180425105309.GC24769@sirena.org.uk> References: <20180423144657.63264-1-icenowy@aosc.io> <20180423144657.63264-3-icenowy@aosc.io> <20180424170733.GD22073@sirena.org.uk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="S1BNGpv0yoYahz37" Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Icenowy Zheng Cc: linux-arm-kernel@lists.infradead.org, Ondrej Jirman , devicetree@vger.kernel.org, Maxime Ripard , linux-sunxi@googlegroups.com, Liam Girdwood , linux-kernel@vger.kernel.org, Chen-Yu Tsai , Rob Herring List-Id: devicetree@vger.kernel.org --S1BNGpv0yoYahz37 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 25, 2018 at 07:41:35AM +0800, Icenowy Zheng wrote: > =E4=BA=8E 2018=E5=B9=B44=E6=9C=8825=E6=97=A5 GMT+08:00 =E4=B8=8A=E5=8D=88= 1:07:33, Mark Brown =E5=86=99=E5=88=B0: > >On Mon, Apr 23, 2018 at 10:46:56PM +0800, Icenowy Zheng wrote: > >> --- /dev/null > >> +++ b/drivers/regulator/sy8106a-regulator.c > >> @@ -0,0 +1,176 @@ > >> +// SPDX-License-Identifier: GPL-2.0+ > >> +/* > >> + * sy8106a-regulator.c - Regulator device driver for SY8106A > >Just make the entire thing a C++ comment so it looks consistent and > >joined up. > SPDX identifier is special -- it should be in a seperated > comment block. No, it just needs to be a C++ comment on the first line to ease machine parsing. The rest of the file doesn't matter for that. > >> + if (reg & SY8106A_GO_BIT) > >> + return reg & rdev->desc->vsel_mask; > >> + else > >> + return (chip->fixed_voltage - rdev->desc->min_uV) / > >> + rdev->desc->uV_step; > >You could use the standard get_voltage_sel() if you provide a mapping > >operation that set everything with _GO_BIT set to return the fixed > >voltage. Though looking at this it seems that the fixed voltage will > >always be one that could be set via the register anyway so I'm > >wondering > >if the easiest thing here isn't to just have the driver turn off > >_GO_BIT > Do you mean "turn on" here? Yes. --S1BNGpv0yoYahz37 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlrgXhUACgkQJNaLcl1U h9Dz8Af/ShUsBEhUOo12gD3i5rTHC+B7d/vXUVvbpwkxTOs9H+bKL3erRtuIA/mO IbSgSqYjR7PqsVp6IIABDUItbRN2eFVjx/WlxfsHf2WqoXDK0CMq1b8h2I7Z9rd2 3Pg/ETgOEOcG3UG6mal2JuqEPqldetHJoaOAd/k71A4Z4fGmye2fQsHHl80sG5yw Oafndtd2xNyVBaxff0NDNPCpMYPm/SFfCik0tH5VCTAENFqnS7FKkEKJW4Iv0+6+ bObcFF1mDrCzi9rfQPoTh4s+oXyqjwTdlj6jvz9zhmRv9yn5B9CWN/EI/bIvJYkg CwWqSVKCyEZahQL5p4yYkQyR2M+Ufg== =oG+g -----END PGP SIGNATURE----- --S1BNGpv0yoYahz37--