From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) (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 22E802459E7 for ; Sun, 15 Feb 2026 23:16:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771197414; cv=none; b=ZlzG49TyJdpXhXoNTHntEHTJILqI8ADwn3zq/AjKWcH3MqZ+3yewrQd2ecuO/cX2r1fl28WMK7DcilVb/jm+OF3y9LWmowk6cxxEZSw3nrJGjFv5eVEcEihZRqmFnHI7XRM1THZvFDYRcFS20TbfT3VTuacokamEUTBoCNI5izo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771197414; c=relaxed/simple; bh=IIxZfD2J0H7/pfKT+MMLWR55fWvYhFDMw9U/IiMvqyQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=CxsZUA+YxS5DtdQ2MKbITdznB1hm0mM76gWK3ATlyG2120m0agvNjvMg2etwnRKD1XayOnblzabFtDIqsuA10zbR4Io1UuL/AT8PB4bIlhWr4s9kBntx/RM3jNZPkMgHDxv+NnbrjPICb/ZcwECrU9d7+Rkn9zda14DYMSeaCm8= 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=wZYGGvRF; arc=none smtp.client-ip=209.85.161.45 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="wZYGGvRF" Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-662f2fa7e67so799871eaf.1 for ; Sun, 15 Feb 2026 15:16:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1771197411; x=1771802211; 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=PADUDw8CNAAL1tlEty9cxWnxu4Azyh2rgAcU1OiEhYE=; b=wZYGGvRFyPAd0gzMdZoFvK3FmPHZ6xsL3GBYayIQ/CzgaNn7XTwWsk955rbvLm4x6d gmAb65+/oDwYXHrsWSloXt/RCiUNg6kN7E9Lnm/XIBLZQs6E+oSRbqPKzql8UKstDJiX /HgnXZdkAcQ80hqitHqBAOeBjimLNGpLMeNZae7cb9S7u1ZWkktjAOZQdUEMZBqKu0OI fPf2FbG74jZ12oYawtmM4kHRofEWmNvNtBSe0aKgDoFgAUqStLJuSn8dW8YNugsPKsBu hvmUdxuYcftf2cNl6BSagJtNQvqGEG7Zy81GNifKVqB3aJzY7HxSoHPyLPUHj3YvXPgt VLwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771197411; x=1771802211; 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=PADUDw8CNAAL1tlEty9cxWnxu4Azyh2rgAcU1OiEhYE=; b=mOOeTKSd6pr/AXegL+Chz4guhfhqJAGSCSkApwXSjtBufLBCBjrlSAhruxUOQx1lev M3KVYSf9Dpq8QS/ZyET8+MnnGv09k531lbniW9w5Ec8GmSHyLPx+ObEX8FBDyUZXqKjh 5Xq06+0Uw7pFCpKBxa+l+SRgvTu5GVDAEgRon6yjenSIR8RhV5RcTQPtdtTAAllZtEBv HYruhSXD7UTtKRVZfRqDqnGGRpkXzSh7khviPEi2TtZCfp8CK5FtrRUJBJXA2ro7Ir+z BAeNTVzb8BnCYSbUBqQThE9q8FT3fXChFlgHp4Y4bMWQY4RnyI8ARuMUeBY2mdcJQiVP sI9w== X-Forwarded-Encrypted: i=1; AJvYcCXABZdLzqmVYTw4oG1fs5kvEhIILbnmZsi+2owjuJ2XLjGFZ/gj/iW9fqPR1HjfrhjdL4AAvIPak5GnIlc=@vger.kernel.org X-Gm-Message-State: AOJu0YxoD3f7yVnBpDROVWgEmUE1/4QAMauYSZKWE1NKIChrI4PDx+Yv kkmgnTjrGxSQkEoKw0MW4bcYHx7i0qA9AXAPvfNbFgIkPIb3BeCkjvj0SdMB7gdoIJI= X-Gm-Gg: AZuq6aJzjhH+DPeuUcvieqlilq7TCZqVsorf/ZuoSPvKBocTLtDaGvdRqap0cQD+IDo osqlODxKkIhQXV3XwmyEV+NsQyBHH+cRtXidcq6Bm8ZDhUMjJlGyaYER/h5syhiOlOppSgSgfSd UeCC87Es8Meae5BJdSvT2MA+5CDD8U1ydLpyFys6kt/WkXnorbm5MSgiuai4RgN61OVRax7dyBJ 3EhWeaYlRgD6YWH34A8AMcL9TFKrMOEv7BVGUnGKLVJNdihmwt4lftKNpEy92sW+9qcjOVwdIbC HRxDxiiFbp2PfRV9lRqEJBLEDxPFYOBpI1s8BTVngsWpvayIJeDrra2I/ONLl9hi/4VOUfyfGVU dcFLL1J5du3qMt2iAY8MaYVbcSvLAum6qY4torfgBSc3rEpdeByqL19JUXWODwu2DmWOhipy3sR 5FL8mvgFy56W0morLKWkTlSLs6ESQx926Tr5P9/q0VlgRmoCRiOioKxFiYuzfZ834rRfpyEgwz X-Received: by 2002:a05:6820:8c1:b0:659:9a49:90a6 with SMTP id 006d021491bc7-67767b50eddmr4473140eaf.37.1771197411024; Sun, 15 Feb 2026 15:16:51 -0800 (PST) Received: from ?IPV6:2600:8803:e7e4:500:796e:98be:f757:2021? ([2600:8803:e7e4:500:796e:98be:f757:2021]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-67817ccdb97sm4392500eaf.2.2026.02.15.15.16.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 15 Feb 2026 15:16:49 -0800 (PST) Message-ID: Date: Sun, 15 Feb 2026 17:16:47 -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 v2 0/4] iio: adc: ad4080: add support for AD4880 dual-channel ADC To: Andy Shevchenko Cc: Jonathan Cameron , Antoniu Miclaus , Lars-Peter Clausen , Michael Hennerich , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Olivier Moysan , Mark Brown , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org References: <20260214160852.6862b58d@jic23-huawei> <897bd4d4-bbdf-4cbf-84f6-05c110d75d03@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/15/26 2:03 AM, Andy Shevchenko wrote: > On Sat, Feb 14, 2026 at 12:31:12PM -0600, David Lechner wrote: >> On 2/14/26 12:11 PM, Andy Shevchenko wrote: >>> On Sat, Feb 14, 2026 at 04:08:52PM +0000, Jonathan Cameron wrote: >>>> On Sun, 8 Feb 2026 14:50:23 +0200 >>>> Andy Shevchenko wrote: >>>>> On Fri, Feb 06, 2026 at 06:07:12PM +0200, Antoniu Miclaus wrote: > > ... > >>>>> I believe there is a better approach, what you need is rather a flag >>>>> to SPI core to tell that this is the device with shared CS. >>>> >>>> Antoniu, this comment from Andy needs addressing before we move >>>> on. It seems fairly fundamental and I'm not seeing a reply to it on list. >>>> >>>> I'm not entirely sure what Andy is suggesting will work but this >>>> is perhaps a mismatch in really understanding what is going on here. >>>> Andy, how would a flag work given they seem to be separately addressable >>>> SPI buses. I think this isn't a shared SPI CS, but rather a device >>>> with two entirely separate SPI buses. I think the only reason >>>> we are bothering to implement it as a single device at all is the >>>> shared backend. >>> >>> My understanding that there are two devices that for whatever reason share >> >> It is the opposite. It is a _single_ device with _two_ CS lines. > > Don't we have already support for that? This changes the picture even more towards > NAKing this. See below why. Yes, spi_new_ancillary_device() was introduced exactly for this sort of thing, which is why I think it makes sense to use it. > >> adc@0 { >> reg = <0>, <1>; >> ... >> }; >> >>> the same CS line. Yes, I probably misread the idea behind, but I meant >>> some flag for SPI device that tells SPI core that the CS it wants is shared >>> (maybe a high bit in the cs field or so), then CS core won't complain on >>> validation about using the same cs number which is "already in use". >> >> There was one existing user in the kernel of spi_new_ancillary_device() >> that looked like this, so it seemed the right way to approach it. However, >> code was added later that caused the primary SPI device to "claim" both >> CS lines for itself and probably broke the one existing user of >> spi_new_ancillary_device() (hard to tell without hardware to test). >> >> The idea here was to unbreak that so we could use spi_new_ancillary_device() >> just as in the existing use case. >> >> The patch for that could have been a bit more strict to only allow the >> spi_new_ancillary_device() to take CS 1 and fail otherwise, but users >> are going to notice if it isn't working right anyway, so I didn't ask >> for more checking. > >>>> There is an argument that maybe we should be looking at how >>>> to do data muxing backends to support the more general case of two >>>> separate chips feeding into a single buffer, but that's a complex >>>> beast and I'm not sure if it is something we actually need. >> >> I think it would actually be quite similar to what is done in this >> series. > > TBH, the change sounds to me like a hack. It doesn't cover other potential ways > of the multi-cs devices come into play. Given that SPI core supports multi-cs > I don't see a good justification for this patch. > > What did I miss? As far as I can tell, other than the one existing user of spi_new_ancillary_device(), other SPI multi-CS stuff is only used by SPI flash memory devices, not general SPI devices. There code that is being modified here was introduced to support the SPI flash memory devices, so that use case is already covered by existing code.