diff mbox series

[1/3] iio: adc: ltc2496: provide device tree binding document

Message ID 20191111214025.18310-1-u.kleine-koenig@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series [1/3] iio: adc: ltc2496: provide device tree binding document | expand

Commit Message

Uwe Kleine-König Nov. 11, 2019, 9:40 p.m. UTC
The ADC only requires the standard stuff for spi devices and a reference
voltage.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 .../devicetree/bindings/iio/adc/ltc2496.txt       | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/ltc2496.txt

Comments

Alexandru Ardelean Nov. 12, 2019, 6:57 a.m. UTC | #1
On Mon, 2019-11-11 at 22:40 +0100, Uwe Kleine-König wrote:
> The ADC only requires the standard stuff for spi devices and a reference
> voltage.
> 

Hey,

Thanks for the patch.

DT bindings must be in YAML format.
But in this case, you can probably extend the existing
"Documentation/devicetree/bindings/iio/adc/ltc2497.txt".

You don't need to create new file altogether.

> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  .../devicetree/bindings/iio/adc/ltc2496.txt       | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/adc/ltc2496.txt
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/ltc2496.txt
> b/Documentation/devicetree/bindings/iio/adc/ltc2496.txt
> new file mode 100644
> index 000000000000..d44ab45b26ea
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/ltc2496.txt
> @@ -0,0 +1,15 @@
> +* Linear Technology / Analog Devices LTC2496 ADC
> +
> +Required properties:
> + - compatible: Must be "lltc,ltc2496"
> + - vref-supply: The regulator supply for ADC reference voltage
> + - further properties required for spi device nodes according to
> +   Documentation/devicetree/bindings/spi/spi-controller.yaml
> +
> +Example:
> +	ltc2497: adc@76 {
> +		compatible = "lltc,ltc2496";
> +		reg = <0>;
> +		vref-supply = <&ltc249x_reg>;
> +		spi-max-frequency = <2000000>;
> +	};
Uwe Kleine-König Nov. 12, 2019, 7:04 a.m. UTC | #2
Hello Alexandru,

On Tue, Nov 12, 2019 at 06:57:49AM +0000, Ardelean, Alexandru wrote:
> On Mon, 2019-11-11 at 22:40 +0100, Uwe Kleine-König wrote:
> > The ADC only requires the standard stuff for spi devices and a reference
> > voltage.
> 
> DT bindings must be in YAML format.

Yeah, I noticed this trend. But given that I only saw .txt files for
iio, I thought I'd stick to that.

> But in this case, you can probably extend the existing
> "Documentation/devicetree/bindings/iio/adc/ltc2497.txt".

I considered that shortly, but as the ltc2497 is an i2c device and the
ltc2496 uses spi I chose to create another simple document instead of
complicating the existing one by describing two nearly orthogonal sets
of properties.

Best regards
Uwe
Alexandru Ardelean Nov. 12, 2019, 11:56 a.m. UTC | #3
On Tue, 2019-11-12 at 08:04 +0100, Uwe Kleine-König wrote:
> [External]
> 
> Hello Alexandru,
> 
> On Tue, Nov 12, 2019 at 06:57:49AM +0000, Ardelean, Alexandru wrote:
> > On Mon, 2019-11-11 at 22:40 +0100, Uwe Kleine-König wrote:
> > > The ADC only requires the standard stuff for spi devices and a
> > > reference
> > > voltage.
> > 
> > DT bindings must be in YAML format.
> 
> Yeah, I noticed this trend. But given that I only saw .txt files for
> iio, I thought I'd stick to that.
> 
> > But in this case, you can probably extend the existing
> > "Documentation/devicetree/bindings/iio/adc/ltc2497.txt".
> 
> I considered that shortly, but as the ltc2497 is an i2c device and the
> ltc2496 uses spi I chose to create another simple document instead of
> complicating the existing one by describing two nearly orthogonal sets
> of properties.

There are dt-bindings that cover both SPI & I2C.
I think ADXL372 does that too.


> 
> Best regards
> Uwe
>
Jonathan Cameron Nov. 16, 2019, 3:25 p.m. UTC | #4
On Tue, 12 Nov 2019 11:56:52 +0000
"Ardelean, Alexandru" <alexandru.Ardelean@analog.com> wrote:

> On Tue, 2019-11-12 at 08:04 +0100, Uwe Kleine-König wrote:
> > [External]
> > 
> > Hello Alexandru,
> > 
> > On Tue, Nov 12, 2019 at 06:57:49AM +0000, Ardelean, Alexandru wrote:  
> > > On Mon, 2019-11-11 at 22:40 +0100, Uwe Kleine-König wrote:  
> > > > The ADC only requires the standard stuff for spi devices and a
> > > > reference
> > > > voltage.  
> > > 
> > > DT bindings must be in YAML format.  
> > 
> > Yeah, I noticed this trend. But given that I only saw .txt files for
> > iio, I thought I'd stick to that.
> >   
> > > But in this case, you can probably extend the existing
> > > "Documentation/devicetree/bindings/iio/adc/ltc2497.txt".  
> > 
> > I considered that shortly, but as the ltc2497 is an i2c device and the
> > ltc2496 uses spi I chose to create another simple document instead of
> > complicating the existing one by describing two nearly orthogonal sets
> > of properties.  
> 
> There are dt-bindings that cover both SPI & I2C.
> I think ADXL372 does that too.
True, but in that case no real choice as the same part does both
bus types.  Here it's probably cleaner to just have a second document.

Thanks,

Jonathan

> 
> 
> > 
> > Best regards
> > Uwe
> >
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/adc/ltc2496.txt b/Documentation/devicetree/bindings/iio/adc/ltc2496.txt
new file mode 100644
index 000000000000..d44ab45b26ea
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/ltc2496.txt
@@ -0,0 +1,15 @@ 
+* Linear Technology / Analog Devices LTC2496 ADC
+
+Required properties:
+ - compatible: Must be "lltc,ltc2496"
+ - vref-supply: The regulator supply for ADC reference voltage
+ - further properties required for spi device nodes according to
+   Documentation/devicetree/bindings/spi/spi-controller.yaml
+
+Example:
+	ltc2497: adc@76 {
+		compatible = "lltc,ltc2496";
+		reg = <0>;
+		vref-supply = <&ltc249x_reg>;
+		spi-max-frequency = <2000000>;
+	};