diff mbox series

[v3,2/3] dt-bindings: Add PNI RM3100 device tree binding.

Message ID 20181002143812.3661-3-songqiang1304521@gmail.com (mailing list archive)
State New, archived
Headers show
Series Add support for PNI RM3100 magnetometer | expand

Commit Message

Song Qiang Oct. 2, 2018, 2:38 p.m. UTC
Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
---
 .../bindings/iio/magnetometer/pni,rm3100.txt  | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt

Comments

Jonathan Cameron Oct. 7, 2018, 3:18 p.m. UTC | #1
On Tue,  2 Oct 2018 22:38:11 +0800
Song Qiang <songqiang1304521@gmail.com> wrote:

> Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
> ---
>  .../bindings/iio/magnetometer/pni,rm3100.txt  | 20 +++++++++++++++++++
>  1 file changed, 20 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt
> 
> diff --git a/Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt b/Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt
> new file mode 100644
> index 000000000000..4677690fc5d0
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt
> @@ -0,0 +1,20 @@
> +* PNI RM3100 3-axis magnetometer sensor
> +
> +Required properties:
> +
> +- compatible : should be "pni,rm3100"
> +- reg : the I2C address or SPI chip select number of the sensor.
> +
> +Optional properties:
> +
> +- interrupts: data ready (DRDY) from the chip.
> +  The interrupts can be triggered on rising edges.
From Phil's response this appears to be incorrect and
it's actually a level sensitive interrupt.
I haven't checked the data sheet to confirm this.

That'll bring all sorts of pain if you have a host that can only
do edge sensitive so I'm hoping that's not true for you
(edge sensitive only interrupts on hosts are pretty unusual
though it cause me a lot of problems when I started out
with IIO years ago :(

The docs aren't super clear on this.  The subtlety is
whether there is a guaranteed 'low' time between reading the
data and it going high again due to another reading.  This usually
only matters if you are running very quickly though so may be
fine here.

This will only become relevant with continuous mode if you
add support for that later (I think!)

Jonathan

> +
> +Example:
> +
> +rm3100: rm3100@20 {
> +	compatible = "pni,rm3100";
> +	reg = <0x20>;
> +	interrupt-parent = <&gpio0>;
> +	interrupts = <4 IRQ_TYPE_EDGE_RISING>;
> +};
Jonathan Cameron Oct. 7, 2018, 3:20 p.m. UTC | #2
On Sun, 7 Oct 2018 16:18:08 +0100
Jonathan Cameron <jic23@kernel.org> wrote:

> On Tue,  2 Oct 2018 22:38:11 +0800
> Song Qiang <songqiang1304521@gmail.com> wrote:
> 
> > Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
> > ---
> >  .../bindings/iio/magnetometer/pni,rm3100.txt  | 20 +++++++++++++++++++
> >  1 file changed, 20 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt b/Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt
> > new file mode 100644
> > index 000000000000..4677690fc5d0
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt
> > @@ -0,0 +1,20 @@
> > +* PNI RM3100 3-axis magnetometer sensor
> > +
> > +Required properties:
> > +
> > +- compatible : should be "pni,rm3100"
> > +- reg : the I2C address or SPI chip select number of the sensor.
> > +
> > +Optional properties:
> > +
> > +- interrupts: data ready (DRDY) from the chip.
> > +  The interrupts can be triggered on rising edges.  
> From Phil's response this appears to be incorrect and
> it's actually a level sensitive interrupt.
> I haven't checked the data sheet to confirm this.
> 
> That'll bring all sorts of pain if you have a host that can only
> do edge sensitive so I'm hoping that's not true for you
> (edge sensitive only interrupts on hosts are pretty unusual
> though it cause me a lot of problems when I started out
> with IIO years ago :(
> 
> The docs aren't super clear on this.  The subtlety is
> whether there is a guaranteed 'low' time between reading the
> data and it going high again due to another reading.  This usually
> only matters if you are running very quickly though so may be
> fine here.
> 
> This will only become relevant with continuous mode if you
> add support for that later (I think!)
I realised just after I sent this that I was being unclear.

If you aren't doing continuous mode and hence have a fairly
strong guarantee of a decent gap between reads, you may be
able to get away with supporting either LEVEL or EDGE
interrupts.  In continuous mode, it is necessary to have
a minimum low time for EDGE interrupts to work.

Jonathan
> 
> Jonathan
> 
> > +
> > +Example:
> > +
> > +rm3100: rm3100@20 {
> > +	compatible = "pni,rm3100";
> > +	reg = <0x20>;
> > +	interrupt-parent = <&gpio0>;
> > +	interrupts = <4 IRQ_TYPE_EDGE_RISING>;
> > +};  
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt b/Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt
new file mode 100644
index 000000000000..4677690fc5d0
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt
@@ -0,0 +1,20 @@ 
+* PNI RM3100 3-axis magnetometer sensor
+
+Required properties:
+
+- compatible : should be "pni,rm3100"
+- reg : the I2C address or SPI chip select number of the sensor.
+
+Optional properties:
+
+- interrupts: data ready (DRDY) from the chip.
+  The interrupts can be triggered on rising edges.
+
+Example:
+
+rm3100: rm3100@20 {
+	compatible = "pni,rm3100";
+	reg = <0x20>;
+	interrupt-parent = <&gpio0>;
+	interrupts = <4 IRQ_TYPE_EDGE_RISING>;
+};