From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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 51665370D44 for ; Mon, 18 May 2026 18:41:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779129713; cv=none; b=fmciOPTOXdQG584kd9YR6dAJt6zNb9sWAGwk2RGNVQpq2Ya+vGu4pGHlOEcWA7feF2n4PDCQuqugKHoLpRGzFQJRn82A4w/7ZVa+icWLt5Erp2C+ozD1i/jeWXq5C1mfqagWejZAj3YpF20W7gKPT6zzdn+s3ZtjZKMwsUdT3fE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779129713; c=relaxed/simple; bh=JNbCHaWL9A4MjehkdwtKJsbWrGA6dxODtuxGwf4j9hE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=X+ONZyFHA5F+Sk0PbHu4Ot6c+T/iiaUM9icFPDArsgmk3FE3YcY2exTdLRnr93Wc1y6MfnszQGwp/NWaDIMNy4A/aDpJ7Jrjqp3jlSLmaV/iGpwUsqdOpTqfo5Ql+8+s1/0ZjlOUFhju4sc45XOIQKZDJtncWtj9u/3Ls5mdjQ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GW1/Fpr4; arc=none smtp.client-ip=209.85.222.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GW1/Fpr4" Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-910f734b477so319067385a.0 for ; Mon, 18 May 2026 11:41:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779129711; x=1779734511; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=RjcXx1L02D57/85kmr8KRIpyy2DN3BNEA8TDg2cGfrc=; b=GW1/Fpr4KJGV1w73HxVUBExobEEqxD+ZVKvNZzM3cODox/lJU6COlP3lO4/CvdOXE0 JGTY3h0QVkg8jb5TosmM/0YN78pI3JlMqP/USMohv7pasTKsjP63Hm/LGwVKXbMlzSBZ w/j8Song2rMtZFCsTw+vocXOrT6AWIPy5Aejr7mexPBS+IixKirRKOD4X0GCN0uyFfdg Z/NCQxlwCqF5j9BvU1g+BPsC4lzskgWIq2IK4k80B8UTWN7q8qOHkuYLH0d//Go6Qlcu rNsmDX1NxObiej20UaelfHfmGXL49YuHIWN7ijjw8+LpwIE0S40Y0vRtffCXEWEEI69u Co6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779129711; x=1779734511; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RjcXx1L02D57/85kmr8KRIpyy2DN3BNEA8TDg2cGfrc=; b=b8h3YYrAQbgoaZdaJpAEnOyY8PVUpB7lqsP+0fylHJteWR/tMELRHcgWhEqYv2Utc2 wonf0QgaSGSLRE48izPHA+cC0tj5K43+8PY+ILatiEHYTjwHmcEXKhMgXtaXhO9hHSj1 blapUnLx4d64JBF0ASCaJTZ04M0pDSITkXLFiIRCqy1gwAQyNk+kB516EhtxF488GLe2 byorWEPluFp9zsfh3Ns+VMfyd1GRsnZE+TY8yuuTP+4r4sFS3PlzCMOBwcKlJ0dV3R+y wLneHkEi7fdFg2KkKpiQO3Z+qEWF7NBVcx2nWQTfF38f8WXIwhTameMBONnwLC0Fkgd0 w2Tg== X-Forwarded-Encrypted: i=1; AFNElJ9w5Gn+W/HVc9YqzPBTgMxQpEcX4Kw5zB/7T0fB5XHGQRklbMlfME49lIUOU6xFiq9LVhJ1nS9buV1u3Pk=@vger.kernel.org X-Gm-Message-State: AOJu0YzcxdFW9ybeeN5jHWTBsNK03mCkzO4eotPBbkFUT4u424e/PwLG MOVzPz2PZHCQCD3jRQbO0RSmNp45rY7mi9tT01tBWCWwNOUrAvyOwAn8 X-Gm-Gg: Acq92OHYWYOMMI+sY/uoqHtsfYN7cghEtYh8SB+3syol/vSaHibMDfrxu8RZShn3ZvZ Nu73Z/Xl/5YgB4udvlxGM4Ei++VmJOduKI+ny5ykdZPWTJrJPoOIQrMZ/VbUpIopWV9bKPBXBAF qNXuprxRYGBnQ62ecoxKQ5DrHbM8ZWSo81GETw4voZqRZd7F4lv9QnfehdW0aj/Vrt5n1hg+/vB p3eVBu3EGETHZMVuTxG6By0K8lliLNeByH8UQ3k7udcR6muOU/5Y0S1GJHOPXgqYfKucwJB5ANf hypf9sQ+1+xOJqFpzLgypgG+wzKUA7Bl5KBgF3a32Ifv73RS1oxa8SiGZh9koPyB4mJvZfPOc/D XP9ayXbA+baV4NCsKs90k3yQohaLwxQjHWXPjL0pJ25je32jkX8u5XBTiPZUCtfBOgGDa2PXk9X 6+ikgDNLMUpER7ERNUNvWpM/0kWOYxKO6b X-Received: by 2002:a05:622a:1789:b0:509:3940:30ea with SMTP id d75a77b69052e-5165a255f15mr239848711cf.55.1779129710804; Mon, 18 May 2026 11:41:50 -0700 (PDT) Received: from localhost ([2804:30c:1f02:6000:8b59:7c96:762e:9faa]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-5168c968930sm50529931cf.0.2026.05.18.11.41.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2026 11:41:50 -0700 (PDT) Date: Mon, 18 May 2026 15:42:05 -0300 From: Marcelo Schmitt To: Conor Dooley Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, jic23@kernel.org, nuno.sa@analog.com, Michael.Hennerich@analog.com, dlechner@baylibre.com, andy@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Subject: Re: [PATCH v1 1/4] dt-bindings: iio: adc: Add ltc2378 Message-ID: References: <20260518-trapped-gauze-ada279af89fc@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260518-trapped-gauze-ada279af89fc@spud> Hi Conor, On 05/18, Conor Dooley wrote: > On Mon, May 18, 2026 at 12:21:01PM -0300, Marcelo Schmitt wrote: > > From: Marcelo Schmitt > > > > Document how to describe LTC2378-20 and similar ADCs in device tree. > > > > Signed-off-by: Marcelo Schmitt > > --- ... > > +properties: > > + compatible: > > + oneOf: > > + - enum: > > + - adi,ltc2338-18 > > + - adi,ltc2369-18 > > + - adi,ltc2370-16 > > + - adi,ltc2379-18 > > + - adi,ltc2380-16 > > + - items: > > + - enum: > > + - adi,ltc2364-18 > > + - adi,ltc2364-16 # fallback compatible > > + - items: > > + - enum: > > + - adi,ltc2367-18 > > + - adi,ltc2367-16 # fallback compatible > > + - items: > > + - enum: > > + - adi,ltc2368-18 > > + - adi,ltc2368-16 # fallback compatible > > + - items: > > + - enum: > > + - adi,ltc2376-18 > > + - adi,ltc2376-20 > > + - adi,ltc2376-16 # fallback compatible > > + - items: > > + - enum: > > + - adi,ltc2377-18 > > + - adi,ltc2377-20 > > + - adi,ltc2377-16 # fallback compatible > > + - items: > > + - enum: > > + - adi,ltc2378-18 > > + - adi,ltc2378-20 > > + - adi,ltc2378-16 # fallback compatible > > All of these are wrong. > > Firstly, your "fallback" setups don't work, because they only permit a > single compatible. Secondly, if they did work, you still need to define > the fallback compatible in isolation for it to be permitted for use when > it isn't a fallback. > And thirdly, your driver appears to show that these devices aren't > actually compatible at all, given there's unique match data for each > one. ... > > Why do you have fallbacks here? Is it because a limited set of channels > could be used in the fallback case? At the very least, the rationale for > fallbacks should be explained. > Some devices can be grouped by main number (e.g. ltc2378-16, -18, -20) and those vary only on the amount of precision bits. I initially thought we could fallback to reading only 16 or 18 bits if a driver compatible with ltc2378-20 is not found. Though, I now realize that won't work because the less significant bits would be missing which would compromise scaling the data to milli volts. Will make this a unique match list (no separate items lists, no fallbacks). ... > > + > > +additionalProperties: false > > As sashiko pointed out, this is not correct if you want to permit spi > properties other than spi-max-frequency (although I could definitely see > how this would be correct). Ack, switching to 'unevaluatedProperties: false'. Thanks, Marcelo