Thread (1 message) 1 message, 1 author, 2014-01-20

Re: [PATCH 4/6] phy-rcar-usb-gen2: add device tree support

From: Ben Dooks <hidden>
Date: 2014-01-20 12:24:34
Also in: linux-sh

On 20/01/14 12:18, Sergei Shtylyov wrote:
Hello.

On 18-01-2014 19:03, Ben Dooks wrote:
quoted
Add support for the phy-rcar-gen2-usb driver to be probed from device
tree.
quoted
Signed-off-by: Ben Dooks <redacted>
Reviewed-by: Ian Molton <redacted>
---
Cc: linux-usb@vger.kernel.org (open list:USB PHY LAYER)
Cc: linux-sh@vger.kernel.org (open list:ARM/SHMOBILE ARM...)
Cc: Magnus Damm <magnus.damm@gmail.com> (supporter:ARM/SHMOBILE ARM...)
Cc: Simon Horman <horms@verge.net.au> (supporter:ARM/SHMOBILE ARM...)
Cc: devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND...)
---
  drivers/usb/phy/phy-rcar-gen2-usb.c | 35
++++++++++++++++++++++++++++++-----
  1 file changed, 30 insertions(+), 5 deletions(-)
quoted
diff --git a/drivers/usb/phy/phy-rcar-gen2-usb.c
b/drivers/usb/phy/phy-rcar-gen2-usb.c
index db3ab34..906b74b 100644
--- a/drivers/usb/phy/phy-rcar-gen2-usb.c
+++ b/drivers/usb/phy/phy-rcar-gen2-usb.c
[...]
quoted
@@ -203,16 +212,31 @@ static int rcar_gen2_usb_phy_probe(struct
platform_device *pdev)
[...]
quoted
+    if (of_id) {
+        int len = 0;
+
+        if (of_get_property(dev->of_node, "renesas,usb0-hs", &len))
+            priv->ugctrl2 = USBHS_UGCTRL2_USB0_HS;
+        else
+            priv->ugctrl2 = USBHS_UGCTRL2_USB0_PCI;
+
+        if (of_get_property(dev->of_node, "renesas,usb2-ss", &len))
    You can use of_property_read_bool() in both cases as both these
props are boolean I guess. It's more handy.
Thanks, missed that one, will sort that out.


-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help