Devicetree
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Prabhakar <prabhakar.csengg@gmail.com>
Cc: "Cosmin Tanislav" <cosmin-gabriel.tanislav.xa@renesas.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Philipp Zabel" <p.zabel@pengutronix.de>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Magnus Damm" <magnus.damm@gmail.com>,
	linux-iio@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Prabhakar <prabhakar.csengg+renesas@gmail.com>,
	"Biju Das" <biju.das.jz@bp.renesas.com>,
	"Fabrizio Castro" <fabrizio.castro.jz@renesas.com>,
	"Lad Prabhakar" <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: Re: [PATCH 8/8] iio: adc: rzt2h: Add support for RZ/V2H(P) SoC
Date: Wed, 30 Sep 2026 12:35:22 +0300	[thread overview]
Message-ID: <arzX2pzq_0JreVJe@ashevche-desk.local> (raw)
In-Reply-To: <20260929124248.237032-9-prabhakar.mahadev-lad.rj@bp.renesas.com>

On Tue, Sep 29, 2026 at 01:42:48PM +0100, Prabhakar wrote:

> Add support for the ADC found on the Renesas RZ/V2H(P) SoC, which shares
> the RZ/T2H ADC IP but differs in channel count, sampling, calibration and
> resolution support.
> 
> The RZ/V2H(P) ADC provides 8 channels, has a fixed conversion time of
> 20 ADCLK cycles, does not support calibration, and supports selectable
> 12-bit and 8-bit conversion resolution.
> 
> Expose the fixed sampling frequency as a read-only attribute and allow
> the conversion resolution to be changed through the scale attribute.
> Use extended scan types so the reported scan type follows the selected
> resolution, and prevent resolution changes while buffered capture is
> active.

...

>  	help
>  	  Say yes here to build support for the ADC found in Renesas
> -	  RZ/T2H / RZ/N2H SoCs.
> +	  RZ/T2H / RZ/N2H (and similar SoCs).

This wording is good for the summary above, but here please list what the
similar SoCs are. Something like

	in Renesas SoCs:
	- RZ/N2H
	- RZ/T2H
	- ...specify "similar SoCs" here...

>  	  To compile this driver as a module, choose M here: the
>  	  module will be called rzt2h_adc.

...

> +static int rzt2h_adc_write_scale(struct iio_dev *indio_dev,
> +				 struct iio_chan_spec const *chan,
> +				 int val, int val2)
> +{
> +	struct rzt2h_adc *adc = iio_priv(indio_dev);
> +	unsigned int i;
> +	u64 scale;
> +	u32 rem;
> +
> +	if (!(adc->chip_info->features & RZT2H_ADC_FEATURE_RES_SELECT))
> +		return -EINVAL;
> +
> +	for (i = 0; i < chan->num_ext_scan_type; i++) {
> +		scale = (u64)RZT2H_ADC_VREF_MV * NANO >>
> +			chan->ext_scan_type[i].realbits;
> +		if (div_u64_rem(scale, NANO, &rem) == val && rem == val2)
> +			break;
> +	}

> +

Blank line here is not needed.

> +	if (i == chan->num_ext_scan_type)
> +		return -EINVAL;
> +
> +	/* The scan type changes with the resolution. */
> +	IIO_DEV_ACQUIRE_DIRECT_MODE(indio_dev, claim);
> +	if (IIO_DEV_ACQUIRE_FAILED(claim))
> +		return -EBUSY;
> +
> +	adc->resolution = i;
> +
> +	return 0;
> +}

...

> +	case IIO_CHAN_INFO_SCALE:
> +		*vals = rzv2h_adc_scale_avail;
> +		*type = IIO_VAL_FRACTIONAL_LOG2;
> +		*length = ARRAY_SIZE(rzv2h_adc_scale_avail);

Check if array_size.h is included.

> +		return IIO_AVAIL_LIST;

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-09-30  9:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 12:42 [PATCH 0/8] Add ADC support for RZ/V2H(P) and RZ/V2N SoCs Prabhakar
2026-09-29 12:42 ` [PATCH 1/8] dt-bindings: iio: adc: renesas,r9a09g077-adc: Add RZ/V2H(P) and RZ/V2N support Prabhakar
2026-09-29 12:42 ` [PATCH 2/8] iio: adc: rzt2h: Wait for the analog part to stop after a forced stop Prabhakar
2026-09-29 12:51   ` sashiko-bot
2026-09-30  9:23   ` Andy Shevchenko
2026-09-30 16:45     ` Lad, Prabhakar
2026-09-29 12:42 ` [PATCH 3/8] iio: adc: rzt2h: Add chip-specific configuration Prabhakar
2026-09-30  9:26   ` Andy Shevchenko
2026-09-30 16:59     ` Lad, Prabhakar
2026-09-29 12:42 ` [PATCH 4/8] iio: adc: rzt2h: Add optional reset support Prabhakar
2026-09-29 12:58   ` sashiko-bot
2026-09-29 12:42 ` [PATCH 5/8] iio: adc: rzt2h: Prepare for SoCs without sample state registers Prabhakar
2026-09-29 12:42 ` [PATCH 6/8] iio: adc: rzt2h: Prepare for SoCs with different ADC info Prabhakar
2026-09-29 12:42 ` [PATCH 7/8] iio: adc: rzt2h: Use scan type for ADC scale Prabhakar
2026-09-30  9:28   ` Andy Shevchenko
2026-09-30 17:03     ` Lad, Prabhakar
2026-09-29 12:42 ` [PATCH 8/8] iio: adc: rzt2h: Add support for RZ/V2H(P) SoC Prabhakar
2026-09-30  9:35   ` Andy Shevchenko [this message]
2026-09-30 17:14     ` Lad, Prabhakar

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=arzX2pzq_0JreVJe@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=conor+dt@kernel.org \
    --cc=cosmin-gabriel.tanislav.xa@renesas.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=fabrizio.castro.jz@renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=p.zabel@pengutronix.de \
    --cc=prabhakar.csengg+renesas@gmail.com \
    --cc=prabhakar.csengg@gmail.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.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