Message ID | 20190109164343.164205-2-tmaimon77@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | iio: adc: npcm: add NPCM ADC driver | expand |
On Wed, 9 Jan 2019 18:43:42 +0200 Tomer Maimon <tmaimon77@gmail.com> wrote: > Added device tree binding documentation for Nuvoton BMC > NPCM Analog-to-Digital Converter(ADC). > > Signed-off-by: Tomer Maimon <tmaimon77@gmail.com> This looks fine to me, but I would like Rob's confirmation that he is happy with the reset part in particular. Thanks, Jonathan > --- > .../bindings/iio/adc/nuvoton,npcm-adc.txt | 35 ++++++++++++++++++++++ > 1 file changed, 35 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/adc/nuvoton,npcm-adc.txt > > diff --git a/Documentation/devicetree/bindings/iio/adc/nuvoton,npcm-adc.txt b/Documentation/devicetree/bindings/iio/adc/nuvoton,npcm-adc.txt > new file mode 100644 > index 000000000000..1b8132cd9060 > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/adc/nuvoton,npcm-adc.txt > @@ -0,0 +1,35 @@ > +Nuvoton NPCM Analog to Digital Converter (ADC) > + > +The NPCM ADC is a 10-bit converter for eight channel inputs. > + > +Required properties: > +- compatible: "nuvoton,npcm750-adc" for the NPCM7XX BMC. > +- reg: specifies physical base address and size of the registers. > +- interrupts: Contain the ADC interrupt with flags for falling edge. > + > +Optional properties: > +- clocks: phandle of ADC reference clock, in case the clock is not > + added the ADC will use the default ADC sample rate. > +- vref-supply: The regulator supply ADC reference voltage, in case the > + vref-supply is not added the ADC will use internal voltage > + reference. > + > +Required Node in the NPCM7xx BMC: > +An additional register is present in the NPCM7xx SOC which is > +assumed to be in the same device tree, with and marked as > +compatible with "nuvoton,npcm750-rst". > + > +Example: > + > +adc: adc@f000c000 { > + compatible = "nuvoton,npcm750-adc"; > + reg = <0xf000c000 0x8>; > + interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>; > + clocks = <&clk NPCM7XX_CLK_ADC>; > +}; > + > +rst: rst@f0801000 { > + compatible = "nuvoton,npcm750-rst", "syscon", > + "simple-mfd"; > + reg = <0xf0801000 0x6C>; > +};
On Wed, 9 Jan 2019 18:43:42 +0200, Tomer Maimon wrote: > Added device tree binding documentation for Nuvoton BMC > NPCM Analog-to-Digital Converter(ADC). > > Signed-off-by: Tomer Maimon <tmaimon77@gmail.com> > --- > .../bindings/iio/adc/nuvoton,npcm-adc.txt | 35 ++++++++++++++++++++++ > 1 file changed, 35 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/adc/nuvoton,npcm-adc.txt > Reviewed-by: Rob Herring <robh@kernel.org>
On Thu, 10 Jan 2019 at 03:44, Tomer Maimon <tmaimon77@gmail.com> wrote: > +Required Node in the NPCM7xx BMC: > +An additional register is present in the NPCM7xx SOC which is > +assumed to be in the same device tree, with and marked as > +compatible with "nuvoton,npcm750-rst". Is there a reason you don't include a phandle to the reset node? I think doing that would make more sense. > +adc: adc@f000c000 { > + compatible = "nuvoton,npcm750-adc"; > + reg = <0xf000c000 0x8>; > + interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>; > + clocks = <&clk NPCM7XX_CLK_ADC>; > +}; > + > +rst: rst@f0801000 { > + compatible = "nuvoton,npcm750-rst", "syscon", > + "simple-mfd"; > + reg = <0xf0801000 0x6C>; > +};
On Sat, 19 Jan 2019 at 02:12, Tomer Maimon <tmaimon77@gmail.com> wrote: > > Hi Joel, > > Thanks for bringing this to my attention, > > I think I will leave it the same way it is now because I will like to develop the reset driver and to handle the NPCM7xx SOC resets. You could also do that. But I was suggesting you use a phandle, so you could then find the node you want without searching the entire device tree for the node with the correct compatible.
On Sun, Jan 20, 2019 at 7:48 PM Joel Stanley <joel@jms.id.au> wrote: > > On Sat, 19 Jan 2019 at 02:12, Tomer Maimon <tmaimon77@gmail.com> wrote: > > > > Hi Joel, > > > > Thanks for bringing this to my attention, > > > > I think I will leave it the same way it is now because I will like to develop the reset driver and to handle the NPCM7xx SOC resets. > > You could also do that. > > But I was suggesting you use a phandle, so you could then find the > node you want without searching the entire device tree for the node > with the correct compatible. That's not really any more efficient. You just search the entire tree for the matching phandle number instead. Well, that was true until we recently added the phandle cache. In any case, it you plan to move to the reset binding (which would be good), then it's better to have nothing in the DT and add something rather than change the DT binding. Rob
diff --git a/Documentation/devicetree/bindings/iio/adc/nuvoton,npcm-adc.txt b/Documentation/devicetree/bindings/iio/adc/nuvoton,npcm-adc.txt new file mode 100644 index 000000000000..1b8132cd9060 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/nuvoton,npcm-adc.txt @@ -0,0 +1,35 @@ +Nuvoton NPCM Analog to Digital Converter (ADC) + +The NPCM ADC is a 10-bit converter for eight channel inputs. + +Required properties: +- compatible: "nuvoton,npcm750-adc" for the NPCM7XX BMC. +- reg: specifies physical base address and size of the registers. +- interrupts: Contain the ADC interrupt with flags for falling edge. + +Optional properties: +- clocks: phandle of ADC reference clock, in case the clock is not + added the ADC will use the default ADC sample rate. +- vref-supply: The regulator supply ADC reference voltage, in case the + vref-supply is not added the ADC will use internal voltage + reference. + +Required Node in the NPCM7xx BMC: +An additional register is present in the NPCM7xx SOC which is +assumed to be in the same device tree, with and marked as +compatible with "nuvoton,npcm750-rst". + +Example: + +adc: adc@f000c000 { + compatible = "nuvoton,npcm750-adc"; + reg = <0xf000c000 0x8>; + interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clk NPCM7XX_CLK_ADC>; +}; + +rst: rst@f0801000 { + compatible = "nuvoton,npcm750-rst", "syscon", + "simple-mfd"; + reg = <0xf0801000 0x6C>; +};
Added device tree binding documentation for Nuvoton BMC NPCM Analog-to-Digital Converter(ADC). Signed-off-by: Tomer Maimon <tmaimon77@gmail.com> --- .../bindings/iio/adc/nuvoton,npcm-adc.txt | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/nuvoton,npcm-adc.txt