Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3824553rdb; Thu, 28 Dec 2023 00:45:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHXu4xf4Mwv1AL/UPKRQALKJgrij3v7XrLulfqTuFcDPQ6e0TBHslWK9yPruizKslUqqBAr X-Received: by 2002:a50:8d58:0:b0:54a:f72d:38b2 with SMTP id t24-20020a508d58000000b0054af72d38b2mr6289463edt.8.1703753107110; Thu, 28 Dec 2023 00:45:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703753107; cv=none; d=google.com; s=arc-20160816; b=Fp5Eh0XR2YKriNZvwMGL3tyht1De38kUw3I98qxnJ9S1yMBbVxLcG/IHtK99lmQTCB YHxllnEW4AwLNW3kRwSVEx3gjkv99REuZJ13cJyVCoubfFbZKAXSkG2TiOIRRjhpXYL5 JCkMz8kh8EneI2Z5LOY7S90g46tQAUifR1oTzIGHocyn1yOq+W/C5Kgn96pnT/Fc0e4s Eq9cJBKXc7qKX3XOVD64UvNbcKG7ixb0LeduYKEgrwtglxyulUp8rJri80scQGgNTsN5 pkpeE/jUBnu06Pkae+CR2ASqQMzyVe4BG0G0+j7JbWnJFfp9iIy00U2oicsAT7GGrXWg n14A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=DEIpZBByterZuB76yF5GzjtLaOu1kRebC6GJMS4uKrA=; fh=6Z+sRaFBvRruA8vdTNNy/J8nuvpXPAn9tDhp6dNPSwc=; b=eA1qB71t/gnR7efFYrUy8FzYrxiDN4xCzmohNAtYDOdyQrU3otKR0Lw0yp5CVLSwxe C+gs6L41Dpfge8nUedeAXHLuFj+WG1G/clQsBwPOmlrLmZYb3cK/1GZL+PQMFQDMDTMz D4AYij3YZI1hsXVJZe29mHfgD6MagJkdtWUFHLkApeItighq1ixl3Zvi0Sja8w031W82 SPEApAV3qiCgRnr42pq+05Q0FA5PSUPouu1zuBSJDxxRcWAPjpPYvDGhVVkE8krMUfOs A5Oc+nwAIJKT4mG36gx+SU8QVLtbjbTF7edcFRU+h7o63SP9uKaQvKdavGK7rGbAcrUm OTeA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12523-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12523-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id w3-20020a05640234c300b005532ac01acfsi7092746edc.216.2023.12.28.00.45.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 00:45:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12523-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12523-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12523-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DA6461F22E38 for ; Thu, 28 Dec 2023 08:45:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC06B63BA; Thu, 28 Dec 2023 08:44:57 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mg.richtek.com (mg.richtek.com [220.130.44.152]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFE975235; Thu, 28 Dec 2023 08:44:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=richtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=richtek.com X-MailGates: (SIP:2,PASS,NONE)(compute_score:DELIVER,40,3) Received: from 192.168.10.46 by mg.richtek.com with MailGates ESMTPS Server V6.0(636802:0:AUTH_RELAY) (envelope-from ) (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256/256); Thu, 28 Dec 2023 16:44:24 +0800 (CST) Received: from ex3.rt.l (192.168.10.46) by ex3.rt.l (192.168.10.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.27; Thu, 28 Dec 2023 16:44:24 +0800 Received: from linuxcarl2.richtek.com (192.168.10.154) by ex3.rt.l (192.168.10.45) with Microsoft SMTP Server id 15.2.1258.27 via Frontend Transport; Thu, 28 Dec 2023 16:44:24 +0800 Date: Thu, 28 Dec 2023 16:44:24 +0800 From: ChiYuan Huang To: Krzysztof Kozlowski CC: Jonathan Cameron , Krzysztof Kozlowski , Conor Dooley , Lars-Peter Clausen , Rob Herring , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , , , Subject: Re: [PATCH 1/2] dt-bindings: iio: adc: rtq6056: add support for the whole RTQ6056 family Message-ID: <20231228084424.GA18878@linuxcarl2.richtek.com> References: <1703562468-29052-1-git-send-email-cy_huang@richtek.com> <1703562468-29052-2-git-send-email-cy_huang@richtek.com> <9715ed9d-7edf-430c-808c-00e7748bc59a@linaro.org> <20231226111921.GA22684@linuxcarl2.richtek.com> <0f1f0991-9ad9-4216-afc8-8340eddb1ad9@linaro.org> <20231228031929.GA32046@linuxcarl2.richtek.com> <20231228075824.GA16067@linuxcarl2.richtek.com> <7a193550-749a-4d96-89e9-aee10c468b7b@linaro.org> 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: <7a193550-749a-4d96-89e9-aee10c468b7b@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Hi, Krzysztof: On Thu, Dec 28, 2023 at 09:06:30AM +0100, Krzysztof Kozlowski wrote: > On 28/12/2023 08:58, ChiYuan Huang wrote: > > On Thu, Dec 28, 2023 at 08:09:35AM +0100, Krzysztof Kozlowski wrote: > >> On 28/12/2023 04:19, ChiYuan Huang wrote: > >>> On Tue, Dec 26, 2023 at 01:12:50PM +0100, Krzysztof Kozlowski wrote: > >>>> On 26/12/2023 12:19, ChiYuan Huang wrote: > >>>>> On Tue, Dec 26, 2023 at 10:18:47AM +0100, Krzysztof Kozlowski wrote: > >>>>>> On 26/12/2023 04:47, cy_huang@richtek.com wrote: > >>>>>>> From: ChiYuan Huang > >>>>>>> > >>>>>>> Add compatible support for RTQ6053 and RTQ6059. > >>>>>>> > >>>>>>> Signed-off-by: ChiYuan Huang > >>>>>>> --- > >>>>>>> .../devicetree/bindings/iio/adc/richtek,rtq6056.yaml | 5 ++++- > >>>>>>> 1 file changed, 4 insertions(+), 1 deletion(-) > >>>>>>> > >>>>>>> diff --git a/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056.yaml b/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056.yaml > >>>>>>> index 88e008629ea8..d1e1f36d1972 100644 > >>>>>>> --- a/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056.yaml > >>>>>>> +++ b/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056.yaml > >>>>>>> @@ -25,7 +25,10 @@ description: | > >>>>>>> > >>>>>>> properties: > >>>>>>> compatible: > >>>>>>> - const: richtek,rtq6056 > >>>>>>> + enum: > >>>>>>> + - richtek,rtq6053 > >>>>>>> + - richtek,rtq6056 > >>>>>> > >>>>>> Aren't these devices compatible? Your driver change says they are, so > >>>>>> express compatibility with list here (and oneOf). > >>>>>> > >>>>> Thanks, I try to take other binding as the reference. One more question. > >>>>> If rtq6053 is compatible with rtq6056, there's only chip package type difference. > >>>>> Do I need to seperate it into a dedicated enum element? > >>>>> Or just put it into one item and said this part number is compatible with rtq6056? > >>>> > >>>> See example-schema. You need enum and items, both in oneOf:. > >>>> > >>> After reading the 'example-schema', I Still cannot understand what the special case items > >>> means. > >> > >> What is "special case items"? > >> > > I may misunderstand something. The special case is the 'fallback' that you mentaioned in > > the last. > >>> > >>> But in my case, is the below change correct? > >>> [Diff] > >>> properties: > >>> compatible: > >>> - enum: > >>> - - richtek,rtq6053 > >>> - - richtek,rtq6056 > >>> - - richtek,rtq6059 > >>> + oneOf: > >>> + - items: > >>> + - enum: > >>> + - richtek,rtq6053 > >>> + - richtek,rtq6056 > >>> + - richtek,rtq6059 > >> > >> This changes nothing, you still have just one item. The example-schema > >> has exactly that case, so why you are coding it differently? > >> > >> Anyway, test your DTS with the fallback, you will see that above does > >> not work. > >> > > I rewrite the below one and tested. it seems correct. > > > > [Diff] > > compatible: > > - enum: > > - - richtek,rtq6053 > > - - richtek,rtq6056 > > - - richtek,rtq6059 > > + oneOf: > > + - enum: > > + - richtek,rtq6053 > > + - richtek,rtq6059 > > + - items: > > + - const: richtek,rtq6056 > > You still need two items here to express compatibility. What is > compatible with what? It must be rtq6053 compatible with rtq6056, > because you cannot break the ABI, can you? > > > > > Just one more question. If rtq6053 is fully compatibie with rtq6056, does it need to be put > > into oneOf enum or be just put into items enum and use the 'fallback' mechanism? > > The fallback is just a term. The point is to have a list of two > compatibles. See: Devicetree specification, writing-bindings and > numerous presentations about writing DTS. > > > > > If so, the 'richtek,rtq6053' in of_device_id match can be removed. Though it just remove > > one line, but less-changed would be better. > > The device using fallback should be removed the driver of_device_id, so > 6053 goes away. > Thanks for all the information. If not misunderstanding, I'll remove "dt match id" for 6053. And the binding fix in v2 will be properties: compatible: - enum: - - richtek,rtq6053 - - richtek,rtq6056 - - richtek,rtq6059 + oneOf: + - enum: + - richtek,rtq6056 + - richtek,rtq6059 + - items: + - enum: + - richtek,rtq6053 + - const: richtek,rtq6056 This make the 6053 compatible with 6056 with DT fallback. > Best regards, > Krzysztof >