diff mbox series

[v5,04/11] dt-bindings: iio: adc: add AXP803 ADC bindings

Message ID 20181023185330.10472-5-oskari@lemmela.net
State New
Headers show
Series AXP8x3 AC and battery power supply support | expand

Commit Message

Oskari Lemmelä Oct. 23, 2018, 6:53 p.m. UTC
The AXP803 ADC is compatible with AXP813 ADC, but add
specific compatible for it.

Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
---
 Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt | 2 ++
 1 file changed, 2 insertions(+)

Comments

Rob Herring (Arm) Oct. 24, 2018, 1:56 p.m. UTC | #1
On Tue, 23 Oct 2018 21:53:23 +0300, Oskari Lemmela wrote:
> The AXP803 ADC is compatible with AXP813 ADC, but add
> specific compatible for it.
> 
> Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
> ---
>  Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt | 2 ++
>  1 file changed, 2 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>
Jonathan Cameron Oct. 28, 2018, 3:40 p.m. UTC | #2
On Wed, 24 Oct 2018 08:56:33 -0500
Rob Herring <robh@kernel.org> wrote:

> On Tue, 23 Oct 2018 21:53:23 +0300, Oskari Lemmela wrote:
> > The AXP803 ADC is compatible with AXP813 ADC, but add
> > specific compatible for it.
> > 
> > Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
> > ---
> >  Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt | 2 ++
> >  1 file changed, 2 insertions(+)
> >   
> 
> Reviewed-by: Rob Herring <robh@kernel.org>

This doesn't seem to have any dependencies with the other patches
so applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to ignore.  However I am a little curious to know
why we would add the ID and then not use it (that I can see)?

Thanks,

Jonathan
Quentin Schulz Oct. 29, 2018, 1:07 p.m. UTC | #3
Hi Jonathan,

On Sun, Oct 28, 2018 at 03:40:11PM +0000, Jonathan Cameron wrote:
> On Wed, 24 Oct 2018 08:56:33 -0500
> Rob Herring <robh@kernel.org> wrote:
> 
> > On Tue, 23 Oct 2018 21:53:23 +0300, Oskari Lemmela wrote:
> > > The AXP803 ADC is compatible with AXP813 ADC, but add
> > > specific compatible for it.
> > > 
> > > Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
> > > ---
> > >  Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt | 2 ++
> > >  1 file changed, 2 insertions(+)
> > >   
> > 
> > Reviewed-by: Rob Herring <robh@kernel.org>
> 
> This doesn't seem to have any dependencies with the other patches
> so applied to the togreg branch of iio.git and pushed out as testing
> for the autobuilders to ignore.  However I am a little curious to know
> why we would add the ID and then not use it (that I can see)?
> 

Sometimes with Allwinner (and X-Powers), two IPs seem identical until we
discover something that is slightly different. When this happens, we
have to add a compatible to differentiate both. However, we would also
need to change the Device Tree to change the compatible. We would need
to handle the driver behaviour for both Device Trees.

So better anticipate a possible difference so that we don't have to do
some hacks in the driver to handle the device correctly.

As always, Chen-Yu or Maxime may know better so I'm just stating what I
seem to recall.

Quentin
Chen-Yu Tsai Oct. 31, 2018, 2:29 a.m. UTC | #4
On Mon, Oct 29, 2018 at 9:10 PM Quentin Schulz
<quentin.schulz@bootlin.com> wrote:
>
> Hi Jonathan,
>
> On Sun, Oct 28, 2018 at 03:40:11PM +0000, Jonathan Cameron wrote:
> > On Wed, 24 Oct 2018 08:56:33 -0500
> > Rob Herring <robh@kernel.org> wrote:
> >
> > > On Tue, 23 Oct 2018 21:53:23 +0300, Oskari Lemmela wrote:
> > > > The AXP803 ADC is compatible with AXP813 ADC, but add
> > > > specific compatible for it.
> > > >
> > > > Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
> > > > ---
> > > >  Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt | 2 ++
> > > >  1 file changed, 2 insertions(+)
> > > >
> > >
> > > Reviewed-by: Rob Herring <robh@kernel.org>
> >
> > This doesn't seem to have any dependencies with the other patches
> > so applied to the togreg branch of iio.git and pushed out as testing
> > for the autobuilders to ignore.  However I am a little curious to know
> > why we would add the ID and then not use it (that I can see)?
> >
>
> Sometimes with Allwinner (and X-Powers), two IPs seem identical until we
> discover something that is slightly different. When this happens, we
> have to add a compatible to differentiate both. However, we would also
> need to change the Device Tree to change the compatible. We would need
> to handle the driver behaviour for both Device Trees.
>
> So better anticipate a possible difference so that we don't have to do
> some hacks in the driver to handle the device correctly.
>
> As always, Chen-Yu or Maxime may know better so I'm just stating what I
> seem to recall.

