mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Nicolae-Daniel Deaconescu <Nicolae-daniel.Deaconescu@analog.com>
Cc: sergiu.cuciurean@analog.com, jic23@kernel.org,
	dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	ukleinek@kernel.org, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pwm@vger.kernel.org
Subject: Re: [PATCH 1/2] dt-bindings: iio: adc: add lltc,ltc2387
Date: Mon, 2 Nov 2026 20:35:48 +0000	[thread overview]
Message-ID: <20261102-pursuant-collide-4246c955efef@spud> (raw)
In-Reply-To: <20261102081110.63080-1-Nicolae-daniel.Deaconescu@analog.com>

[-- Attachment #1: Type: text/plain, Size: 6087 bytes --]

On Mon, Nov 02, 2026 at 10:11:10AM +0200, Nicolae-Daniel Deaconescu wrote:
> On Fri, 30 Oct 2026 20:50:11 +0000, Conor Dooley wrote:
> > On Fri, Oct 30, 2026 at 02:02:05PM +0200, Nicolae-Daniel Deaconescu wrote:
> > > On Tue, Oct 27, 2026 at 18:28:34 +0000, Conor Dooley wrote:
> > > > Why are we getting new devices with linear vendor prefixes?
> > >
> > > I'll fix this in v2. The binding file will be adi,ltc2387.yaml.
> > > The -x4 compatibles will also be dropped, because they described
> > > four devices sharing one AXI ADC.
> >
> > Please retain more context than this, it's not enough to just have what
> > you're replying to. I see so many patches that I will have completely
> > forgotten what you're doing by the time I get to the next day.
> 
> My bad, I'll keep more relevant info in my responses from now on.
> 
> > > > Hmm, ltc2387-16 does not appear to have these signals?
> > > > Well, it has "cnv" but "cnv" has "sample clock" as the input name so is
> > > > the clocks property above and pwm-clock can be used if the provider is a
> > > > pwm?
> > >
> > > The LTC2387-16 datasheet has these pins: CNV+/CNV- (pins 27/28), which
> > > is the conversion-start input; CLK+/CLK- (pins 23/24), which is an
> > > externally applied clock that shifts out the result; and DCO+/DCO-,
> > > the echoed clock. There is no clk_gate pin.
> >
> > Then there should not be a clk_gate pwm for this device.
> >
> > > The part needs a burst of 8 CLK pulses per conversion in one-lane mode
> > > (4 in two-lane), starting t_FIRSTCLK = 65 ns after CNV and ending
> > > within t_LASTCLK = 49 ns of the next CNV. So the CLK input cannot run
> > > freely: the clk_gate PWM gates the host clock into that burst. [...]
> > > The clocks property is the reference clock the PWM generator runs
> > > from, and the driver needs its rate to compute the waveforms.
> >
> > Then you've got a "layering" violation of some kind here. If this clock
> > is consumed by the PWM generator, it should be an input to the pwm
> > generator not this adc.
> 
> It IS an input to the PWM generator, The ADC node references the same
> clock only because the driver has to know its rate to compute the CNV
> and CLK waveforms in clock cycles. adi,ad7625.yaml does the same.

Then modify the PWM API to get the information that you need, you should
not be constructing fake relationships in your devicetree to work around
limitations of some subsystem's interface. If you need the information
from a PWM provider for what the minimum period or duty cycle step it can
provide is so that you can use the waveform API correctly, then add that.
I took a quick look at the code you've added and it looks like it'd just
fall over as soon as someone used a PWM provider with a mandatory
divider?

Trevor got lucky that I didn't ask these questions about the ad7625, you
did not.

> > The second pwm should then just be called "clk", because that's the
> > input(s) that it represents.
> 
> I'll rename it to "clk" in v2 and reword the pwms description. ad7625
> uses the name clk_gate for the same signal.
> 
> > I want to see what the dts you have for a complete setup of this device
> > looks like, including the backend and pwm generator.
> 
> This is an ADAQ23878 on a Zedboard, two-lane, with the AXI ADC backend,
> the DMA it uses, and the AXI PWM generator. The 120 MHz ext_clk is what
> the HDL provides to the PWM generator. Supplies are fixed regulators here;
> VS- is 0 V.
> 
> / {
> 	vdd_5v: regulator-vdd-5v {
> 		compatible = "regulator-fixed";
> 		regulator-name = "vdd-5v";
> 		regulator-min-microvolt = <5000000>;
> 		regulator-max-microvolt = <5000000>;
> 		regulator-always-on;
> 	};
> 
> 	vio_2v5: regulator-vio-2v5 {
> 		compatible = "regulator-fixed";
> 		regulator-name = "vio-2v5";
> 		regulator-min-microvolt = <2500000>;
> 		regulator-max-microvolt = <2500000>;
> 		regulator-always-on;
> 	};
> 
> 	vs_p: regulator-vs-p {
> 		compatible = "regulator-fixed";
> 		regulator-name = "vs-p";
> 		regulator-min-microvolt = <5000000>;
> 		regulator-max-microvolt = <5000000>;
> 		regulator-always-on;
> 	};
> 
> 	vs_n: regulator-vs-n {
> 		compatible = "regulator-fixed";
> 		regulator-name = "vs-n";
> 		regulator-min-microvolt = <0>;
> 		regulator-max-microvolt = <0>;
> 		regulator-always-on;
> 	};
> 
> 	vref: regulator-vref {
> 		compatible = "regulator-fixed";
> 		regulator-name = "vref-4v096";
> 		regulator-min-microvolt = <4096000>;
> 		regulator-max-microvolt = <4096000>;
> 		regulator-always-on;
> 	};
> 
> 	clocks {
> 		ext_clk: clock@0 {
> 			#clock-cells = <0>;
> 			compatible = "fixed-clock";
> 			clock-frequency = <120000000>;
> 		};
> 	};
> };
> 
> &fpga_axi {
> 	rx_dma: dma-controller@44a30000 {
> 		compatible = "adi,axi-dmac-1.00.a";
> 		reg = <0x44a30000 0x1000>;
> 		#dma-cells = <1>;
> 		interrupts = <0 57 IRQ_TYPE_LEVEL_HIGH>;
> 		clocks = <&clkc 15>;
> 	};
> 
> 	axi_adc: adc@44a00000 {
> 		compatible = "adi,axi-adc-10.0.a";
> 		reg = <0x44a00000 0x10000>;
> 		dmas = <&rx_dma 0>;
> 		dma-names = "rx";
> 		clocks = <&clkc 15>;
> 		#io-backend-cells = <0>;
> 	};
> 
> 	axi_pwm_gen: pwm@44a60000 {
> 		compatible = "adi,axi-pwmgen-2.00.a";
> 		reg = <0x44a60000 0x1000>;
> 		#pwm-cells = <3>;
> 		clocks = <&clkc 15>, <&ext_clk>;
> 		clock-names = "axi", "ext";
> 	};
> 
> 	adc@0 {
> 		compatible = "adi,adaq23878";
> 		clocks = <&ext_clk>;
> 		io-backends = <&axi_adc>;
> 		pwms = <&axi_pwm_gen 0 0 0>, <&axi_pwm_gen 1 0 0>;
> 		pwm-names = "cnv", "clk";
> 		vdd-supply = <&vdd_5v>;
> 		vio-supply = <&vio_2v5>;
> 		vref-supply = <&vref>;
> 		vs-n-supply = <&vs_n>;
> 		vs-p-supply = <&vs_p>;
> 
> 		adi,gain-milli = /bits/ 16 <870>;
> 		adi,use-two-lanes;
> 	};
> };
> 
> One more thing, on the cover letter Andy asked whether this should be
> done in an existing driver with per-compatible chip data instead.

Dunno, don't care. How the drivers are written has nothing to with me :)

Cheers,
Conor.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-11-02 20:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 13:44 [PATCH 0/2] iio: adc: add LTC2387 and ADAQ2387x support Nicolae-Daniel Deaconescu
2026-10-27 13:44 ` [PATCH 1/2] dt-bindings: iio: adc: add lltc,ltc2387 Nicolae-Daniel Deaconescu
2026-10-27 18:28   ` Conor Dooley
2026-10-30 12:02     ` Nicolae-Daniel Deaconescu
2026-10-30 20:50       ` Conor Dooley
2026-11-02  8:11         ` Nicolae-Daniel Deaconescu
2026-11-02 20:35           ` Conor Dooley [this message]
2026-10-29  9:47   ` Krzysztof Kozlowski
2026-10-30 12:02     ` Nicolae-Daniel Deaconescu
2026-10-30 12:07       ` Krzysztof Kozlowski
2026-10-30 12:37         ` Nicolae-Daniel Deaconescu
2026-10-27 13:44 ` [PATCH 2/2] iio: adc: add ltc2387 driver Nicolae-Daniel Deaconescu
2026-10-27 14:37   ` Joshua Crofts
2026-10-28  2:39   ` Jonathan Cameron
2026-10-30 12:02     ` Nicolae-Daniel Deaconescu
2026-10-30 13:22     ` Nicolae-Daniel Deaconescu
2026-10-27 15:56 ` [PATCH 0/2] iio: adc: add LTC2387 and ADAQ2387x support Andy Shevchenko
2026-10-30 10:08   ` Nicolae-Daniel Deaconescu
2026-10-30 14:41     ` Andy Shevchenko
2026-10-30 15:07       ` Nicolae-Daniel Deaconescu
2026-10-31  8:36         ` Andy Shevchenko

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=20261102-pursuant-collide-4246c955efef@spud \
    --to=conor@kernel.org \
    --cc=Nicolae-daniel.Deaconescu@analog.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=linux-pwm@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    --cc=sergiu.cuciurean@analog.com \
    --cc=ukleinek@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®