Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932631AbcKGNRm (ORCPT ); Mon, 7 Nov 2016 08:17:42 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:37043 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932176AbcKGNFf (ORCPT ); Mon, 7 Nov 2016 08:05:35 -0500 From: Alexandre Bailon To: david@lechnology.com, b-liu@ti.com, balbi@kernel.org Cc: kishon@ti.com, khilman@baylibre.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, nsekhar@ti.com, Alexandre Bailon Subject: [PATCH v5 4/4] usb: musb: da8xx: Set phy in OTG mode by default Date: Mon, 7 Nov 2016 14:05:08 +0100 Message-Id: <1478523908-4383-5-git-send-email-abailon@baylibre.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1478523908-4383-1-git-send-email-abailon@baylibre.com> References: <1478523908-4383-1-git-send-email-abailon@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1080 Lines: 31 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 --- 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