With Allwinner stuff (X-Powers included), sometimes the documents are
incomplete or have errors. We tend to add a model-specific compatible
just in case things turn out not to be so compatible, unless someone
has triple-checked everything, documents and actual hardware included.

However we don't actually document these, so this patch isn't strictly
needed. (I suppose this might annoy the device tree binding maintainers.)

ChenYu
Jonathan Cameron Nov. 3, 2018, 10:21 a.m. UTC | #5
On Wed, 31 Oct 2018 10:29:59 +0800
Chen-Yu Tsai <wens@csie.org> wrote:

> On Mon, Oct 29, 2018 at 9:10 PM Quentin Schulz
> <quentin.schulz@bootlin.com> wrote:
> >
> > Hi Jonathan,
> >
> > On Sun, Oct 28, 2018 at 03:40:11PM +0000, Jonathan Cameron wrote:  
> > > On Wed, 24 Oct 2018 08:56:33 -0500
> > > Rob Herring <robh@kernel.org> wrote:
> > >  
> > > > On Tue, 23 Oct 2018 21:53:23 +0300, Oskari Lemmela wrote:  
> > > > > The AXP803 ADC is compatible with AXP813 ADC, but add
> > > > > specific compatible for it.
> > > > >
> > > > > Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
> > > > > ---
> > > > >  Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt | 2 ++
> > > > >  1 file changed, 2 insertions(+)
> > > > >  
> > > >
> > > > Reviewed-by: Rob Herring <robh@kernel.org>  
> > >
> > > This doesn't seem to have any dependencies with the other patches
> > > so applied to the togreg branch of iio.git and pushed out as testing
> > > for the autobuilders to ignore.  However I am a little curious to know
> > > why we would add the ID and then not use it (that I can see)?
> > >  
> >
> > Sometimes with Allwinner (and X-Powers), two IPs seem identical until we
> > discover something that is slightly different. When this happens, we
> > have to add a compatible to differentiate both. However, we would also
> > need to change the Device Tree to change the compatible. We would need
> > to handle the driver behaviour for both Device Trees.
> >
> > So better anticipate a possible difference so that we don't have to do
> > some hacks in the driver to handle the device correctly.
> >
> > As always, Chen-Yu or Maxime may know better so I'm just stating what I
> > seem to recall.  
> 
> With Allwinner stuff (X-Powers included), sometimes the documents are
> incomplete or have errors. We tend to add a model-specific compatible
> just in case things turn out not to be so compatible, unless someone
> has triple-checked everything, documents and actual hardware included.
> 
> However we don't actually document these, so this patch isn't strictly
> needed. (I suppose this might annoy the device tree binding maintainers.)
> 
> ChenYu
I don't think it does any harm so I'll leave it in place.  Thanks for
the explanations.

Jonathan
Chen-Yu Tsai Nov. 5, 2018, 5:47 a.m. UTC | #6
On Sat, Nov 3, 2018 at 6:22 PM Jonathan Cameron
<jic23@jic23.retrosnub.co.uk> wrote:
>
> On Wed, 31 Oct 2018 10:29:59 +0800
> Chen-Yu Tsai <wens@csie.org> wrote:
>
> > On Mon, Oct 29, 2018 at 9:10 PM Quentin Schulz
> > <quentin.schulz@bootlin.com> wrote:
> > >
> > > Hi Jonathan,
> > >
> > > On Sun, Oct 28, 2018 at 03:40:11PM +0000, Jonathan Cameron wrote:
> > > > On Wed, 24 Oct 2018 08:56:33 -0500
> > > > Rob Herring <robh@kernel.org> wrote:
> > > >
> > > > > On Tue, 23 Oct 2018 21:53:23 +0300, Oskari Lemmela wrote:
> > > > > > The AXP803 ADC is compatible with AXP813 ADC, but add
> > > > > > specific compatible for it.
> > > > > >
> > > > > > Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
> > > > > > ---
> > > > > >  Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt | 2 ++
> > > > > >  1 file changed, 2 insertions(+)
> > > > > >
> > > > >
> > > > > Reviewed-by: Rob Herring <robh@kernel.org>
> > > >
> > > > This doesn't seem to have any dependencies with the other patches
> > > > so applied to the togreg branch of iio.git and pushed out as testing
> > > > for the autobuilders to ignore.  However I am a little curious to know
> > > > why we would add the ID and then not use it (that I can see)?
> > > >
> > >
> > > Sometimes with Allwinner (and X-Powers), two IPs seem identical until we
> > > discover something that is slightly different. When this happens, we
> > > have to add a compatible to differentiate both. However, we would also
> > > need to change the Device Tree to change the compatible. We would need
> > > to handle the driver behaviour for both Device Trees.
> > >
> > > So better anticipate a possible difference so that we don't have to do
> > > some hacks in the driver to handle the device correctly.
> > >
> > > As always, Chen-Yu or Maxime may know better so I'm just stating what I
> > > seem to recall.
> >
> > With Allwinner stuff (X-Powers included), sometimes the documents are
> > incomplete or have errors. We tend to add a model-specific compatible
> > just in case things turn out not to be so compatible, unless someone
> > has triple-checked everything, documents and actual hardware included.
> >
> > However we don't actually document these, so this patch isn't strictly
> > needed. (I suppose this might annoy the device tree binding maintainers.)
> >
> > ChenYu
> I don't think it does any harm so I'll leave it in place.  Thanks for
> the explanations.

