* [PATCH 5/5] Documentation: bindings: Add ti,lmp92001
@ 2017-08-01 9:17 s.abhisit-Re5JQEeQqe8AvxtiuMwx3w
2017-08-07 9:23 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: s.abhisit-Re5JQEeQqe8AvxtiuMwx3w @ 2017-08-01 9:17 UTC (permalink / raw)
To: linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
jic23-DgEjT+Ai2ygdnm+yROfE0A, knaack.h-Mmb7MZpHnFY,
lars-Qo5EllUWu/uELgA04lAiVw, pmeerw-jW+XmwGofnusTnJN9+BGXg
Cc: linux-gpio-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-iio-u79uwXL29TY76Z2rM5mHXA, Abhisit Sangjan
From: Abhisit Sangjan <s.abhisit-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
.../devicetree/bindings/gpio/gpio-lmp92001.txt | 29 ++++++++++++++++++
.../bindings/iio/adc/ti-lmp92001-adc.txt | 21 +++++++++++++
.../bindings/iio/dac/ti-lmp92001-dac.txt | 35 ++++++++++++++++++++++
3 files changed, 85 insertions(+)
create mode 100644 Documentation/devicetree/bindings/gpio/gpio-lmp92001.txt
create mode 100644 Documentation/devicetree/bindings/iio/adc/ti-lmp92001-adc.txt
create mode 100644 Documentation/devicetree/bindings/iio/dac/ti-lmp92001-dac.txt
diff --git a/Documentation/devicetree/bindings/gpio/gpio-lmp92001.txt b/Documentation/devicetree/bindings/gpio/gpio-lmp92001.txt
new file mode 100644
index 0000000..62267ff
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-lmp92001.txt
@@ -0,0 +1,29 @@
+* Texas Instruments' LMP92001 GPIOs
+
+Required properties:
+ - compatible: Must be set to "ti,lmp92001-gpio".
+ - reg: i2c chip address for the device.
+ - gpio-controller: Marks the device node as a gpio controller.
+ - #gpio-cells : Should be two. The first cell is the pin number and the
+ second cell is used to specify the gpio polarity:
+ 0 = Active high
+ 1 = Active low
+- ti,lmp92001-gpio-dir: bit mask for direction and drive logic default. Since
+ the direction and the internal pull-down are shared register and similar to
+ open-collector drive:
+ 0 = [O]utput and also meaning drive it to low
+ 1 = [I]nput and also meaning open, to drive it to high is required to
+ have an external resistor
+
+Example:
+lmp92001@20 {
+ compatible = "ti,lmp92001";
+ reg = <0x20>;
+
+ lmp92001_gpio: lmp92001-gpio {
+ compatible = "ti,lmp92001-gpio";
+ gpio-controller;
+ #gpio-cells = <2>;
+ ti,lmp92001-gpio-dir = /bits/ 8 <0xff>;
+ };
+};
\ No newline at end of file
diff --git a/Documentation/devicetree/bindings/iio/adc/ti-lmp92001-adc.txt b/Documentation/devicetree/bindings/iio/adc/ti-lmp92001-adc.txt
new file mode 100644
index 0000000..34d7809
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/ti-lmp92001-adc.txt
@@ -0,0 +1,21 @@
+* Texas Instruments' LMP92001 ADCs
+
+Required properties:
+ - compatible: Must be set to "ti,lmp92001-adc".
+ - reg: i2c chip address for the device.
+ - ti,lmp92001-adc-mode: adc operation, either continuous or single-shot.
+ - ti,lmp92001-adc-mask: bit mask for which channel is enable.
+ 0 = Off
+ 1 = On
+
+Example:
+lmp92001@20 {
+ compatible = "ti,lmp92001";
+ reg = <0x20>;
+
+ lmp92001-adc {
+ compatible = "ti,lmp92001-adc";
+ ti,lmp92001-adc-mode = "continuous";
+ ti,lmp92001-adc-mask = <0x00000079>;
+ };
+};
\ No newline at end of file
diff --git a/Documentation/devicetree/bindings/iio/dac/ti-lmp92001-dac.txt b/Documentation/devicetree/bindings/iio/dac/ti-lmp92001-dac.txt
new file mode 100644
index 0000000..f058cc0
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/dac/ti-lmp92001-dac.txt
@@ -0,0 +1,35 @@
+* Texas Instruments' LMP92001 DACs
+
+Required properties:
+ - compatible: Must be set to "ti,lmp92001-dac".
+ - reg: i2c chip address for the device.
+ - ti,lmp92001-dac-hiz: hi-impedance control,
+ 1 = Forces all OUT[1:12] outputs to hi-z, 0 = normal
+ - ti,lmp92001-dac-outx:
+ Cy = 0, 1 = will force associated OUTx outputs to VDD
+ Cy = 0, 0 = will force associated OUTx outputs to GND
+ - ti,lmp92001-dac-gang: What group of Cy is governed to.
+ -----------------------------------------
+ | Cy | CDAC:GANG = 0 | CDAC:GANG = 1 |
+ -----------------------------------------
+ | C1 | OUT[1:4] | OUT[1:3] |
+ -----------------------------------------
+ | C2 | OUT[5:6] | OUT[4:6] |
+ -----------------------------------------
+ | C3 | OUT[7:8] | OUT[7:9] |
+ -----------------------------------------
+ | C4 | OUT[9:12] | OUT[10:12] |
+ -----------------------------------------
+
+Example:
+lmp92001@20 {
+ compatible = "ti,lmp92001";
+ reg = <0x20>;
+
+ lmp92001-dac {
+ compatible = "ti,lmp92001-dac";
+ ti,lmp92001-dac-hiz = /bits/ 8 <0>;
+ ti,lmp92001-dac-outx = /bits/ 8 <0>;
+ ti,lmp92001-dac-gang = /bits/ 8 <0>;
+ };
+};
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 5/5] Documentation: bindings: Add ti,lmp92001
2017-08-01 9:17 [PATCH 5/5] Documentation: bindings: Add ti,lmp92001 s.abhisit-Re5JQEeQqe8AvxtiuMwx3w
@ 2017-08-07 9:23 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2017-08-07 9:23 UTC (permalink / raw)
To: s.abhisit
Cc: Rob Herring, Mark Rutland, Jonathan Cameron, Hartmut Knaack,
Lars-Peter Clausen, Peter Meerwald, linux-gpio@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org
On Tue, Aug 1, 2017 at 11:17 AM, <s.abhisit@gmail.com> wrote:
> + - #gpio-cells : Should be two. The first cell is the pin number and the
> + second cell is used to specify the gpio polarity:
> + 0 = Active high
> + 1 = Active low
Just reference the standard bindings?
> +- ti,lmp92001-gpio-dir: bit mask for direction and drive logic default. Since
> + the direction and the internal pull-down are shared register and similar to
> + open-collector drive:
> + 0 = [O]utput and also meaning drive it to low
> + 1 = [I]nput and also meaning open, to drive it to high is required to
> + have an external resistor
NACK this is totally wrong.
When using GPIO descriptors, consumers specify open drain/collector, not
producers. The same applies to this: the consumers should specify it not
the producer.
You need to either add a pin control interface/driver or extend the GPIO
bindings for consumers to do this, I thin pin control is the right thing here.
It's gonna be complicated but much better.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-07 9:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-01 9:17 [PATCH 5/5] Documentation: bindings: Add ti,lmp92001 s.abhisit-Re5JQEeQqe8AvxtiuMwx3w
2017-08-07 9:23 ` Linus Walleij
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).