From patchwork Mon Nov 21 14:59:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Liu X-Patchwork-Id: 83241 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1573556qge; Mon, 21 Nov 2016 06:59:59 -0800 (PST) X-Received: by 10.129.9.214 with SMTP id 205mr15066022ywj.343.1479740399418; Mon, 21 Nov 2016 06:59:59 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 124si4853932ybz.239.2016.11.21.06.59.59; Mon, 21 Nov 2016 06:59:59 -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; 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; dmarc=fail (p=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754549AbcKUO75 (ORCPT + 4 others); Mon, 21 Nov 2016 09:59:57 -0500 Received: from lelnx194.ext.ti.com ([198.47.27.80]:12539 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754532AbcKUO7x (ORCPT ); Mon, 21 Nov 2016 09:59:53 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id uALExqQk015354; Mon, 21 Nov 2016 08:59:52 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id uALExqsW020144; Mon, 21 Nov 2016 08:59:52 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Mon, 21 Nov 2016 08:59:52 -0600 Received: from dbdmail01.india.ti.com (dbdmail01.india.ti.com [172.24.162.206]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id uALExpdK023323; Mon, 21 Nov 2016 08:59:51 -0600 Received: from uda0271908.am.dhcp.ti.com (uda0271908.am.dhcp.ti.com [128.247.83.228]) by dbdmail01.india.ti.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id uALExW7T009732; Mon, 21 Nov 2016 20:29:49 +0530 From: Bin Liu To: Greg KH CC: Subject: [PATCH 11/11] usb: musb: da8xx: Set phy in OTG mode by default Date: Mon, 21 Nov 2016 08:59:31 -0600 Message-ID: <1479740371-24405-12-git-send-email-b-liu@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1479740371-24405-1-git-send-email-b-liu@ti.com> References: <1479740371-24405-1-git-send-email-b-liu@ti.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Alexandre Bailon 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 Signed-off-by: Bin Liu --- drivers/usb/musb/da8xx.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 1.9.1 -- 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 373b61786fe0..e89708d839e5 100644 --- a/drivers/usb/musb/da8xx.c +++ b/drivers/usb/musb/da8xx.c @@ -343,6 +343,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;