From patchwork Tue Nov 15 17:42:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Bailon X-Patchwork-Id: 82377 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1650456qge; Tue, 15 Nov 2016 09:43:05 -0800 (PST) X-Received: by 10.107.36.144 with SMTP id k138mr2227259iok.177.1479231785353; Tue, 15 Nov 2016 09:43:05 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a4si2676106itg.90.2016.11.15.09.43.05; Tue, 15 Nov 2016 09:43:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933951AbcKORnC (ORCPT + 4 others); Tue, 15 Nov 2016 12:43:02 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:38391 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933866AbcKORm7 (ORCPT ); Tue, 15 Nov 2016 12:42:59 -0500 Received: by mail-wm0-f47.google.com with SMTP id f82so14242893wmf.1 for ; Tue, 15 Nov 2016 09:42:58 -0800 (PST) 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=MtjC+Da5TNviM04eAhg5+OKtswgT0N/tlAThEWRdGY8=; b=utuFY0j1OVqpVTBmOkufSeVDLmnK/HiO2bNnPD9g44MbzX2IfNyOtWXl4i/AS4cJWP ywmVIxPJIUFB+VOpJr7HIfPgKuC1CMX+8czM2Lw1EIbqZXGvf2e3W2L7fkoQ9FQ6btKG Y3hIwhMFmvOpU8h5b5O9Mq1Ys8wFbYkxzMk/MgGHJ+y6DRlxfVrsWggyhkj4hlfiVssE qtmgeNZdHR9vNQltsmJGdkP47fL3oEggVcEAP9112VQvy/w2VbrABpNbWKQGx9yvp7uH dEUC9CyDeSZjm1p0GE3Q+YqWQsvcbpjKUjYf5g1dSK9UPZ6Y3GbCw2etswLZXdZWTQhC TP0Q== 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=MtjC+Da5TNviM04eAhg5+OKtswgT0N/tlAThEWRdGY8=; b=adVkU+haZAakhNWA1qiTZ0MLUgdRoC6vzqKQMeff67LoVCunzw7ZIjR63JdcWbtsMI CNSeZJBF//5Wc/XITykmrjqwr+DJbIdDJy9lcq0oihPxwlDYGMBPBJf9a0eQlmnIsX2m RE28VIqZI70El7h0uwAQWbinXsLR2Dukcg2+z6+0aqhr9V/Z0hY2LeeGuz+rBy8MPs68 stpx0T/KRf/FTForofFnuXQXK3bXU09h7GBP7Q9whrK1BfiWOdKIEW1o5UryISX5gleU YTygLxBBBSGZoqRagO0rfMttXnU5dUMbTz04Oj2hjiNqm6V29FWyuBkTdV6wdrC6RtB8 Juqg== X-Gm-Message-State: ABUngvefYX6w2Et/bVmmjcvLyePNszjb5oTiAp2gR7x2cD5SagVZQ0ghD7gMZi8XAl1lzmnp X-Received: by 10.194.203.135 with SMTP id kq7mr20577025wjc.26.1479231773099; Tue, 15 Nov 2016 09:42:53 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id bj1sm35836295wjc.17.2016.11.15.09.42.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 Nov 2016 09:42:52 -0800 (PST) From: Alexandre Bailon To: david@lechnology.com, b-liu@ti.com, balbi@kernel.org Cc: khilman@baylibre.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, nsekhar@ti.com, Alexandre Bailon Subject: [PATCH v6 2/2] usb: musb: da8xx: Set phy in OTG mode by default Date: Tue, 15 Nov 2016 18:42:47 +0100 Message-Id: <1479231767-2434-3-git-send-email-abailon@baylibre.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1479231767-2434-1-git-send-email-abailon@baylibre.com> References: <1479231767-2434-1-git-send-email-abailon@baylibre.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@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 | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.7.3 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c index 4fc226c..e0dbe14 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) 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 (!musb->is_initialized) + 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;