diff mbox

[RFCv4,05/11] Documentation: DT: omap-ssi binding documentation

Message ID 1387150085-23173-6-git-send-email-sre@debian.org
State Superseded, archived
Headers show

Commit Message

Sebastian Reichel Dec. 15, 2013, 11:27 p.m. UTC
Create device tree binding documentation for
OMAP Synchronous Serial Interface (SSI) device.

Signed-off-by: Sebastian Reichel <sre@debian.org>
---
 Documentation/devicetree/bindings/hsi/omap_ssi.txt | 69 ++++++++++++++++++++++
 1 file changed, 69 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hsi/omap_ssi.txt

Comments

Tony Lindgren Dec. 19, 2013, 7:03 p.m. UTC | #1
* Sebastian Reichel <sre@debian.org> [131215 15:30]:
> Create device tree binding documentation for
> OMAP Synchronous Serial Interface (SSI) device.
> 
> Signed-off-by: Sebastian Reichel <sre@debian.org>
> ---
>  Documentation/devicetree/bindings/hsi/omap_ssi.txt | 69 ++++++++++++++++++++++
>  1 file changed, 69 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hsi/omap_ssi.txt
> 
> diff --git a/Documentation/devicetree/bindings/hsi/omap_ssi.txt b/Documentation/devicetree/bindings/hsi/omap_ssi.txt
> new file mode 100644
> index 0000000..0a9efd8
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hsi/omap_ssi.txt
> @@ -0,0 +1,69 @@
> +OMAP SSI controller bindings
> +
> +Required properties:
> +- compatible:		Should include "ti,omap3-ssi".
> +- reg-names:		Contains the values "sys" and "gdd".

Do you need the reg-names? The order won't change so you can just
document the order in the binding?

> +- reg:			Contains a register specifier for each entry in
> +			reg-names.
> +- interrupt-names:      Contains the value "gdd_mpu".

Maybe interrupt-names are not needed either?

> +- interrupts: 		Contains interrupt information for each entry in
> +			interrupt-names.
> +- ranges		Represents the bus address mapping between the main
> +			controller node and the child nodes below.
> +- #address-cells	Should be set to <1>
> +- #size-cells		Should be set to <1>
> +
> +Each port is represented as a sub-node of the ti,omap3-ssi device.
> +
> +Required Port sub-node properties:
> +- compatible:		Should be set to the following value
> +                        ti,omap3-ssi-port (applicable to OMAP34xx devices)
> +- reg-names:		Contains the values "rx" and "tx".

Here too?

> +- reg:			Contains a register specifier for each entry in
> +			reg-names.
> +- interrupt-parent	Should be a phandle for the interrupt controller
> +- interrupt-names:	Contains the values "mpu_irq0" and "mpu_irq1".

And here?

> +- interrupts:		Contains interrupt information for each entry in
> +			interrupt-names.
> +- ti,ssi-cawake-gpio:	Defines which GPIO pin is used to signify CAWAKE
> +			events for the port. This is an optional board-specific
> +			property. If it's missing the port will not be
> +			enabled.

Hmm this might be just a wake-up GPIO? If so, you should be able to
just set it up as an interrupt and do a request_irq on the pinctrl-single
entry for it.

It might even be one of the already mapped interrupt lines that the code is
remuxing to a GPIO for idle? If so, then you can just use the new binding
for interrupts-extended to handle the wake-up events.

If you post the GPIO number for ti,ssi-cawake-gpio and the interrupt
numbers I can check if there's a need to handle it separately as a GPIO
pin or if it already can be automatically handled for the wake-up events.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sebastian Reichel Jan. 10, 2014, 11:52 p.m. UTC | #2
Hi Tony,

On Thu, Dec 19, 2013 at 11:03:44AM -0800, Tony Lindgren wrote:
> > +Required properties:
> > +- compatible:		Should include "ti,omap3-ssi".
> > +- reg-names:		Contains the values "sys" and "gdd".
> 
> Do you need the reg-names? The order won't change so you can just
> document the order in the binding?

The names are not needed, but I like self-documenting code/bindings.

Also the examples in Documentation/devicetree/bindings/resource-names.txt
look similar to this case.

What do you have against the -names properties?

