From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f49.google.com (mail-oo1-f49.google.com [209.85.161.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1E9C3D646B for ; Tue, 3 Feb 2026 17:11:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770138722; cv=none; b=grg87zEB9WKukhLdyVyUGdYhbBo0C3uWIfNfBTMF088jcRp4olW4oIo8GY7pRgKncX+ZXCaPyT4zXRlK3+QlkD4g/mql4WO0lIBFzPGNtgk9aSiKAeVCnwjTjhR0UuvbTE9ijt6+HdW8r75f/ipD8KWIxhkDm29QQZKB/E+9CZI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770138722; c=relaxed/simple; bh=KvVwtGkYOu5PUrbVCouPvp9ISvZPAAdo9DySfRKviFM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ROKEVbfmLNRxDki7R7ZZFt7+w/fivilRZq3A3o8YOk3p0RRR2gEN44edwlVU9jTyCXZmZEoG3E1EiRLKpW/2CLDVDuJCMTXUZfQGOZqhVKpzFbw0yd+lkiscOvhoG8rnft0bxfczEdtvqaptt6sxJ4oLTT9Pne+wY0nKuubMHCc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=E833CbFG; arc=none smtp.client-ip=209.85.161.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="E833CbFG" Received: by mail-oo1-f49.google.com with SMTP id 006d021491bc7-6610b05b37dso4742789eaf.2 for ; Tue, 03 Feb 2026 09:11:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1770138718; x=1770743518; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Wy/dNsn4u7o/hART3NmXV1T9kIccTcgOCggRGW81zXY=; b=E833CbFG9bS7eGRz7RDodJUaeg7rVgQjtpwzJmr8FoEOt3kRviZf6HAPTNjzckqfTd ZAc7XJVGXdS8Idexo6B/8WeeIWWwO5UYI0JYCmGTo4V6Yf4i9MUCkq557tLkY4icQWLD 2vhg8Ey83A5wqCkDzmbbQzSgzvR+wP0p2sckynfWOtxw51DJAAF4fc7qiE8FywZ6JhJG N/5xZa9X+hMdwN6L0SaAfcU5sAIQNw/85kU5lTH7HkHYK7GvlLw9j6O+eigfiCe6aLmz DkBNB4u5Cxe1hb8ILGJP8bM29Z/unudho4TJB7JOqyjUymHVT5HIdtelMvMtCWMOh5hK SyIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770138718; x=1770743518; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Wy/dNsn4u7o/hART3NmXV1T9kIccTcgOCggRGW81zXY=; b=je8ElIU/oMpoPKcUsZIM/C/cs8PrRNvtx2HBbXjdrd9SnDQJ8GUJgsA9bvJO4HV1u8 w64gXipADbWJIudhzYgJtIcvbu+BFMSOYQAUGpSJS0N4Oq6fhbbW91ojt0/Pqgrp8GV1 ifxxVMtRDOvb4m80ti8qe0/yhc6IhP0rPk+ujqw2Tz42u8PEUR7o+hHuX73rEpksqH/n 00goBSQ+MLN68P2h3es5ZfW1XuQAj+Wb6CJ3TS9PzP6W5Zo8hs0rCUfbXle9xagwuYam Y7Kr+Kkre87lED8u27LlBX5SEgFGKfqwkA3HdtCktnSEHZjoR9FjaRiPmIo3PhHDVVLs PUug== X-Forwarded-Encrypted: i=1; AJvYcCW1kxyQ3t0Z+a7UCGu7oBRsTTilQCdgQQ6srzXmnhIwSqoAzH9fo12SB4+NP4I8jCa4TrbvoLLguLlZVYg=@vger.kernel.org X-Gm-Message-State: AOJu0Yz/T3sYpi7pqWOJPGu55GMC7evjoD4SawxqJ9MkBBA/2RlDbHJo oo5yeJn/QHry16NOqPD0J2phHprtnizs0Oqg17XQ9FJbgvO858RXBnAcMbmNLoc1LEc= X-Gm-Gg: AZuq6aJ5WcMKEOT0sxmdWsgimfzb0eJeWPiVp3GXIgboMggg+5s6fd5HR8haC2ZgSpK SpDwkU15bBbz5kgzeAh/lyOA8Nwwin+cIaiWI5YIYr5HBaFpKJHbwLsOahAALcWzKWSeoCe8qM3 OPRmxSDY5d8NxT4XzJlxdlJ8nuTyEpGQSX/tneG/OJ4xokZrLAVNv7aFdPDVg+6gVCxa3uELJWU M5ub4/wU1NXQ4r4pWy82AroTDt0KwbbyiPQclFUPTVBv5kctIvbissWm+9QMGU2l/L9+V9cGP4s 9cV1yVvlQ7OHUQ/29g7OkgKt0Y7pfJiXl0U3d7TR60+WO0ZB74/4RMAHFmNRAkue6WcQ8iqE415 wm4ErLwlYepZNYPrdJuDd7EfatXDiRUJKgYqgzB7RuifJwQygpXgd3J5l4t2pFCl7SSukiAvl/A p5xKy3Zqg7S8KVpVa+PYwDs0MVGtg61IKzWQE6vM4R0w28XAzjCUnVRqE= X-Received: by 2002:a05:6820:a01:b0:65b:257b:a898 with SMTP id 006d021491bc7-66a210468f5mr148431eaf.29.1770138717633; Tue, 03 Feb 2026 09:11:57 -0800 (PST) Received: from ?IPV6:2600:8803:e7e4:500:8e13:880:992:e796? ([2600:8803:e7e4:500:8e13:880:992:e796]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-66a35f7a4besm27682eaf.17.2026.02.03.09.11.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Feb 2026 09:11:57 -0800 (PST) Message-ID: Date: Tue, 3 Feb 2026 11:11:56 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] dt-bindings: iio: adc: ad4080: add AD4880 support To: "Miclaus, Antoniu" Cc: Lars-Peter Clausen , "Hennerich, Michael" , Jonathan Cameron , "Sa, Nuno" , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "linux-iio@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20260129152731.154368-1-antoniu.miclaus@analog.com> <20260129152731.154368-2-antoniu.miclaus@analog.com> <5d2e85cd-caa2-43a6-a451-3b822bd0ef01@baylibre.com> Content-Language: en-US From: David Lechner In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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().