Re: [PATCH v4 1/2] dt-bindings: iio: adc: ti,ads112c04: Add binding for ADS112C04
Conor Dooley <[email protected]>
| Newsgroups | org.kernel.vger.linux-iio,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <20260812-kindness-compactly-2c3f5bb1f0a2@spud> |
On Wed, Aug 12, 2026 at 05:11:35AM +0100, Jonathan Cameron wrote: > On Wed, 12 Aug 2026 10:53:57 +0800 > Kyle Hsieh <[email protected]> wrote: > > > Hi Conor, > > > > On Wed, Aug 12, 2026 at 12:56 AM Conor Dooley <[email protected]> wrote: > > > > > > On Tue, Aug 11, 2026 at 10:48:37AM +0800, Kyle Hsieh wrote: > > > > Add device tree binding documentation for Texas Instruments ADS112C04 > > > > I2C Analog-to-Digital Converters. > > > > > > > > These devices provide 4-channel, 16-bit delta-sigma ADCs with an I2C > > > > interface, programmable gain amplifier (PGA), and data-ready (DRDY) > > > > interrupt output. > > > > > > > > The binding uses child nodes to dynamically define the connected > > > > single-ended or differential channels. > > > > > > > > Excitation current, burn-out current, and reference source properties > > > > are also included to fully describe the chip's hardware capabilities, > > > > aligned with the ti,ads112c14 binding conventions. > > > > > > > > Signed-off-by: Kyle Hsieh <[email protected]> > > > > > > > +patternProperties: > > > > + "^channel@[0-9a-b]$": > > > > + $ref: adc.yaml > > > > + unevaluatedProperties: false > > > > + properties: > > > > + reg: > > > > + items: > > > > + - maximum: 11 > > > > + > > > > + single-channel: > > > > + maximum: 3 > > > > > > Can someone explain to me please why the maximum for this is 3 when reg > > > goes up to 11? What do the additional reg entries beyond 3 represent? > > reg here is just an index for the channel node, not an input pin number. > > The chip has 12 usable input MUX settings (8 differential pairs and 4 > > single-ended inputs), so at most 12 channel nodes can be described, > > hence maximum 11. > > > > single-channel refers to the physical analog input pin, and the chip > > only has AIN0-AIN3, hence maximum 3. > > Exactly as Kyle described - there is no right way to match reg to a property > when we have mix of single-channel and diff-channels. Hence in this > one corner case reg is just a magic number - though it may reflect > ordering of channel acquisition I guess, though we've never documented > that requirement in a binding. > > We could restrict the differential to be only one direction which would > give max 10 channels (4 single then 0-1, 0-2, 0-3, 1-2, 1-3, 2-3) > but there isn't a huge advantage in doing so even though it is trivial > for software to flip the sign if other direction is wanted. > > Note that we don't actually expect to see all the channels configured, > it can just be a useful to do things like single ended voltage at > top of a resistor and differential across the resistor (to get > allow current to be computed) - so it's not unheard to to mix > and match. This kinda thing is what I expected, I just was not sure. I forget if I have to: Acked-by: Conor Dooley <[email protected]> pw-bot: not-applicable
signature.asc
(application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCanyZZQAKCRB4tDGHoIJi 0jJHAQDtcfyRPQeJETfGXjlpUbDiXXZy+m3P0p18QaAAVF6/CAD/RjAzKYxDuwfT L1Lxy/mKUlSoi+wMKX/0y2W1n/+RegI= =WHG1 -----END PGP SIGNATURE-----