lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231228075824.GA16067@linuxcarl2.richtek.com>
Date: Thu, 28 Dec 2023 15:58:24 +0800
From: ChiYuan Huang <cy_huang@...htek.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
CC: Jonathan Cameron <jic23@...nel.org>, Krzysztof Kozlowski
	<krzysztof.kozlowski+dt@...aro.org>, Conor Dooley <conor+dt@...nel.org>,
	Lars-Peter Clausen <lars@...afoo.de>, Rob Herring <robh+dt@...nel.org>, Uwe
 Kleine-König <u.kleine-koenig@...gutronix.de>,
	<linux-iio@...r.kernel.org>, <devicetree@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] dt-bindings: iio: adc: rtq6056: add support for the
 whole RTQ6056 family

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@...htek.com wrote:
> >>>>> From: ChiYuan Huang <cy_huang@...htek.com>
> >>>>>
> >>>>> Add compatible support for RTQ6053 and RTQ6059.
> >>>>>
> >>>>> Signed-off-by: ChiYuan Huang <cy_huang@...htek.com>
> >>>>> ---
> >>>>>  .../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

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?

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.

ChiYuan.
Best regards,
> Krzysztof
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