lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1478523908-4383-5-git-send-email-abailon@baylibre.com>
Date:   Mon,  7 Nov 2016 14:05:08 +0100
From:   Alexandre Bailon <abailon@...libre.com>
To:     david@...hnology.com, b-liu@...com, balbi@...nel.org
Cc:     kishon@...com, khilman@...libre.com, linux-kernel@...r.kernel.org,
        linux-usb@...r.kernel.org, nsekhar@...com,
        Alexandre Bailon <abailon@...libre.com>
Subject: [PATCH v5 4/4] usb: musb: da8xx: Set phy in OTG mode by default

The DA8xx OTG PHY has some issues when it is forced in host or
peripheral mode. Actually, most of the time, OTG is the best mode
because host or peripheral mode are only required for hardware that
miss some circuitry.
Init the PHY mode OTG mode by default.

Signed-off-by: Alexandre Bailon <abailon@...libre.com>
---
 drivers/usb/musb/da8xx.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index ac0c2f7..a7e7abe 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -340,6 +340,13 @@ static int da8xx_musb_set_mode(struct musb *musb, u8 musb_mode, bool init)
 	struct da8xx_glue *glue = dev_get_drvdata(musb->controller->parent);
 	enum phy_mode phy_mode;
 
+	/*
+	 * The PHY has some issues when it is forced in device or host mode.
+	 * Unless the user request another mode, configure the PHY in OTG mode.
+	 */
+	if (init)
+		return phy_set_mode(glue->phy, PHY_MODE_USB_OTG);
+
 	switch (musb_mode) {
 	case MUSB_HOST:		/* Force VBUS valid, ID = 0 */
 		phy_mode = PHY_MODE_USB_HOST;
-- 
2.7.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