[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b920f61a-02f8-4e6f-a2a4-0899d399148f@baylibre.com>
Date: Tue, 3 Feb 2026 11:11:56 -0600
From: David Lechner <dlechner@...libre.com>
To: "Miclaus, Antoniu" <Antoniu.Miclaus@...log.com>
Cc: Lars-Peter Clausen <lars@...afoo.de>,
"Hennerich, Michael" <Michael.Hennerich@...log.com>,
Jonathan Cameron <jic23@...nel.org>, "Sa, Nuno" <Nuno.Sa@...log.com>,
Andy Shevchenko <andy@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, "linux-iio@...r.kernel.org"
<linux-iio@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] dt-bindings: iio: adc: ad4080: add AD4880 support
On 2/3/26 9:42 AM, Miclaus, Antoniu wrote:
> ...
...
>>> @@ -98,4 +127,22 @@ examples:
>>> io-backends = <&iio_backend>;
>>> };
>>> };
>>> + - |
>>> + spi {
>>> + #address-cells = <1>;
>>> + #size-cells = <0>;
>>> +
>>> + adc@0 {
>>> + compatible = "adi,ad4880";
>>> + reg = <0>;
>>> + adi,aux-spi-cs = <1>;
>>
>> We can already have multiple reg for a multiple CS device.
>>
>> reg = <0>, <1>;
>>
>> So we shouldn't need a new adi,aux-spi-cs property for that.
>
> Sure, that was the initial plan but for some reason going for multiple regs gets me to this:
>
> [ 11.396833] spi_new_ancillary_device from ad4080_probe+0x4b8/0x5a4
> [ 11.396861] ad4080_probe from really_probe+0xc8/0x2c8
> [ 11.397281] ad4080 spi1.0: chipselect 1 already in use
> [ 11.397297] ad4080 spi1.0: failed to register ancillary device
> [ 11.397317] ad4080 spi1.0: probe with driver ad4080 failed with error -16
>
> While the aux-spi-cs works fine. Any tips?
The one existing user of spi_new_ancillary_device() used the multiple
regs like I suggested. So I wonder if that is broken too. The changes
for multiple CS for SPI parallel memories in the SPI core was made 2
years after that driver was added. So I could see how it could have
been broken without anyone noticing.
I didn't look at it too deeply yet. But my guess is that we need to
modify __spi_add_device() to change how it verifies the chip select.
If it is being called from spi_add_device(), don't change the behavior.
If it is being called from spi_new_ancillary_device(), then the
chip select should be verified as one assigned to the main device
rather than verifying that it is unused. I.e. don't call spi_dev_check_cs().
Powered by blists - more mailing lists