Received: by 10.223.176.5 with SMTP id f5csp2646043wra; Mon, 29 Jan 2018 01:29:09 -0800 (PST) X-Google-Smtp-Source: AH8x225JiwoYtp512fvDkdDvW/Yl7dYxgU5NXU7g5H3sgwpSmIm7i3IMIBPgL2zvmJHhNPhK3v3U X-Received: by 2002:a17:902:9a41:: with SMTP id x1-v6mr14628620plv.256.1517218149606; Mon, 29 Jan 2018 01:29:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517218149; cv=none; d=google.com; s=arc-20160816; b=q40K+F3CU2glC+ST7h1ZfRkqU+A68XmCYTDwsgzqRvrd4akrIWLr04a+JlGHjWWenF uI9gagPD4rsJiLrAcm0NSUA+JRqk2OTNV8zlloLecPDT5JvpMC6jtWh2UcOnV1Gkt0JW YXdEvq/gLtt9eS7zbzjaRux5S20fWRyoENse6Uo2SidCCCW/BZ4tGabFwkLgQ3ookjAR IC6JVzpc9nDWGWnNhoabqHnTR5Rt6dwBVQkYFBKvHEPx7vA+51vBdLYKu2bnS6AmyPbs d976YGSkFoqvtgz/cdplcrpumDS9MiRC2kN0DRwGyqt8yyMGz/+pYHM2QBnY9eId9f5N CvYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=DKByZdvtPJuR/Nu5yNatgiOVMI+/923j1LYYmDjJDKc=; b=OwKyAUpdUoNe0P7ghw16Cy3Z/KCrfIoxvLWwNnml1tktiP+i4/eAiBZlX7DerDaJZ8 zqU8L7VA6fNfEvRe+9gMaRYeVKf0vwkByuD/V3qKKQHqJmupddZc+aPlkq/+sGtkP8Qf 24crqpGQkBLppYttSYmX1ziSrrVY56zlwUcylyConkS2dzPcvuAtTuV5IuK3Lzek/tuN eSwqZUJIGj8w4PY7WwLDC/DA62jCCAQ5MySvMqTk0myLALI+C2bcSjVznNn08sfHGI7k FELTXUQ9D+t8p6gEb9/fjXyo7lsF4OSLDDbqp3Tnj7T5Ob4KgK+g0kRnWcdFn0JQQmBe iS9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w191si7054992pgd.647.2018.01.29.01.28.55; Mon, 29 Jan 2018 01:29:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751251AbeA2J1z (ORCPT + 99 others); Mon, 29 Jan 2018 04:27:55 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:57960 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750913AbeA2J1w (ORCPT ); Mon, 29 Jan 2018 04:27:52 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 13B2621992; Mon, 29 Jan 2018 10:27:50 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id D2617205F3; Mon, 29 Jan 2018 10:27:39 +0100 (CET) Date: Mon, 29 Jan 2018 10:27:39 +0100 From: Maxime Ripard To: Philipp Rossak Cc: lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org, linux@armlinux.org.uk, jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, davem@davemloft.net, hans.verkuil@cisco.com, mchehab@kernel.org, rask@formelder.dk, clabbe.montjoie@gmail.com, sean@mess.org, krzk@kernel.org, quentin.schulz@free-electrons.com, icenowy@aosc.io, edu.molinas@gmail.com, singhalsimran0@gmail.com, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: Re: [PATCH v2 04/16] iio: adc: sun4i-gpadc-iio: rework: sampling start/end code readout reg Message-ID: <20180129092739.665yh3k7pb3ty33u@flea.lan> References: <20180128232919.12639-1-embed3d@gmail.com> <20180128232919.12639-5-embed3d@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jqu6ox75l5ldjemb" Content-Disposition: inline In-Reply-To: <20180128232919.12639-5-embed3d@gmail.com> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --jqu6ox75l5ldjemb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon, Jan 29, 2018 at 12:29:07AM +0100, Philipp Rossak wrote: > For adding newer sensor some basic rework of the code is necessary. >=20 > This commit reworks the code and allows the sampling start/end code and > the position of value readout register to be altered. Later the start/end > functions will be used to configure the ths and start/stop the > sampling. >=20 > Signed-off-by: Icenowy Zheng > Signed-off-by: Philipp Rossak That signed-off-by chain doesn't really make much sense. If Icenowy is the author, she should be reported as such in the commit, and if you're the author, you shouldn't have her Signed-off-by. > --- > drivers/iio/adc/sun4i-gpadc-iio.c | 44 +++++++++++++++++++++++++++++++++= +----- > 1 file changed, 39 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gp= adc-iio.c > index 03804ff9c006..db57d9fffe48 100644 > --- a/drivers/iio/adc/sun4i-gpadc-iio.c > +++ b/drivers/iio/adc/sun4i-gpadc-iio.c > @@ -49,6 +49,15 @@ static unsigned int sun6i_gpadc_chan_select(unsigned i= nt chan) > return SUN6I_GPADC_CTRL1_ADC_CHAN_SELECT(chan); > } > =20 > +struct sun4i_gpadc_iio; > + > +/* > + * Prototypes for these functions, which enable these functions to be > + * referenced in gpadc_data structures. > + */ > +static int sun4i_gpadc_sample_start(struct sun4i_gpadc_iio *info); > +static int sun4i_gpadc_sample_end(struct sun4i_gpadc_iio *info); > + > struct gpadc_data { > int temp_offset; > int temp_scale; > @@ -56,6 +65,9 @@ struct gpadc_data { > unsigned int tp_adc_select; > unsigned int (*adc_chan_select)(unsigned int chan); > unsigned int adc_chan_mask; > + unsigned int temp_data; > + int (*sample_start)(struct sun4i_gpadc_iio *info); > + int (*sample_end)(struct sun4i_gpadc_iio *info); > }; > =20 > static const struct gpadc_data sun4i_gpadc_data =3D { > @@ -65,6 +77,9 @@ static const struct gpadc_data sun4i_gpadc_data =3D { > .tp_adc_select =3D SUN4I_GPADC_CTRL1_TP_ADC_SELECT, > .adc_chan_select =3D &sun4i_gpadc_chan_select, > .adc_chan_mask =3D SUN4I_GPADC_CTRL1_ADC_CHAN_MASK, > + .temp_data =3D SUN4I_GPADC_TEMP_DATA, You can use a regmap_field there. Thanks! Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --jqu6ox75l5ldjemb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAlpu6QsACgkQ0rTAlCFN r3TZKg/9HMOqsd8TyBWWysudAFjlZWVH5vlaPIV/6T4i+29PaX3Gz0JAR1yNDYlh C3T3B9DWFaOtdeX0pPpWd+XguHQwRjvRtF03D5WuC9mnSzRIeNuzxPT92sAbzvqz 7WL/l1a6H8SqFM0ePYCiYwH8Hjs8L9awH1zYNDxP32E7r6Z5WoafQ7FYhOM9tlg+ 06KIo1E+mQYEN0LtC5qwq35kP+gdLN+XV/St9giekyDLQtFU3AmLMUGcV+CJn4Sc 8Evq7lmFC/P0icQPSF6fgc+d/s+4QyavRV9GI5q0NdZOawWy6QDlewjO/x3o7qfL R3RmIZrgldmyNcKwSg/F26qRYQAjJmBjCSzpywl6otcX8GdfyvfS7ok2BBpJSUN/ k9riR/7CdFk0yx85s6oIFpuSpEyGViZfKWtTllQcyKy8o2082SgpfdjhHXz3sWf6 kx+R9UNfupRnhWiiFkpPOWxyHj4IiFvlTJqN6HX3siBr+nuJ+VWN8NkWfElRp3Ae YY5cs/E6oQpN2ayHgJqjZEhGEG9l2+WY+Q0PPo4KwB46rA9jSrodX4fyGns4qBUe q+QBZHNEgx56BwNH31taP0zBQS0OISKlly4AWLLZEHFpdp2OpL0ZREbTukolFcD4 ga8sCsVD0u5aMyTR2IbqZH351cltLtDlbKaVcZWso/R49ejhExg= =C5JJ -----END PGP SIGNATURE----- --jqu6ox75l5ldjemb--