From patchwork Fri Nov 4 16:43:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Bailon X-Patchwork-Id: 80893 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp71672qge; Fri, 4 Nov 2016 09:44:19 -0700 (PDT) X-Received: by 10.98.159.136 with SMTP id v8mr8329276pfk.82.1478277858940; Fri, 04 Nov 2016 09:44:18 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 75si15804942pfx.116.2016.11.04.09.44.18; Fri, 04 Nov 2016 09:44:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964990AbcKDQnu (ORCPT + 27 others); 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 Received: by mail-wm0-f54.google.com with SMTP id f82so2116964wmf.1 for ; Fri, 04 Nov 2016 09:43:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YRpq/wPTTjsz9jWe7eJmz/aScYgEEMsCywvpGEp0ebs=; b=Vb+dAiZgjoMbMlXY2NsuvN4LeFSu/y7o4B+YjG0fTLl0558yDRZYa2HO2lE4lBS2AR 1KnPOWXHhmDKBA47Tjhv71ZzzJ0FVnXSJ6jtyl6gnGyuTx9moI1Zb8808KrLk8rD6tBx XiRddUtb70ZQpMDE9uHAH9wzAln3q7bpqEaelI+Z+6Nr5qreduYz5DKur92NyCM8iVe5 mLXykVxjdLpM6wJbou0xNnjf7GFBVnKdDN1dmhmO2AzylXsZZGt+tj/5eEHFYMpPykvF 82E7+2fn5mD1cx3uOOkBDZFBWduQ40JxDjHmFhA+iYb7oXZmCZ8oCSKO2xM3Ulcni7a9 7X7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YRpq/wPTTjsz9jWe7eJmz/aScYgEEMsCywvpGEp0ebs=; b=hkpvJYueiSL10rDfl5YI2pDqNIeYSBKPkqa9t6UIn4edCDEUCsYR3hSrm5dizFC3RQ sfQeW9yahPrSDbB6f9ByPELgY+BI5CIpeNWHcoOo1i8Rggkqauh4ieoJr6MzOvDpaqwE 90nNbcW0CVPCMZTfaB3Hk45idcrLA8VT5h//zGFKvDAdIOJY1oJUhQbJNCRIgkSH5bEC d4m/we2yRsGwNSVB4JoaOPL0B77qBReSiA5+wZ1TLzR08WaLAtBndTQLV2/W0fJhOgfP ThC+3UoTyTwH0oFV4h+kjt/j1qaZxNLq71TdqftnZjAgrlDS04MnGfo6gcEFf1mKXgUw NbbQ== X-Gm-Message-State: ABUngvew1IhuiIo24NQ5aIX7Sz7xqexv04MOd3qaraa0juRjYYCiAKZ+tOdGFd82uBLimjih X-Received: by 10.194.246.169 with SMTP id xx9mr12573859wjc.76.1478277825701; Fri, 04 Nov 2016 09:43:45 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id af4sm15148128wjc.17.2016.11.04.09.43.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Nov 2016 09:43:45 -0700 (PDT) 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 Precedence: bulk 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(-) -- 2.7.3 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,