devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herve Codina <herve.codina@bootlin.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH 2/3] iio: potentiometer: Add support for the Renesas X9250 potentiometers
Date: Thu, 20 Apr 2023 17:55:52 +0200	[thread overview]
Message-ID: <20230420175552.58b15819@bootlin.com> (raw)
In-Reply-To: <85e214c8-b639-5197-70a1-7279f9418f66@metafoo.de>

On Thu, 20 Apr 2023 06:47:32 -0700
Lars-Peter Clausen <lars@metafoo.de> wrote:

> On 4/20/23 05:13, Herve Codina wrote:
> > The Renesas X9250 integrates four digitally controlled potentiometers.
> > On each potentiometer, the X9250T has a 100 kOhms total resistance and
> > the X9250U has a 50 kOhms total resistance.
> >
> > Signed-off-by: Herve Codina <herve.codina@bootlin.com>  
> 
> Hi,
> 
> Looks perfect! Just one small comment.
> 
> > +static int x9250_write8(struct x9250 *x9250, u8 cmd, u8 val)
> > +{
> > +	struct spi_transfer xfer = {
> > +		.tx_buf = &x9250->spi_tx_buf,
> > +		.len = 3,
> > +	};
> > +	int ret;
> > +
> > +	BUILD_BUG_ON(sizeof(x9250->spi_tx_buf) < 3);
> > +
> > +	mutex_lock(&x9250->lock);
> > +
> > +	x9250->spi_tx_buf[0] = 0x50;  
> The 0x50 shows up as a magic constant in multiple places, a define for 
> it would be nice.

Sure, a define will be present in next iteration.

> > +	x9250->spi_tx_buf[1] = cmd;
> > +	x9250->spi_tx_buf[2] = val;
> > +
> > +	ret = spi_sync_transfer(x9250->spi, &xfer, 1);
> > +
> > +	mutex_unlock(&x9250->lock);
> > +
> > +	return ret;
> > +}  

Thanks for the review,
Hervé

-- 
Hervé Codina, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2023-04-20 15:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-20 12:13 [PATCH 0/3] Add the Renesas X9250 potentiometers IIO support Herve Codina
2023-04-20 12:13 ` [PATCH 1/3] dt-bindings: iio: potentiometer: Add the Renesas X9250 potentiometers Herve Codina
2023-04-21  7:32   ` Krzysztof Kozlowski
2023-04-21  8:01     ` Herve Codina
2023-04-20 12:13 ` [PATCH 2/3] iio: potentiometer: Add support for " Herve Codina
2023-04-20 13:47   ` Lars-Peter Clausen
2023-04-20 15:55     ` Herve Codina [this message]
2023-04-20 12:13 ` [PATCH 3/3] MAINTAINERS: add the Renesas X9250 driver entry Herve Codina

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=20230420175552.58b15819@bootlin.com \
    --to=herve.codina@bootlin.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    /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).