From: "József Horváth" <info@ministro.hu>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Rob Herring <robh+dt@kernel.org>,
Alexandru Ardelean <aardelean@deviqon.com>,
Alexandru Ardelean <ardeleanalex@gmail.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
Heiko Stuebner <heiko@sntech.de>,
Oleksij Rempel <linux@rempel-privat.de>,
Saravanan Sekar <sravanhome@gmail.com>,
Tomislav Denis <tomislav.denis@avl.com>,
Gene Chen <gene_chen@richtek.com>,
Alex Dewar <alex.dewar90@gmail.com>,
Lee Jones <lee.jones@linaro.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH v2 2/2] dt-bindings: iio: adc: devicetree bindings for texas instruments ads7142
Date: Sun, 16 May 2021 12:30:28 +0000 [thread overview]
Message-ID: <20210516123027.GA16211@dev> (raw)
In-Reply-To: <20210516105720.2b9cf46a@jic23-huawei>
Hi Jonathan,
On Sun, May 16, 2021 at 10:57:20AM +0100, Jonathan Cameron wrote:
> On Sun, 16 May 2021 07:31:05 +0000
> Jozsef Horvath <info@ministro.hu> wrote:
>
> > This is a device tree schema for iio driver for
> > Texas Instruments ADS7142 dual-channel, programmable sensor monitor.
> >
> > Datasheet: https://www.ti.com/lit/ds/symlink/ads7142.pdf
> >
> > Signed-off-by: Jozsef Horvath <info@ministro.hu>
>
> Hi József,
>
> A few comments inline.
>
> thanks,
>
> Jonathan
> > ---
> >
> > changes v1
> > - Redundant parameters (ti,threshold-rising, etc.)
> > are removed
> > - Supply name changed(vref -> avdd)
> > - Added dvdd supply
> > - All the properties are removed with prefix "ti,"
> > changes v2
> > - "ti,prealert-count" parameter added, just for completeness.
> > ---
> > .../bindings/iio/adc/ti,ads7142.yaml | 110 ++++++++++++++++++
> > 1 file changed, 110 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,ads7142.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads7142.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads7142.yaml
> > new file mode 100644
> > index 000000000000..6e52079c68f7
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/adc/ti,ads7142.yaml
> > @@ -0,0 +1,110 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: "http://devicetree.org/schemas/iio/adc/ti,ads7142.yaml#"
> > +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> > +
> > +title: Texas Instruments ADS7142 adc driver device tree bindings
>
> ADC
>
> > +
> > +maintainers:
> > + - József Horváth <info@ministro.hu>
> > +
> > +description: |
> > + This document is for describing the required device tree parameters
> > + for ads7142 adc
>
> ADC
>
> > + The required parameters for proper operation are described below.
> > +
> > + Datasheet: https://www.ti.com/lit/ds/symlink/ads7142.pdf
> > +
> > +properties:
> > + compatible:
> > + const: ti,ads7142
> > +
> > + reg:
> > + maxItems: 1
> > +
> > + interrupts:
> > + description: |
> > + The BUSY/PDY pin is used as interrupt line
>
> RDY ?
I'll fix these typos in v3
>
> > + in autonomous monitoring mode.
> > + maxItems: 1
> > +
> > + avdd-supply:
> > + description: Regulator for the reference voltage
> > +
> > + dvdd-supply: true
> > +
> > + "#address-cells":
> > + const: 1
> > +
> > + "#size-cells":
> > + const: 0
> > +
> > + "#io-channel-cells":
> > + const: 1
> > +
> > + ti,prealert-count:
> > + description: |
> > + Sets the Pre-Alert Event Count for both,
> > + high and low comparators, for both the channels.
>
> Interesting. Why is this a device tree property rather than something
> we want to configure from userspace? Looks like it would map to _period
> after scaling by the sampling frequency.
>
> https://elixir.bootlin.com/linux/latest/source/Documentation/ABI/testing/sysfs-bus-iio#L1003
>
>
Ok, I'll try to bring it to sysfs as you suggested
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + maximum: 15
> > + minimum: 0
> > +
> > +patternProperties:
> > + "^channel@[0-1]$":
> > + $ref: "adc.yaml"
> > + type: object
> > + description: |
> > + Represents the external channels which are connected to the ADC.
> > + properties:
> > + reg:
> > + description: |
> > + The channel number.
> > + items:
> > + minimum: 0
> > + maximum: 1
>
> enum: [0 1]
> is a more compact way of putting this IIRC.
>
I'll do that
> > +
> > + required:
> > + - reg
> > +
> > + additionalProperties: false
> > +
> > +required:
> > + - compatible
> > + - "#io-channel-cells"
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > + - |
> > + i2c {
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > + adc@1f {
> > + compatible = "ti,ads7142";
> > + reg = <0x1f>;
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > +
> > + #io-channel-cells = <1>;
> > +
> > + avdd-supply = <&vdd_3v3_reg>;
> > + dvdd-supply = <&vdd_1v8_reg>;
> > +
> > + interrupt-parent = <&gpio>;
> > + interrupts = <7 2>;
> > +
> > + ti,prealert-count = <4>;
> > +
> > + channel@0 {
> > + reg = <0>;
> > + };
> > +
> > + channel@1 {
> > + reg = <1>;
> > + };
> > + };
> > + };
> > +...
> > +
>
Thank you.
Best regards
József
next prev parent reply other threads:[~2021-05-16 12:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-16 7:30 [PATCH v2 1/2] iio: adc: driver for texas instruments ads7142 Jozsef Horvath
2021-05-16 7:31 ` [PATCH v2 2/2] dt-bindings: iio: adc: devicetree bindings " Jozsef Horvath
2021-05-16 9:57 ` Jonathan Cameron
2021-05-16 12:30 ` József Horváth [this message]
2021-05-16 11:28 ` [PATCH v2 1/2] iio: adc: driver " Jonathan Cameron
2021-05-16 19:07 ` József Horváth
2021-05-17 9:28 ` Jonathan Cameron
2021-05-19 16:50 ` József Horváth
2021-05-22 18:47 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210516123027.GA16211@dev \
--to=info@ministro.hu \
--cc=aardelean@deviqon.com \
--cc=alex.dewar90@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=ardeleanalex@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=gene_chen@richtek.com \
--cc=heiko@sntech.de \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=lee.jones@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rempel-privat.de \
--cc=robh+dt@kernel.org \
--cc=sravanhome@gmail.com \
--cc=tomislav.denis@avl.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).