From patchwork Mon Nov 7 13:05:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Bailon X-Patchwork-Id: 81087 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1007292qge; Mon, 7 Nov 2016 05:17:51 -0800 (PST) X-Received: by 10.107.29.199 with SMTP id d190mr707386iod.82.1478524671396; Mon, 07 Nov 2016 05:17:51 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h4si26047749pae.285.2016.11.07.05.17.50; Mon, 07 Nov 2016 05:17:51 -0800 (PST) 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 S932632AbcKGNRm (ORCPT + 27 others); 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 Received: by mail-wm0-f46.google.com with SMTP id t79so175958364wmt.0 for ; Mon, 07 Nov 2016 05:05:35 -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=nCO47kwKb61fk+b6o9AYSo/RLeIydUTea7u5sqsnRRY=; b=gqiRXOeviHevm9zeD0dKZJqy1J29Wlmne3BkFVCRcQn6CSRCRpxcRp9lZZjJwXVsFx IsBhU04ihLA2CP6A/BJaeW+Vv+gF++mrcIgPyIKIsPT/GjePxm6Eui/hyEqwJa962rvF ED8HaviMS6FulxsmxV2KIIYtDFHg6Mvbnn5w3xR0n/X17EEq/lV068SVsEPfA9NJbLsz WGE65RfoVg1VjhDZHFGxZmCxEcwFom1IDdok2sz8Lbw9qPdN4wT0cLXuwCcS57XF6NVA mKzFzEGs2jJGT7OifbV2q0U11rbO1fcVfrOciIVqxtBuWHtV5X4R8FqS6ADZ0YC3NXp2 QZSQ== 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=nCO47kwKb61fk+b6o9AYSo/RLeIydUTea7u5sqsnRRY=; b=huHOOhsiUI5hPFU/xu/MG+6YXuXebRBpeRKdBx+2EnUXSV/rkt+5k1IPQV6JMCvCCg N9fgqNux0Ywlq9UIWm44lg6sk5GiUKDxSVKnwlW3Ybb/0dQ/ULDhfCSeryp815oTNNaU gDH7aasJsVfbPSEbRnpiJFHRsUHkfa+zs5TE1J5hhP6XtfoQtXDIjrcHlGbAyllTu7H1 f5cswGmqIoEbgi5pQ+HmFalzuP2C+ieZV0etEQ6ExqtaH0IHBE6HzabUtyEMTus1bwVn 6hQepfTNQSJIteJXuxiDLqF8FCEVCKXLm5O3PrOGiI2C9Nes2lUNBpaJpoQtmOMTdjY1 pPkQ== X-Gm-Message-State: ABUngveP+wgD/j20PUgc0iQbKL4PRZr5ryliLTvx0WyYLVD6jWALN8MhGpHQKDMjwiemwEZ9 X-Received: by 10.28.93.202 with SMTP id r193mr10183993wmb.30.1478523934141; Mon, 07 Nov 2016 05:05:34 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id y2sm30933952wjx.20.2016.11.07.05.05.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Nov 2016 05:05:33 -0800 (PST) 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 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 | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.7.3 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;