mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Kurt Borja" <kuurtb@gmail.com>
To: "Andy Shevchenko" <andriy.shevchenko@intel.com>,
	"Kurt Borja" <kuurtb@gmail.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 03/10] iio: adc: add the ti-ads1262 driver
Date: Sun, 06 Sep 2026 17:15:50 -0300	[thread overview]
Message-ID: <DL8ICXL9YZ52.2N7SL1NG0LV5B@gmail.com> (raw)
In-Reply-To: <apFCNNzhPfq0T6rn@ashevche-desk.local>

On Fri Aug 28, 2026 at 5:09 AM -03, Andy Shevchenko wrote:
> On Fri, Aug 28, 2026 at 01:38:18AM -0500, Kurt Borja wrote:
>> Add the ti-ads1262 driver with initial support for the primary ADC
>> (ADC1). The ADS1263 auxiliary ADC (ADC2) is handled by a separate driver
>> and interoperability considerations were taken into account.
>> 
>> Various features such as accurate timeout delays, per-channel reference
>> sources, scale, offset, settling latency, excitation currents and
>> diagnostics are intentionally left out for future support.
>
> ...
>

...

>> +static int ads1262_dev_send_cmd(struct ads1262 *st, u8 opcode)
>> +{
>> +	guard(mutex)(&st->xfer_lock);
>> +
>> +	return spi_write_then_read(st->spi, &opcode, sizeof(opcode), NULL, 0);
>> +}
>> +
>> +static int ads1262_dev_read_by_cmd(struct ads1262 *st, u8 cmd, __be32 *val)
>> +{
>> +	guard(mutex)(&st->xfer_lock);
>> +
>> +	return spi_write_then_read(st->spi, &cmd, sizeof(cmd), val, sizeof(*val));
>> +}
>
> How do these do not conflict or race with regmap SPI communication?

No because the regmap interface only covers registers accesible by the
WREG (write) and RREG (read) commands. The data holding register is
accessed by a different command (OPCODE) RDATA1/RDATA2.

>
> ...
>
>> +static int ads1262_dev_reset(struct ads1262 *st)
>> +{
>> +	struct device *dev = &st->spi->dev;
>> +	struct gpio_desc *reset_gpiod;
>> +	int ret;
>> +
>> +	reset_gpiod = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
>> +	if (IS_ERR(reset_gpiod))
>> +		return dev_err_probe(dev, PTR_ERR(reset_gpiod),
>> +				     "failed to get reset GPIO\n");
>
>> +
>
> Unneeded blank line. But can you use reset-gpio driver instead?

I'll look into reset-gpio. But I think it may not be worth to use it
because it may not change much here. We'd still need to manage these
timing constraints and we also only use this GPIO in the probe anyway.

...

>> +static int ads1262_parse_channel_node(struct ads1262 *st,
>> +				      struct iio_chan_spec *spec,
>> +				      struct fwnode_handle *node)
>> +{
>> +	struct device *dev = &st->spi->dev;
>> +	u32 pins[2];
>> +	int ret;
>
> Can this use the property names for 'single-channel' and 'diff-channels'?
> This will deduplicate the same in a few places and reduce potential typos.

You mean storing the property name in a variable? Sure.

...

>> +	st->clk_rate = rate ? rate : ADS1262_NOMINAL_CLK_RATE;
>
> Can use Elvis.

I'm not really sure what you meant here.

...

Thanks Andy! I'll address the rest of the comments too.

-- 
Thanks,
 ~ Kurt

  reply	other threads:[~2026-09-06 20:15 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28  6:38 [PATCH v4 00/10] iio: adc: Add TI ADS126X ADC family support Kurt Borja
2026-08-28  6:38 ` [PATCH v4 01/10] dt-bindings: adc: add excitation-current-chopping property Kurt Borja
2026-08-28 16:33   ` Conor Dooley
2026-08-28  6:38 ` [PATCH v4 02/10] dt-bindings: iio: adc: support the TI ADS126x ADC family Kurt Borja
2026-08-28 16:39   ` Conor Dooley
2026-08-30  1:57     ` Jonathan Cameron
2026-08-31 16:24       ` Conor Dooley
2026-09-01  3:01         ` Jonathan Cameron
2026-09-06 20:16     ` Kurt Borja
2026-08-30  1:53   ` Jonathan Cameron
2026-09-06 20:16     ` Kurt Borja
2026-08-31 19:44   ` David Lechner
2026-09-06 20:17     ` Kurt Borja
2026-08-28  6:38 ` [PATCH v4 03/10] iio: adc: add the ti-ads1262 driver Kurt Borja
2026-08-28  8:09   ` Andy Shevchenko
2026-09-06 20:15     ` Kurt Borja [this message]
2026-09-08 10:01       ` Andy Shevchenko
2026-08-31 20:22   ` David Lechner
2026-09-01  3:07     ` Jonathan Cameron
2026-09-06 20:17     ` Kurt Borja
2026-09-10  2:43       ` Jonathan Cameron
2026-08-28  6:38 ` [PATCH v4 04/10] iio: adc: ti-ads1262: support per-channel sampling frequency Kurt Borja
2026-08-30  1:36   ` Jonathan Cameron
2026-09-06 20:16     ` Kurt Borja
2026-08-30  2:22   ` Jonathan Cameron
2026-09-06 20:17     ` Kurt Borja
2026-08-28  6:38 ` [PATCH v4 05/10] iio: adc: ti-ads1262: support per-channel reference and gain Kurt Borja
2026-08-28  6:38 ` [PATCH v4 06/10] iio: adc: ti-ads1262: support input chopping Kurt Borja
2026-08-28  6:38 ` [PATCH v4 07/10] iio: adc: ti-ads1262: support excitation currents Kurt Borja
2026-08-28  6:38 ` [PATCH v4 08/10] iio: adc: ti-ads1262: support triggered buffer sampling Kurt Borja
2026-08-28  6:38 ` [PATCH v4 09/10] iio: adc: ti-ads1262: support REFOUT and VBIAS regulators Kurt Borja
2026-08-28  6:38 ` [PATCH v4 10/10] iio: adc: ti-ads1262: support common mode supplies Kurt Borja

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=DL8ICXL9YZ52.2N7SL1NG0LV5B@gmail.com \
    --to=kuurtb@gmail.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@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

all inboxes | Powered by JetHome®