Skip to contentSkip to conversation

iio: light: opt3001: Add device tree binding documentation

PATCH In review Andreas Dannenberg 3 participants 5 messages Jan 29, 2016 – Feb 1, 2016 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: light: opt3001: Add device tree binding documentation

---
 .../devicetree/bindings/iio/light/opt3001.txt      | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/light/opt3001.txt
Documentation/devicetree/bindings/iio/light/opt3001.txt new file +26 -0
new file mode 100644
index 0000000..55b9cb3
@@ -0,0 +1,26 @@
+* Texas Instruments OPT3001 Ambient Light Sensor
+
+The driver supports interrupt-driven and interrupt-less operation, depending
+on whether an interrupt property has been populated into the DT. Note that
+the optional generation of IIO events on rising/falling light threshold changes
+requires the use of interrupts. Without interrupts, only the simple reading
+of the current light value is supported through the IIO API.
+
+http://www.ti.com/product/opt3001
+
+Required properties:
+  - compatible: should be "ti,opt3001"
+  - reg: the I2C address of the sensor
+  
+Optional properties:
+  - interrupt-parent: should be the phandle for the interrupt controller
+  - interrupts: interrupt mapping for GPIO IRQ (configure for falling edge)
+
+Example:
+
+opt3001@44 {
+	compatible = "ti,opt3001";
+	reg = <0x44>;
+	interrupt-parent = <&gpio1>;
+	interrupts = <28 IRQ_TYPE_EDGE_FALLING>;
+};
Signature · 1 line
2.6.4

A message that is not in the archive (sent off-list or not yet received): 1454094180-2688-1-git-send-email-dannenberg-l0cyMroinI0@public.gmane.org

#2 lore raw
Quoted 1 line · Andreas Dannenberg

Looks straight forward enough I'm happy to take this in a few weeks with out a devicetree ack. (though one is as ever welcome!)

In case anyone was wondering, this is retro-documentation - all that has changed recently is the addition of support for running without an interrupt line.

Jonathan

Quoted 38 lines
---
 .../devicetree/bindings/iio/light/opt3001.txt      | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/light/opt3001.txt
Documentation/devicetree/bindings/iio/light/opt3001.txt new file +26 -0
new file mode 100644
index 0000000..55b9cb3
@@ -0,0 +1,26 @@
+* Texas Instruments OPT3001 Ambient Light Sensor
+
+The driver supports interrupt-driven and interrupt-less operation, depending
+on whether an interrupt property has been populated into the DT. Note that
+the optional generation of IIO events on rising/falling light threshold changes
+requires the use of interrupts. Without interrupts, only the simple reading
+of the current light value is supported through the IIO API.
+
+http://www.ti.com/product/opt3001
+
+Required properties:
+  - compatible: should be "ti,opt3001"
+  - reg: the I2C address of the sensor
+  
+Optional properties:
+  - interrupt-parent: should be the phandle for the interrupt controller
+  - interrupts: interrupt mapping for GPIO IRQ (configure for falling edge)
+
+Example:
+
+opt3001@44 {
+	compatible = "ti,opt3001";
+	reg = <0x44>;
+	interrupt-parent = <&gpio1>;
+	interrupts = <28 IRQ_TYPE_EDGE_FALLING>;
+};
Acked-by
#3 lore raw
In reply to a message not in the archive
Quoted 12 lines · Andreas Dannenberg
---
 .../devicetree/bindings/iio/light/opt3001.txt      | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/light/opt3001.txt
Documentation/devicetree/bindings/iio/light/opt3001.txt new file +0 -0
new file mode 100644
index 0000000..55b9cb3

Documentation/devicetree/bindings/iio/light/opt3001.txt line 7

Quoted 7 lines
Documentation/devicetree/bindings/iio/light/opt3001.txt new file +7 -0
@@ -0,0 +1,26 @@
+* Texas Instruments OPT3001 Ambient Light Sensor
+
+The driver supports interrupt-driven and interrupt-less operation, depending
+on whether an interrupt property has been populated into the DT. Note that
+the optional generation of IIO events on rising/falling light threshold changes
+requires the use of interrupts. Without interrupts, only the simple reading
+of the current light value is supported through the IIO API.

Seems like you could poll and do the threshold changes in s/w. Anyway, that's all irrelevant to the DT binding.

#4 lore raw
Quoted 24 lines · Rob Herring
Quoted 12 lines · Andreas Dannenberg
---
 .../devicetree/bindings/iio/light/opt3001.txt      | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/light/opt3001.txt
Documentation/devicetree/bindings/iio/light/opt3001.txt new file +0 -0
new file mode 100644
index 0000000..55b9cb3

Documentation/devicetree/bindings/iio/light/opt3001.txt line 7

Quoted 7 lines
Documentation/devicetree/bindings/iio/light/opt3001.txt new file +7 -0
@@ -0,0 +1,26 @@
+* Texas Instruments OPT3001 Ambient Light Sensor
+
+The driver supports interrupt-driven and interrupt-less operation, depending
+on whether an interrupt property has been populated into the DT. Note that
+the optional generation of IIO events on rising/falling light threshold changes
+requires the use of interrupts. Without interrupts, only the simple reading
+of the current light value is supported through the IIO API.

Seems like you could poll and do the threshold changes in s/w. Anyway, that's all irrelevant to the DT binding.

Quoted 1 line

Oddity occurred during a merge or patch application at some point as I actually had some docs in my local tree copy for this, but they weren't being tracked by git.

Checking back, the original patch series did have docs so not sure what rabbit hole these dropped down. Anyhow, easiest option for me is to just apply this patch and not chase down where the original went!

Have added a note to the commit to this effect. Applied to the togreg branch of iio.git.

Thanks,

Jonathan

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
In reply to Rob Herring
Quoted 7 lines · Rob Herring
Quoted 6 lines · Andreas Dannenberg
---
 .../devicetree/bindings/iio/light/opt3001.txt      | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/light/opt3001.txt
Quoted 16 lines

Documentation/devicetree/bindings/iio/light/opt3001.txt line 7

Quoted 13 lines
Documentation/devicetree/bindings/iio/light/opt3001.txt new file +7 -0
new file mode 100644
index 0000000..55b9cb3
@@ -0,0 +1,26 @@
+* Texas Instruments OPT3001 Ambient Light Sensor
+
+The driver supports interrupt-driven and interrupt-less operation, depending
+on whether an interrupt property has been populated into the DT. Note that
+the optional generation of IIO events on rising/falling light threshold changes
+requires the use of interrupts. Without interrupts, only the simple reading
+of the current light value is supported through the IIO API.

Seems like you could poll and do the threshold changes in s/w. Anyway, that's all irrelevant to the DT binding.

True that. The recent addition of polling mode to the driver did not consider this use case so until somebody has a strong need for this and adds the needed code at least we have this limitation documented.

Regards,
Andreas

Quoted 2 lines