Re: [PATCH 2/2] arm: shmobile: lager: enable HS-USB

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

 




Hello.

On 10/6/2014 4:59 AM, Yoshihiro Shimoda wrote:

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>
---
   arch/arm/boot/dts/r8a7790-lager.dts |    5 +++++
   1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
index 1698591..4badd0a 100644
--- a/arch/arm/boot/dts/r8a7790-lager.dts
+++ b/arch/arm/boot/dts/r8a7790-lager.dts
@@ -445,3 +445,8 @@
   		};
   	};
   };
+
+&hsusb {
+	status = "okay";
+	renesas,enable-gpio = <&gpio5 18 GPIO_ACTIVE_LOW>;

     It's certainly active-high.

Since the current code has the following, we have to set the active_low...

   Exactly opposite conclusion follows from this code.

However, the code is unreadable, I think. So, I will modify the code.

   There's no dire need, I think.

	/* check GPIO determining if USB function should be enabled */
	if (priv->dparam.enable_gpio) {
		gpio_request_one(priv->dparam.enable_gpio, GPIOF_IN, NULL);
		ret = !gpio_get_value(priv->dparam.enable_gpio);
		gpio_free(priv->dparam.enable_gpio);
		if (ret) {

'ret' is non-zero here if gpio_get_value() returned 0, so 0 means "host" and 1 means "gadget", i.e. GPIO is active-high.

			dev_warn(&pdev->dev,
				 "USB function not selected (GPIO %d)\n",
				 priv->dparam.enable_gpio);
			ret = -ENOTSUPP;
			goto probe_end_mod_exit;
		}
	}

Best regards,
Yoshihiro Shimoda

WBR, Sergei

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




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux