Re: [PATCH v2 1/3] usb: phy: generic: migrate to gpio_desc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fabio Estevam <festevam@xxxxxxxxx> writes:

> On Tue, Jan 27, 2015 at 12:16 PM, Fabio Estevam <festevam@xxxxxxxxx> wrote:
>> On Tue, Jan 27, 2015 at 11:37 AM,  <robert.jarzmik@xxxxxxx> wrote:
>>
>>> Is in the right node, ie. the node that has compatible == "usb-nop-xceiv" ?
>>
>> Yes, it is correct since this commit:
>> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/imx51-babbage.dts?id=7a9f0604bd56936b2b18f49824e0e392dc7878c3
>
> This is the patch I have applied:
...zip...

This is my device-tree blob:
usb2phy: gpio-vbus@13 {
        compatible = "usb-nop-xceiv";
        vbus-detect-gpio = <&gpio 13 GPIO_ACTIVE_LOW>;
        wakeup;
};

And this is what I have with this latest patch :
[    0.617927] usb_phy_generic pxabus:gpio-vbus@13: GPIO lookup for consumer reset
[    0.618177] usb_phy_generic pxabus:gpio-vbus@13: using device tree for GPIO lookup
[    0.618306] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/pxabus/gpio-vbus@13[0]'
[    0.618425] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/pxabus/gpio-vbus@13[0]'
[    0.618538] usb_phy_generic pxabus:gpio-vbus@13: using lookup tables for GPIO lookup
[    0.618643] usb_phy_generic pxabus:gpio-vbus@13: lookup for GPIO reset failed
[    0.618743] usb_phy_generic pxabus:gpio-vbus@13: GPIO lookup for consumer vbus-detect
[    0.618842] usb_phy_generic pxabus:gpio-vbus@13: using device tree for GPIO lookup
[    0.618943] of_get_named_gpiod_flags: can't parse 'vbus-detect-gpios' property of node '/pxabus/gpio-vbus@13[0]'
[    0.619093] of_get_named_gpiod_flags: parsed 'vbus-detect-gpio' property of node '/pxabus/gpio-vbus@13[0]' - status (0)
[    0.619221] RJK2: nop->gpiod_vbus = c06bf6dc

So I'll submit that one in [1]. It has to work in your case too, it works in
mine ...

Cheers.

--
Robert

---<8---
[1] Patch
>From 4005a6abf519272267399ac4030a5671f7877ca4 Mon Sep 17 00:00:00 2001
From: Robert Jarzmik <robert.jarzmik@xxxxxxx>
Date: Tue, 27 Jan 2015 06:27:03 +0100
Subject: [PATCH] usb: phy: generic: fix the gpios to be optional

All the gpios, ie. reset-gpios and vbus-detect-gpio, should be optional
and not prevent the driver from working. Fix the regression in the
behavior introduced by commit "usb: phy: generic: migrate to gpio_desc".

Signed-off-by: Robert Jarzmik <robert.jarzmik@xxxxxxx>
---
 drivers/usb/phy/phy-generic.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
index dd05254..012534a 100644
--- a/drivers/usb/phy/phy-generic.c
+++ b/drivers/usb/phy/phy-generic.c
@@ -218,12 +218,12 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
 			clk_rate = 0;
 
 		needs_vcc = of_property_read_bool(node, "vcc-supply");
-		nop->gpiod_reset = devm_gpiod_get(dev, "reset-gpios");
-		err = PTR_ERR(nop->gpiod_reset);
+		nop->gpiod_reset = devm_gpiod_get_optional(dev, "reset");
+		err = PTR_ERR_OR_ZERO(nop->gpiod_reset);
 		if (!err) {
-			nop->gpiod_vbus = devm_gpiod_get(dev,
-							 "vbus-detect-gpio");
-			err = PTR_ERR(nop->gpiod_vbus);
+			nop->gpiod_vbus = devm_gpiod_get_optional(dev,
+							 "vbus-detect");
+			err = PTR_ERR_OR_ZERO(nop->gpiod_vbus);
 		}
 	} else if (pdata) {
 		type = pdata->type;
@@ -242,7 +242,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
 	if (err == -EPROBE_DEFER)
 		return -EPROBE_DEFER;
 	if (err) {
-		dev_err(dev, "Error requesting RESET GPIO\n");
+		dev_err(dev, "Error requesting RESET or VBUS GPIO\n");
 		return err;
 	}
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux