From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964989AbcKDQnu (ORCPT ); Fri, 4 Nov 2016 12:43:50 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38144 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964930AbcKDQnr (ORCPT ); Fri, 4 Nov 2016 12:43:47 -0400 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 v4 4/4] usb: musb: da8xx: Set phy in OTG mode by default Date: Fri, 4 Nov 2016 17:43:38 +0100 Message-Id: <1478277818-5091-5-git-send-email-abailon@baylibre.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1478277818-5091-1-git-send-email-abailon@baylibre.com> References: <1478277818-5091-1-git-send-email-abailon@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c index 6749aa1..e6f41232 100644 --- a/drivers/usb/musb/da8xx.c +++ b/drivers/usb/musb/da8xx.c @@ -401,6 +401,12 @@ static int da8xx_musb_init(struct musb *musb) goto err_phy_power_on; } + ret = phy_set_mode(glue->phy, PHY_MODE_USB_OTG); + if (ret) { + dev_err(glue->dev, "Failed to set the phy mode.\n"); + goto err_phy_set_mode; + } + msleep(5); /* NOTE: IRQs are in mixed mode, not bypass to pure MUSB */ @@ -410,6 +416,8 @@ static int da8xx_musb_init(struct musb *musb) musb->isr = da8xx_musb_interrupt; return 0; +err_phy_set_mode: + phy_power_off(glue->phy); err_phy_power_on: phy_exit(glue->phy); fail: @@ -433,7 +441,7 @@ static int da8xx_musb_exit(struct musb *musb) } static const struct musb_platform_ops da8xx_ops = { - .quirks = MUSB_DMA_CPPI | MUSB_INDEXED_EP, + .quirks = MUSB_DMA_CPPI | MUSB_INDEXED_EP | MUSB_SKIP_SET_MODE, .init = da8xx_musb_init, .exit = da8xx_musb_exit, -- 2.7.3