Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932612AbbFEGdi (ORCPT ); Fri, 5 Jun 2015 02:33:38 -0400 Received: from mail-bn1on0144.outbound.protection.outlook.com ([157.56.110.144]:8722 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754215AbbFEGde (ORCPT ); Fri, 5 Jun 2015 02:33:34 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; arndb.de; dkim=none (message not signed) header.d=none; Date: Fri, 5 Jun 2015 14:32:03 +0800 From: Peter Chen To: Rob Herring CC: Greg Kroah-Hartman , Kishon Vijay Abraham I , , , , Arnd Bergmann Subject: Re: [PATCH v3 6/6] usb: chipidea: add work-around for Marvell HSIC PHY startup Message-ID: <20150605063202.GG15169@shlinux2> References: <1432917526-9688-1-git-send-email-robh@kernel.org> <1432917526-9688-7-git-send-email-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1432917526-9688-7-git-send-email-robh@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD011;1:ZLZjf6Qu4Hg+mHq3oOuxTmCRtqaD4k3nHBaxfJJ4MP/r+A45ouOj/ZlECG5DBbVQf7qIaQi1MUEXANxV7WO+6s7236KLjdCkkTwdNdmsxCUMko1YXr846iRbfU191emIR2xQ2taJQwQuoDb9AkskPQJHv9yD+O4Q1YpNxtogkGxUMEF4ZqBfpAQ7D/jyZ5Jum7hYe8nZjmu8bp/wqOWjNHEhfJDa/V/RRgDBdk/or389U5a/6N8WyFWbhCZWDVs2M0l8a5J1FPYNrgmrS4rCiMqxU2uu302Nxe+UwEVxTdd5LlkrmY8Y0cGpf15QudnCzxW2bFuUdqVF0MUVhPfWmUeVAz50dy7UTM5tkfP0urg= X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(339900001)(24454002)(189002)(51704005)(199003)(83506001)(85426001)(189998001)(19580395003)(46406003)(19580405001)(92566002)(97756001)(33716001)(2950100001)(77096005)(62966003)(77156002)(106466001)(76176999)(50986999)(54356999)(104016003)(6806004)(110136002)(5001960100002)(5001920100001)(33656002)(105606002)(47776003)(50466002)(87936001)(46102003)(86362001)(4001350100001)(23726002)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR03MB601;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB601;2:4xM7AHUEEMREMoiNWzGrtHDxvppu7/Z4NwzdfD1hWKZB5eriEsXws2xQkwYqkHBA;2:JyvDYvQStvGttYkzziUWquXRnEcwSCWlJI2iURCbnGPvncCTmVDK6WImRwG4w3+Znds0fXa8aGuRoC1j25WCM2y8btacVFlfvJRTof4O4+8fbeTKQR9pM1mtowLDx5oFO92V5lR+G5LFjc6/Zi6gCJKGFs6mEDtnBMOtVeszNxj5mFf2LCBJ5hLe17bkTNhwa6gDwS/dLDugwgHEJiLYy467bWKDeQQHsuZsFsyfTAM=;6:JFBgM3kGajcRHEWwY/l36paZjaBBNJjWzwdr7EsWjG3TD66t6LjJqz0Lu0lUdFJbXNj3Dog+wvx0PM4cLBNAl4nx6Irx4GINKZEkYMuDbg0vCC/+U17H8q179gEzi5LqPzddI+11e2BxqHCix265Pm97UyophKLDSGLSRpU7DoTTPdXHySKMagRkdVTNWnJJ98akC5EhWfqYtR4ccah+iLOi0H+d3FIncqGdA2N36WR+lhX/AkipchKtni62uQ5EixxP4aJKbBJiTKX1IhV3XJeWzv8ZJSB+4jIrnjXPunnWdhigKwczsSlXyAHoBJZr6dy1gOreytFdao33H9XT7Q==;3:XrbjAEkcu2nsMTUQl+upiXOVFR7jKiiJruGBE3UOBPwiKVO1KSU+/9nFyMSntUFJaLCGMFmITbyGYx71VAzgzokI0PlEPV8vFOZjyznkVCv6b7CJhvSuVrHGM++OxqOWm1/W/QFtDhofPPvh5o7flWXw1BHKVu9OBbcckhbjZ14dSj0O5fIZDl7KV5lN0PywoIbPf/eLtHXmMNUQwdl/YTTGe4jo459tfgv9mLznN0lHlsln/LR1Qg5JT3zdL5eHtGAIseIq3HhjvAjuHPGQW4jOd+M4yCm/ICj5susXaj6Ze5riFrxZrQPlNWpC+yDl X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB601; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(520003)(3002001);SRVR:BLUPR03MB601;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB601; X-Forefront-PRVS: 05986C03E0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR03MB601;9:CPzHnL4DqCRHhk7e/dNPVwArzaVPFbOFTr+RwweOZZQ?= =?us-ascii?Q?jKiCcBEKcAxsv5PZg3K+tyYw+YK6fLrw9We1LIki1lC6nAZM9lTSY4f3LVwN?= =?us-ascii?Q?YcbGoQk/zlaS2cRSvJLnTy7roRp8BB8Ge0vAG2EZGdJ+TLUogLMXCqIPVFGW?= =?us-ascii?Q?1ZAN7VhcO+bmximSfy/ROOR546zvjyzOFzIRp8qPKDRorcyRDWZirvPP31hf?= =?us-ascii?Q?/oyeO3mSU7E0TeFSOVvu7LhR10174fvDcyxHfFoosId4EFa8mZVPj+pzE7GL?= =?us-ascii?Q?+RZmRTpHcwvAQEl3qujJRT1J5tKwFFO0h9rtWw/L4o1JkwC2pPUTRs9p1pkQ?= =?us-ascii?Q?QOttfjQRjLltYRUIncAnNzCGTL6lDFxejYxYVJV+H5HE56Q5W7PvF0DcPJO1?= =?us-ascii?Q?poi83qwQcUXec77UGZEvKBGUI/Sub57G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fcofv7JtXMOMs7b5G X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2015 06:33:31.9635 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB601 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2533 Lines: 80 On Fri, May 29, 2015 at 11:38:46AM -0500, Rob Herring wrote: > The Marvell 28nm HSIC PHY requires the port to be forced to HS mode after > the port power is applied. This is done using the test mode in the PORTSC > register. > > As HSIC is always HS, this work-around should be safe to do with all HSIC > PHYs and has been tested on i.MX6S. tested on i.mx6sx > > Signed-off-by: Rob Herring > Tested-by: Peter Chen > Cc: Greg Kroah-Hartman > Cc: linux-usb@vger.kernel.org > --- > drivers/usb/chipidea/host.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c > index 21fe1a3..6cf87b8 100644 > --- a/drivers/usb/chipidea/host.c > +++ b/drivers/usb/chipidea/host.c > @@ -37,12 +37,14 @@ static int (*orig_bus_suspend)(struct usb_hcd *hcd); > > struct ehci_ci_priv { > struct regulator *reg_vbus; > + struct ci_hdrc *ci; > }; > > static int ehci_ci_portpower(struct usb_hcd *hcd, int portnum, bool enable) > { > struct ehci_hcd *ehci = hcd_to_ehci(hcd); > struct ehci_ci_priv *priv = (struct ehci_ci_priv *)ehci->priv; > + struct ci_hdrc *ci = priv->ci; > struct device *dev = hcd->self.controller; Forgot to comment last time, the ci is the private driver_data for ci->dev, so you can get ci by calling dev_get_drvdata(dev), no need to add an entry at struct ehci_ci_priv. > int ret = 0; > int port = HCS_N_PORTS(ehci->hcs_params); > @@ -64,6 +66,15 @@ static int ehci_ci_portpower(struct usb_hcd *hcd, int portnum, bool enable) > return ret; > } > } > + > + if (enable && (ci->platdata->phy_mode == USBPHY_INTERFACE_MODE_HSIC)) { > + /* > + * Marvell 28nm HSIC PHY requires forcing the port to HS mode. > + * As HSIC is always HS, this should be safe for others. > + */ > + hw_port_test_set(ci, 5); > + hw_port_test_set(ci, 0); > + } > return 0; > }; > > @@ -112,6 +123,7 @@ static int host_start(struct ci_hdrc *ci) > > priv = (struct ehci_ci_priv *)ehci->priv; > priv->reg_vbus = NULL; > + priv->ci = ci; > > if (ci->platdata->reg_vbus && !ci_otg_is_fsm_mode(ci)) { > if (ci->platdata->flags & CI_HDRC_TURN_VBUS_EARLY_ON) { > -- > 2.1.0 > -- Best Regards, Peter Chen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/