It might cause a bit of confusion though. We are not targetting these
compatibles in terms of driver support, and they should not be used
individually. IMO dropping this patch altogether is better. In the
device tree we would use the tuplet axp803 + axp813.

ChenYu
Jonathan Cameron Nov. 11, 2018, 3:30 p.m. UTC | #7
On Mon, 5 Nov 2018 13:47:50 +0800
Chen-Yu Tsai <wens@csie.org> wrote:

> On Sat, Nov 3, 2018 at 6:22 PM Jonathan Cameron
> <jic23@jic23.retrosnub.co.uk> wrote:
> >
> > On Wed, 31 Oct 2018 10:29:59 +0800
> > Chen-Yu Tsai <wens@csie.org> wrote:
> >  
> > > On Mon, Oct 29, 2018 at 9:10 PM Quentin Schulz
> > > <quentin.schulz@bootlin.com> wrote:  
> > > >
> > > > Hi Jonathan,
> > > >
> > > > On Sun, Oct 28, 2018 at 03:40:11PM +0000, Jonathan Cameron wrote:  
> > > > > On Wed, 24 Oct 2018 08:56:33 -0500
> > > > > Rob Herring <robh@kernel.org> wrote:
> > > > >  
> > > > > > On Tue, 23 Oct 2018 21:53:23 +0300, Oskari Lemmela wrote:  
> > > > > > > The AXP803 ADC is compatible with AXP813 ADC, but add
> > > > > > > specific compatible for it.
> > > > > > >
> > > > > > > Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
> > > > > > > ---
> > > > > > >  Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt | 2 ++
> > > > > > >  1 file changed, 2 insertions(+)
> > > > > > >  
> > > > > >
> > > > > > Reviewed-by: Rob Herring <robh@kernel.org>  
> > > > >
> > > > > This doesn't seem to have any dependencies with the other patches
> > > > > so applied to the togreg branch of iio.git and pushed out as testing
> > > > > for the autobuilders to ignore.  However I am a little curious to know
> > > > > why we would add the ID and then not use it (that I can see)?
> > > > >  
> > > >
> > > > Sometimes with Allwinner (and X-Powers), two IPs seem identical until we
> > > > discover something that is slightly different. When this happens, we
> > > > have to add a compatible to differentiate both. However, we would also
> > > > need to change the Device Tree to change the compatible. We would need
> > > > to handle the driver behaviour for both Device Trees.
> > > >
> > > > So better anticipate a possible difference so that we don't have to do
> > > > some hacks in the driver to handle the device correctly.
> > > >
> > > > As always, Chen-Yu or Maxime may know better so I'm just stating what I
> > > > seem to recall.  
> > >
> > > With Allwinner stuff (X-Powers included), sometimes the documents are
> > > incomplete or have errors. We tend to add a model-specific compatible
> > > just in case things turn out not to be so compatible, unless someone
> > > has triple-checked everything, documents and actual hardware included.
> > >
> > > However we don't actually document these, so this patch isn't strictly
> > > needed. (I suppose this might annoy the device tree binding maintainers.)
> > >
> > > ChenYu  
> > I don't think it does any harm so I'll leave it in place.  Thanks for
> > the explanations.  
> 
> It might cause a bit of confusion though. We are not targetting these
> compatibles in terms of driver support, and they should not be used
> individually. IMO dropping this patch altogether is better. In the
> device tree we would use the tuplet axp803 + axp813.
> 
OK. Dropped.

Thanks,

Jonathan

> ChenYu
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt b/Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt
index 7a6313913923..1dbd5e480acd 100644
--- a/Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt
+++ b/Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt
@@ -4,6 +4,7 @@  Required properties:
   - compatible: should be one of:
     - "x-powers,axp209-adc",
     - "x-powers,axp221-adc",
+    - "x-powers,axp803-adc",
     - "x-powers,axp813-adc",
   - #io-channel-cells: should be 1,
 
@@ -39,6 +40,7 @@  AXP22x
  2 | batt_chrg_i
  3 | batt_dischrg_i
 
+AXP803
 AXP813
 ------
  0 | pmic_temp