mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: "Miclaus, Antoniu" <Antoniu.Miclaus@analog.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	"Hennerich, Michael" <Michael.Hennerich@analog.com>,
	Jonathan Cameron <jic23@kernel.org>,
	"Sa, Nuno" <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>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] dt-bindings: iio: adc: ad4080: add AD4880 support
Date: Tue, 3 Feb 2026 11:11:56 -0600	[thread overview]
Message-ID: <b920f61a-02f8-4e6f-a2a4-0899d399148f@baylibre.com> (raw)
In-Reply-To: <CY4PR03MB3399D81C92B07FEC8EFA09B19B9BA@CY4PR03MB3399.namprd03.prod.outlook.com>

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().


  reply	other threads:[~2026-02-03 17:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29 15:27 [PATCH 0/2] iio: adc: ad4080: add support for AD4880 dual-channel ADC Antoniu Miclaus
2026-01-29 15:27 ` [PATCH 1/2] dt-bindings: iio: adc: ad4080: add AD4880 support Antoniu Miclaus
2026-01-29 16:20   ` David Lechner
2026-02-03 15:42     ` Miclaus, Antoniu
2026-02-03 17:11       ` David Lechner [this message]
2026-01-29 15:27 ` [PATCH 2/2] iio: adc: ad4080: add support for AD4880 dual-channel ADC Antoniu Miclaus
2026-01-29 15:56   ` Andy Shevchenko
2026-01-29 16:39   ` David Lechner
2026-01-31 18:19   ` Jonathan Cameron

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=b920f61a-02f8-4e6f-a2a4-0899d399148f@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=Antoniu.Miclaus@analog.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=Nuno.Sa@analog.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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®