The same statement goes for the following -names comments, so I will
skip them ;)

> [...]
> > +- ti,ssi-cawake-gpio:	Defines which GPIO pin is used to signify CAWAKE
> > +			events for the port. This is an optional board-specific
> > +			property. If it's missing the port will not be
> > +			enabled.
> 
> Hmm this might be just a wake-up GPIO? If so, you should be able to
> just set it up as an interrupt and do a request_irq on the pinctrl-single
> entry for it.

Yes, this gpio is used as interrupt in the driver, but its also read
directly. I already considered making it an irq in the DT data
(since its mainly used as irq), but I could not find out how to read
the current status of an irq line.

> It might even be one of the already mapped interrupt lines that the code is
> remuxing to a GPIO for idle? If so, then you can just use the new binding
> for interrupts-extended to handle the wake-up events.
> 
> If you post the GPIO number for ti,ssi-cawake-gpio and the interrupt
> numbers I can check if there's a need to handle it separately as a GPIO
> pin or if it already can be automatically handled for the wake-up events.

You can see it in one of the next patches, which adds the needed
nodes in omap3-n900.dts. The used GPIO on N900 is 151 (gpio5 23)
and I use the following pinmux configuration:

0x152 (PIN_INPUT | WAKEUP_EN | MUX_MODE4)

P.S.: I intend to get this into 3.15. Before I will send an updated
      series, which uses the omap clock DT bindings as requested by
      DT binding maintainers.

-- Sebastian
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/hsi/omap_ssi.txt b/Documentation/devicetree/bindings/hsi/omap_ssi.txt
new file mode 100644
index 0000000..0a9efd8
--- /dev/null
+++ b/Documentation/devicetree/bindings/hsi/omap_ssi.txt
@@ -0,0 +1,69 @@ 
+OMAP SSI controller bindings
+
+Required properties:
+- compatible:		Should include "ti,omap3-ssi".
+- reg-names:		Contains the values "sys" and "gdd".
+- reg:			Contains a register specifier for each entry in
+			reg-names.
+- interrupt-names:      Contains the value "gdd_mpu".
+- interrupts: 		Contains interrupt information for each entry in
+			interrupt-names.
+- ranges		Represents the bus address mapping between the main
+			controller node and the child nodes below.
+- #address-cells	Should be set to <1>
+- #size-cells		Should be set to <1>
+
+Each port is represented as a sub-node of the ti,omap3-ssi device.
+
+Required Port sub-node properties:
+- compatible:		Should be set to the following value
+                        ti,omap3-ssi-port (applicable to OMAP34xx devices)
+- reg-names:		Contains the values "rx" and "tx".
+- reg:			Contains a register specifier for each entry in
+			reg-names.
+- interrupt-parent	Should be a phandle for the interrupt controller
+- interrupt-names:	Contains the values "mpu_irq0" and "mpu_irq1".
+- interrupts:		Contains interrupt information for each entry in
+			interrupt-names.
+- ti,ssi-cawake-gpio:	Defines which GPIO pin is used to signify CAWAKE
+			events for the port. This is an optional board-specific
+			property. If it's missing the port will not be
+			enabled.
+
+Example for Nokia N900:
+
+ssi-controller@48058000 {
+	compatible = "ti,omap3-ssi";
+
+	/* needed until hwmod is updated to use the compatible string */
+	ti,hwmods = "ssi";
+
+	reg = <0x48058000 0x1000>,
+	      <0x48059000 0x1000>;
+	reg-names = "sys",
+		    "gdd";
+
+	interrupts = <55>;
+	interrupt-names = "gdd_mpu";
+
+	#address-cells = <1>;
+	#size-cells = <1>;
+	ranges;
+
+	ssi-port@0 {
+		compatible = "ti,omap3-ssi-port";
+
+		reg = <0x4805a000 0x800>,
+		      <0x4805a800 0x800>;
+		reg-names = "tx",
+			    "rx";
+
+		interrupt-parent = <&intc>;
+		interrupts = <51>,
+			     <52>;
+		interrupt-names = "mpu_irq0",
+				  "mpu_irq1";
+
+		ti,ssi-cawake-gpio = <&gpio5 23 GPIO_ACTIVE_HIGH>; /* 151 */
+	}
+}