Message ID | 20231004102330.3713-1-andre.werner@systec-electronic.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [1/2] dt-bindings: iio: adc: ti,ads7038: Add description for ADS7038 | expand |
On Wed, Oct 04, 2023 at 12:23:29PM +0200, werneazc@gmail.com wrote: > From: Andre Werner <andre.werner@systec-electronic.com> > Needs a commit message. > Signed-off-by: Andre Werner <andre.werner@systec-electronic.com> > --- > .../bindings/iio/adc/ti,ads7038.yaml | 51 +++++++++++++++++++ > 1 file changed, 51 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml > > diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml > new file mode 100644 > index 000000000000..37fbae95c8e6 > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml > @@ -0,0 +1,51 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/iio/adc/ti,ads7038.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Texas Instruments ADS7038 and similar ADCs > + > +maintainers: > + - Andre Werner <andre.werner@systec-electronic.com> > + > +description: | > + Family of 7 channel, 12 bit ADCs with SPI/I2C interface. > + > + Datasheet: https://www.ti.com/lit/gpn/ads7038 > + > +properties: > + compatible: > + enum: > + - ti,ads7038 > + - ti,ads7138 > + > + reg: > + maxItems: 1 > + > + spi-max-frequency: > + maximum: 60000000 > + > + vref-supply: > + description: Supplies the 2.5V or 5V reference voltage I don't see that in the datasheet. It has AVDD and DVDD. Also, looks like there are GPIOs. Those aren't ever exposed to the OS? > + > +required: > + - compatible > + - reg > + - vref-supply > + > +additionalProperties: false > + > +examples: > + - | > + spi { > + #address-cells = <1>; > + #size-cells = <0>; > + > + adc@0 { > + compatible = "ti,ads7038"; > + reg = <0>; > + vref-supply = <&refin_supply>; > + spi-max-frequency = <10000000>; > + }; > + }; > -- > 2.42.0 >
Dear Mr. Herring, On Wed, Oct 4, 2023 at 5:11 PM Rob Herring <robh@kernel.org> wrote: > > On Wed, Oct 04, 2023 at 12:23:29PM +0200, werneazc@gmail.com wrote: > > From: Andre Werner <andre.werner@systec-electronic.com> > > > > Needs a commit message. Added in an upcoming commit. > > > Signed-off-by: Andre Werner <andre.werner@systec-electronic.com> > > --- > > .../bindings/iio/adc/ti,ads7038.yaml | 51 +++++++++++++++++++ > > 1 file changed, 51 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml > > > > diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml > > new file mode 100644 > > index 000000000000..37fbae95c8e6 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml > > @@ -0,0 +1,51 @@ > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/iio/adc/ti,ads7038.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Texas Instruments ADS7038 and similar ADCs > > + > > +maintainers: > > + - Andre Werner <andre.werner@systec-electronic.com> > > + > > +description: | > > + Family of 7 channel, 12 bit ADCs with SPI/I2C interface. > > + > > + Datasheet: https://www.ti.com/lit/gpn/ads7038 > > + > > +properties: > > + compatible: > > + enum: > > + - ti,ads7038 > > + - ti,ads7138 > > + > > + reg: > > + maxItems: 1 > > + > > + spi-max-frequency: > > + maximum: 60000000 > > + > > + vref-supply: > > + description: Supplies the 2.5V or 5V reference voltage > > I don't see that in the datasheet. It has AVDD and DVDD. Yes, that was a copy-and-paste error from another description used as a template. > > Also, looks like there are GPIOs. Those aren't ever exposed to the OS? Yes, you are right. This is a fundamental implementation of the driver to support the chip family. I want to add further functionalities in upcoming commits. I wanted to get some feedback when the first steps are done to not reinvent everything from the beginning if something is generally wrong in the driver structure and the way I had used the APIs. > > > + > > +required: > > + - compatible > > + - reg > > + - vref-supply > > + > > +additionalProperties: false > > + > > +examples: > > + - | > > + spi { > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + adc@0 { > > + compatible = "ti,ads7038"; > > + reg = <0>; > > + vref-supply = <&refin_supply>; > > + spi-max-frequency = <10000000>; > > + }; > > + }; > > -- > > 2.42.0 > > Regards, André
On Thu, 5 Oct 2023 05:51:40 +0200 werneazc <werneazc@gmail.com> wrote: > Dear Mr. Herring, > > On Wed, Oct 4, 2023 at 5:11 PM Rob Herring <robh@kernel.org> wrote: > > > > On Wed, Oct 04, 2023 at 12:23:29PM +0200, werneazc@gmail.com wrote: > > > From: Andre Werner <andre.werner@systec-electronic.com> > > > > > > > Needs a commit message. > > Added in an upcoming commit. > > > > > > Signed-off-by: Andre Werner <andre.werner@systec-electronic.com> > > > --- > > > .../bindings/iio/adc/ti,ads7038.yaml | 51 +++++++++++++++++++ > > > 1 file changed, 51 insertions(+) > > > create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml > > > new file mode 100644 > > > index 000000000000..37fbae95c8e6 > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml > > > @@ -0,0 +1,51 @@ > > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > > > +%YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/iio/adc/ti,ads7038.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: Texas Instruments ADS7038 and similar ADCs > > > + > > > +maintainers: > > > + - Andre Werner <andre.werner@systec-electronic.com> > > > + > > > +description: | > > > + Family of 7 channel, 12 bit ADCs with SPI/I2C interface. > > > + > > > + Datasheet: https://www.ti.com/lit/gpn/ads7038 > > > + > > > +properties: > > > + compatible: > > > + enum: > > > + - ti,ads7038 > > > + - ti,ads7138 > > > + > > > + reg: > > > + maxItems: 1 > > > + > > > + spi-max-frequency: > > > + maximum: 60000000 > > > + > > > + vref-supply: > > > + description: Supplies the 2.5V or 5V reference voltage > > > > I don't see that in the datasheet. It has AVDD and DVDD. > > Yes, that was a copy-and-paste error from another description used as > a template. > > > > > Also, looks like there are GPIOs. Those aren't ever exposed to the OS? > > Yes, you are right. This is a fundamental implementation of the driver > to support the chip family. I want to add further functionalities in > upcoming commits. > I wanted to get some feedback when the first steps are done to not > reinvent everything from the beginning if something is generally > wrong in the driver structure and the way I had used the APIs. Device tree binding should fully describe the hardware, not what the driver currently implements. So add the GPIOs for v3. > > > > > > + > > > +required: > > > + - compatible > > > + - reg > > > + - vref-supply > > > + > > > +additionalProperties: false > > > + > > > +examples: > > > + - | > > > + spi { > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + > > > + adc@0 { > > > + compatible = "ti,ads7038"; > > > + reg = <0>; > > > + vref-supply = <&refin_supply>; > > > + spi-max-frequency = <10000000>; > > > + }; > > > + }; > > > -- > > > 2.42.0 > > > > > Regards, > > André
diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml new file mode 100644 index 000000000000..37fbae95c8e6 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml @@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/ti,ads7038.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Texas Instruments ADS7038 and similar ADCs + +maintainers: + - Andre Werner <andre.werner@systec-electronic.com> + +description: | + Family of 7 channel, 12 bit ADCs with SPI/I2C interface. + + Datasheet: https://www.ti.com/lit/gpn/ads7038 + +properties: + compatible: + enum: + - ti,ads7038 + - ti,ads7138 + + reg: + maxItems: 1 + + spi-max-frequency: + maximum: 60000000 + + vref-supply: + description: Supplies the 2.5V or 5V reference voltage + +required: + - compatible + - reg + - vref-supply + +additionalProperties: false + +examples: + - | + spi { + #address-cells = <1>; + #size-cells = <0>; + + adc@0 { + compatible = "ti,ads7038"; + reg = <0>; + vref-supply = <&refin_supply>; + spi-max-frequency = <10000000>; + }; + };