* [PATCH 1/3] dt: usb: jz4740: Add DT binding document for OHCI
2015-01-27 13:47 [PATCH 0/3] usb: ohci: jz4740: Add DT support and a fix Zubair Lutfullah Kakakhel
@ 2015-01-27 13:47 ` Zubair Lutfullah Kakakhel
2015-01-27 16:30 ` Sergei Shtylyov
2015-01-27 13:47 ` [PATCH 2/3] usb: ohci: jz4740: add DT support Zubair Lutfullah Kakakhel
2015-01-27 13:47 ` [PATCH 3/3] usb: ohci: jz4740: prepare the clock before enabling it Zubair Lutfullah Kakakhel
2 siblings, 1 reply; 5+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-01-27 13:47 UTC (permalink / raw)
To: stern; +Cc: gregkh, lars, devicetree, linux-kernel, linux-usb,
Zubair.Kakakhel
From: Paul Burton <paul.burton@imgtec.com>
Add the binding documentation for the JZ47xx OHCI controller.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
---
The jz4740 is platform only at the moment.
But DT support is being added
See http://patchwork.linux-mips.org/bundle/paulburton/ci20-v3.20/
jz47xx is used because jz4780 will also use this driver
---
.../bindings/usb/ingenic,jz47xx-ohci.txt | 28 ++++++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/ingenic,jz47xx-ohci.txt
diff --git a/Documentation/devicetree/bindings/usb/ingenic,jz47xx-ohci.txt b/Documentation/devicetree/bindings/usb/ingenic,jz47xx-ohci.txt
new file mode 100644
index 0000000..2fada8b
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/ingenic,jz47xx-ohci.txt
@@ -0,0 +1,28 @@
+Ingenic JZ47XX SoC OHCI controller binding
+
+The Ingenic JZ47XX SoC includes an OHCI compliant USB host controller
+interface for use with USB 1.1 devices.
+
+Required properties:
+ - compatible: Should be "ingenic,jz4740-ohci"
+ - reg: Should contain the address & size of the OHCI controller registers.
+ - interrupt-parent: Should be the phandle of the interrupt controller that
+ delivers interrupts to the OHCI block.
+ - interrupts: Should specify the interrupt provided by interrupt-parent.
+ - clocks: Should contain a single clock specifier for the SoC UHC clock.
+
+Example SoC include file for jz4780:
+
+/ {
+ ohci: jz4780-ohci@0x134a0000 {
+ compatible = "ingenic,jz4780-ohci";
+ reg = <0x134a0000 0x10000>;
+
+ interrupt-parent = <&intc>;
+ interrupts = <5>;
+
+ clocks = <&cgu JZ4780_CLK_UHC>;
+ clock-names = "uhc";
+ };
+};
+
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 1/3] dt: usb: jz4740: Add DT binding document for OHCI
2015-01-27 13:47 ` [PATCH 1/3] dt: usb: jz4740: Add DT binding document for OHCI Zubair Lutfullah Kakakhel
@ 2015-01-27 16:30 ` Sergei Shtylyov
0 siblings, 0 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2015-01-27 16:30 UTC (permalink / raw)
To: Zubair Lutfullah Kakakhel, stern
Cc: gregkh, lars, devicetree, linux-kernel, linux-usb
Hello.
On 01/27/2015 04:47 PM, Zubair Lutfullah Kakakhel wrote:
> From: Paul Burton <paul.burton@imgtec.com>
> Add the binding documentation for the JZ47xx OHCI controller.
> Signed-off-by: Paul Burton <paul.burton@imgtec.com>
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> ---
> The jz4740 is platform only at the moment.
> But DT support is being added
> See http://patchwork.linux-mips.org/bundle/paulburton/ci20-v3.20/
> jz47xx is used because jz4780 will also use this driver
> ---
> .../bindings/usb/ingenic,jz47xx-ohci.txt | 28 ++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/usb/ingenic,jz47xx-ohci.txt
> diff --git a/Documentation/devicetree/bindings/usb/ingenic,jz47xx-ohci.txt b/Documentation/devicetree/bindings/usb/ingenic,jz47xx-ohci.txt
> new file mode 100644
> index 0000000..2fada8b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/ingenic,jz47xx-ohci.txt
> @@ -0,0 +1,28 @@
> +Ingenic JZ47XX SoC OHCI controller binding
I think JZ47xx would look a bit better.
> +
> +The Ingenic JZ47XX SoC includes an OHCI compliant USB host controller
> +interface for use with USB 1.1 devices.
> +
> +Required properties:
> + - compatible: Should be "ingenic,jz4740-ohci"
> + - reg: Should contain the address & size of the OHCI controller registers.
> + - interrupt-parent: Should be the phandle of the interrupt controller that
> + delivers interrupts to the OHCI block.
This is never a required prop, it can be inherited from a parent node.
> + - interrupts: Should specify the interrupt provided by interrupt-parent.
> + - clocks: Should contain a single clock specifier for the SoC UHC clock.
> +
> +Example SoC include file for jz4780:
> +
> +/ {
> + ohci: jz4780-ohci@0x134a0000 {
The ePAPR standard says we shouldn't name the nodes after the chips used
but use the generic names, which would be "usb" in this case. And please drop
"0x" from the <unit-address> part of the name.
> + compatible = "ingenic,jz4780-ohci";
> + reg = <0x134a0000 0x10000>;
> +
> + interrupt-parent = <&intc>;
> + interrupts = <5>;
> +
> + clocks = <&cgu JZ4780_CLK_UHC>;
> + clock-names = "uhc";
You forgot to mention this prop above.
[...]
WBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/3] usb: ohci: jz4740: add DT support
2015-01-27 13:47 [PATCH 0/3] usb: ohci: jz4740: Add DT support and a fix Zubair Lutfullah Kakakhel
2015-01-27 13:47 ` [PATCH 1/3] dt: usb: jz4740: Add DT binding document for OHCI Zubair Lutfullah Kakakhel
@ 2015-01-27 13:47 ` Zubair Lutfullah Kakakhel
2015-01-27 13:47 ` [PATCH 3/3] usb: ohci: jz4740: prepare the clock before enabling it Zubair Lutfullah Kakakhel
2 siblings, 0 replies; 5+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-01-27 13:47 UTC (permalink / raw)
To: stern; +Cc: gregkh, lars, devicetree, linux-kernel, linux-usb,
Zubair.Kakakhel
From: Paul Burton <paul.burton@imgtec.com>
This is a simple matter of providing a match table, the probe code needs
no modification.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---
drivers/usb/host/ohci-jz4740.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/usb/host/ohci-jz4740.c b/drivers/usb/host/ohci-jz4740.c
index 8ddd8f5..bb69733 100644
--- a/drivers/usb/host/ohci-jz4740.c
+++ b/drivers/usb/host/ohci-jz4740.c
@@ -234,11 +234,20 @@ static int jz4740_ohci_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_OF
+static struct of_device_id jz4740_ohci_of_match[] = {
+ { .compatible = "ingenic,jz4740-ohci", },
+ { },
+};
+MODULE_DEVICE_TABLE(of, jz4740_ohci_of_match);
+#endif
+
static struct platform_driver ohci_hcd_jz4740_driver = {
.probe = jz4740_ohci_probe,
.remove = jz4740_ohci_remove,
.driver = {
.name = "jz4740-ohci",
+ .of_match_table = of_match_ptr(jz4740_ohci_of_match),
.owner = THIS_MODULE,
},
};
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 3/3] usb: ohci: jz4740: prepare the clock before enabling it
2015-01-27 13:47 [PATCH 0/3] usb: ohci: jz4740: Add DT support and a fix Zubair Lutfullah Kakakhel
2015-01-27 13:47 ` [PATCH 1/3] dt: usb: jz4740: Add DT binding document for OHCI Zubair Lutfullah Kakakhel
2015-01-27 13:47 ` [PATCH 2/3] usb: ohci: jz4740: add DT support Zubair Lutfullah Kakakhel
@ 2015-01-27 13:47 ` Zubair Lutfullah Kakakhel
2 siblings, 0 replies; 5+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-01-27 13:47 UTC (permalink / raw)
To: stern; +Cc: gregkh, lars, devicetree, linux-kernel, linux-usb,
Zubair.Kakakhel
From: Paul Burton <paul.burton@imgtec.com>
The clock must have been prepared before enabling it.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---
drivers/usb/host/ohci-jz4740.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/host/ohci-jz4740.c b/drivers/usb/host/ohci-jz4740.c
index bb69733..1455a8b 100644
--- a/drivers/usb/host/ohci-jz4740.c
+++ b/drivers/usb/host/ohci-jz4740.c
@@ -189,7 +189,7 @@ static int jz4740_ohci_probe(struct platform_device *pdev)
clk_set_rate(jz4740_ohci->clk, 48000000);
- clk_enable(jz4740_ohci->clk);
+ clk_prepare_enable(jz4740_ohci->clk);
if (jz4740_ohci->vbus)
ohci_jz4740_set_vbus_power(jz4740_ohci, true);
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread