Message ID | 20240417170423.20640-3-macroalpha82@gmail.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
Series | Add GPADC for Allwinner H616 | expand |
On Wed, 17 Apr 2024 12:04:22 -0500 Chris Morgan <macroalpha82@gmail.com> wrote: Hi, > From: Chris Morgan <macromorgan@hotmail.com> > > Add support for the GPADC for the Allwinner H616. It is identical to > the existing ADC for the D1/T113s/R329/T507 SoCs. The H616 is using the same die as the T507 and the H700, and since the T507 is already mentioned in the commit message for the original binding, I wonder if we actually need a new compatible? I guess we follow the usual approach and provide this new per-SoC compatible string, since the D1 and H616 SoCs are quite different? Just wanted to point this out... > Signed-off-by: Chris Morgan <macromorgan@hotmail.com> > --- > .../bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml > index 7ef46c90ebc8..da605a051b94 100644 > --- a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml > +++ b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml > @@ -11,8 +11,13 @@ maintainers: > > properties: > compatible: > - enum: > - - allwinner,sun20i-d1-gpadc > + oneOf: > + - enum: > + - allwinner,sun20i-d1-gpadc > + - items: > + - enum: > + - allwinner,sun50i-h616-gpadc > + - const: allwinner,sun20i-d1-gpadc I think a more compact way to write this would be: oneOf: - const: allwinner,sun20i-d1-gpadc - items: - const: allwinner,sun50i-h616-gpadc - const: allwinner,sun20i-d1-gpadc In general: the description in the T507 manual looks the same as in the D1 manual, just with the former having 4, and the latter 2 channels. If I understand correctly, this difference is not modelled in the binding (or the Linux driver, fwiw), so using the compatible fallback looks good. Cheers, Andre > > "#io-channel-cells": > const: 1
On Wed, Apr 17, 2024 at 11:49:57PM +0100, Andre Przywara wrote: > On Wed, 17 Apr 2024 12:04:22 -0500 > Chris Morgan <macroalpha82@gmail.com> wrote: > > Hi, > > > From: Chris Morgan <macromorgan@hotmail.com> > > > > Add support for the GPADC for the Allwinner H616. It is identical to > > the existing ADC for the D1/T113s/R329/T507 SoCs. > > The H616 is using the same die as the T507 and the H700, and since the > T507 is already mentioned in the commit message for the original > binding, I wonder if we actually need a new compatible? For same die, I would say no you don't. But adding a compatible is fine, too. Rob
On Wed, 17 Apr 2024 12:04:22 -0500, Chris Morgan wrote: > From: Chris Morgan <macromorgan@hotmail.com> > > Add support for the GPADC for the Allwinner H616. It is identical to > the existing ADC for the D1/T113s/R329/T507 SoCs. > > Signed-off-by: Chris Morgan <macromorgan@hotmail.com> > --- > .../bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > Acked-by: Rob Herring (Arm) <robh@kernel.org>
On Thu, Apr 18, 2024 at 10:16:50AM -0500, Rob Herring wrote: > On Wed, Apr 17, 2024 at 11:49:57PM +0100, Andre Przywara wrote: > > On Wed, 17 Apr 2024 12:04:22 -0500 > > Chris Morgan <macroalpha82@gmail.com> wrote: > > > > Hi, > > > > > From: Chris Morgan <macromorgan@hotmail.com> > > > > > > Add support for the GPADC for the Allwinner H616. It is identical to > > > the existing ADC for the D1/T113s/R329/T507 SoCs. > > > > The H616 is using the same die as the T507 and the H700, and since the > > T507 is already mentioned in the commit message for the original > > binding, I wonder if we actually need a new compatible? > > For same die, I would say no you don't. But adding a compatible is fine, > too. > > Rob I've been burned before, if it's just the same to you I'd like to do a compatible. But I will defer to the experts on this matter. Also if there is a more compact way of expressing this while still maintaining backwards compatibility please let me know. Otherwise, I'm okay with this if you all are (it passes dt_binding_check, yamllint, and checkpatch.pl so I'm okay with it if you are). Chris
On Thu, 18 Apr 2024 10:17:33 -0500 Rob Herring <robh@kernel.org> wrote: > On Wed, 17 Apr 2024 12:04:22 -0500, Chris Morgan wrote: > > From: Chris Morgan <macromorgan@hotmail.com> > > > > Add support for the GPADC for the Allwinner H616. It is identical to > > the existing ADC for the D1/T113s/R329/T507 SoCs. > > > > Signed-off-by: Chris Morgan <macromorgan@hotmail.com> > > --- > > .../bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml | 9 +++++++-- > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > Acked-by: Rob Herring (Arm) <robh@kernel.org> > > Applied this patch to the IIO tree. Jonathan
diff --git a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml index 7ef46c90ebc8..da605a051b94 100644 --- a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml +++ b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml @@ -11,8 +11,13 @@ maintainers: properties: compatible: - enum: - - allwinner,sun20i-d1-gpadc + oneOf: + - enum: + - allwinner,sun20i-d1-gpadc + - items: + - enum: + - allwinner,sun50i-h616-gpadc + - const: allwinner,sun20i-d1-gpadc "#io-channel-cells": const: 1