Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756704AbdGLGpn (ORCPT ); Wed, 12 Jul 2017 02:45:43 -0400 Received: from mail-db5eur01on0111.outbound.protection.outlook.com ([104.47.2.111]:17120 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755903AbdGLGpi (ORCPT ); Wed, 12 Jul 2017 02:45:38 -0400 Authentication-Results: linuxfoundation.org; dkim=none (message not signed) header.d=none;linuxfoundation.org; dmarc=none action=none header.from=axentia.se; Subject: Re: [PATCH 2/3] usb: chipidea: Hook into mux framework to toggle usb switch To: Stephen Boyd , Peter Chen Cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Rob Clark , Andy Gross , Greg Kroah-Hartman References: <20170712010255.26855-1-stephen.boyd@linaro.org> <20170712010255.26855-3-stephen.boyd@linaro.org> From: Peter Rosin Organization: Axentia Technologies AB Message-ID: <2db7bc39-9274-6007-d971-59e2a577d437@axentia.se> Date: Wed, 12 Jul 2017 08:45:24 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170712010255.26855-3-stephen.boyd@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [81.224.168.30] X-ClientProxiedBy: VI1PR09CA0071.eurprd09.prod.outlook.com (2603:10a6:802:29::15) To HE1PR0202MB2553.eurprd02.prod.outlook.com (2603:10a6:3:8f::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a9e2b8b2-792f-47ee-6bc3-08d4c8f1980d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:HE1PR0202MB2553; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0202MB2553;3:GfLt1FAAlNkhJKNcQIF4HqWYIZbuAjGnSq0aCDnVfqWagrNimY7DJjjPupil7ps5Zm2VBqQlXK7NGOI9R7cZPKSf07IcDk/Fp/lIfCGkNQ/sGPrEw6M/U+ulSe8CW9Qqc2CsYL34hNqoyJssgxFBmEwM2luHOPhSGtO4gNJE65tExYk8dJcl99y/3FHhJ2HR4narAmEyKzuOmsG/57ToWwZmdhKW3OG2zOCOwzZQd/t7YA3tIe2D+UbayOsdpdX3Q+LPVmPfYK+VSx/pAPgyIodSeAfWyeZuo2YFBxMXg0IZDnLPfQlt3sQDYoCMg/WwE6NQ9d/EA0raC0dmx86qBaYKMAQYG+smJhrrBl/dNPdDu8DCxhhFskdj2T2jLsVjbDmSD0bH4kHbtSUk5Zg3qdyyUE0QQiTPtcrvoICFMEbdXhx569CwSk7XW7DoqDQvRNEAwU15WPdroit6sjFVxtfiOCpTvJoRaoddlRCoVeL1eOM/QEHC51bgCF007xV/tpaaThplXEseG+V+pYH9miLGO3RNdeSTQvXB04TfPiKLtEpqU5Cqb2nFLRKnGLEFgx9VBIyA0o0t7XOzBCQfMJkBTETypCxmSWQpJrl4LePAdOx3Bz1KqTul0PdZUXDBC9x78D0C7/al/FJsmm9/z4XiP7V8+gcwl6FKvKhQ0SAKUSv9pdHVOOerKKq/7GSQMXRaufRXKFPTWJvLV1MQxw== X-MS-TrafficTypeDiagnostic: HE1PR0202MB2553: X-Microsoft-Exchange-Diagnostics: 1;HE1PR0202MB2553;25:L88u9sTVowvlOmMbQfxqyJgmC0Y/KyIZfUU6ST1GA19lzaZADQT2z7lA+L84n+7Ga+B7YTuWChk94nVMNV9WgpHtEKFjXyWM6GVGmFC6hKdu/ieBpjbu/ogNRcE5HdHXr+AqCpHjyTkKaCA8AKOC/NSS29rKC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1t2FM26MMDV0TUnUAR9a8520Ec7OFWdDWWFhCNGnxnjipKEusI3GsoWLOYSg9bR9/ZHWUL+KaF4Zux3k0IBtHvJGNV1ncyAPeR9pNgHa64VWFetFxsmRbT/WJKQgLjLiLNpjWxb/pjWfUobU3RUNI3g2FK+j5YhSRz6WQuVplJlZn4MLD/TveSFrqn3z7OS6zia+SYk9xmwl2cLsC9R4zi5jrRorSvS+Kwm7Oyn4qBECDfpDYTDgYxV1eeg41yYLKhbsgR+8wGtV2Pbdbe3mnRBpv8D8jPK5IneCYQK/dMQTvGD3Kw4dpVtS5E87i1Be0WHLPnbMbi8dIYYF6p+y+LP7I+ONzY1um+Gi9xPA6P52Ujhf+xu76NcwHBt79L8Q7RnDkgHhf/ugiaMMtMFWxj9ICmcR5urVBoZNuIaOz7ePw/EnBmhQb16FVhooDs2iZaBxvm6c31130I0UXV3Xk5BMAJ4bvhkHIg== X-Exchange-Antispam-Report-Test: UriScan:(278178393323532)(166708455590820)(236129657087228)(9452136761055)(185117386973197)(21532816269658)(247924648384137); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(2017060910075)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6041248)(20161123562025)(20161123564025)(20161123558100)(2016111802025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(6043046)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:HE1PR0202MB2553;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:HE1PR0202MB2553; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjAyMDJNQjI1NTM7NDp1eUlTUnBwMWJ4UHJFN2JBNk51UEFjN05x?= =?utf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WGYvREJYcTRYVFZCOEQyWmNQemZHNDJZZDc5?= =?utf-8?B?cjVLKzc4MVY1amNSMjFONEZXODgvbVpJaHNOSXhFZjVFQ293Q3dpMEFGczdJ?= =?utf-8?B?RHhyaGpPSmoyQnBFQXJEQStnSElRa2piNTFiMFBaZlZWZ0JZL0xIZFRJQXZY?= =?utf-8?B?cG1yRDNXMCt1b1NMS20rN29oQUhXcFNlNy9lNWc9PQ==?= X-Forefront-PRVS: 036614DD9C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(7370300001)(4630300001)(6049001)(6009001)(39450400003)(39400400002)(39830400002)(39410400002)(24454002)(377424004)(81166006)(305945005)(8676002)(230700001)(74482002)(65806001)(65956001)(66066001)(47776003)(7416002)(53546010)(966005)(478600001)(50986999)(54356999)(76176999)(5660300001)(86362001)(6116002)(3846002)(65826007)(42186005)(33646002)(31686004)(31696002)(25786009)(3260700006)(8656002)(189998001)(229853002)(53936002)(6486002)(77096006)(54906002)(4326008)(6306002)(6666003)(23676002)(4001350100001)(7350300001)(2950100002)(2906002)(38730400002)(50466002)(83506001)(7736002)(6246003)(36756003)(117156002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR0202MB2553;H:[192.168.13.3];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjAyMDJNQjI1NTM7MjM6ZlFGWFVrR21lVUx4NldzVFZ6RW81NmFS?= =?utf-8?B?L2xtTGpJYWgzaCtXTThteEFtRWlZZFB1U00yTFBqMWN1OUVrRHhZZThJcXlt?= =?utf-8?B?eVhUang0YmpaUnlyaGZ6Uld6QTFkRnV0eEorQlUxRkhwZFAweVMya3hlMXMr?= =?utf-8?B?UHUxdWFHZmc4ZlpLTDBEOGNMMzB5SHlNTU1LMHZRRGQ3K1luT082T203YWN4?= =?utf-8?B?eGFoWXc5Sk5TYzRMMHFQcHNJNFZhL2pyalp1UWtScDN3ejNtbXI3QTY0dDhE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ofSY81C4N3Sl6e1TS0EnlJyzn5JmY5R5/sa73t8Z2PiIx453i1wSNBXP8Fc2XnveVskDYUWKWZ/+JGfpg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;HE1PR0202MB2553;7:FgA7hTXxkY8F87WChHDw8vn1yKTdvrMcJ/jvKGQVnhEce22rT8N3GS4bpug5imx6ub0zr/d0o/+dFeQwR8It+eAeBqiRjusJdcSZ+1kz66DL0dxlf6jgFvG85WYNUor0C5kLXJxD5pQpaRThd4b2CvEnkhLD6DCK3dbbDIHPWWaTA57GPUfh2BeBIkzEy+Fio8V/rH3wDG7GRrhMIPDGHa6H1EiGKrMm0sg5ZNfR7TY7MG0Ddn/R2r9qqFsZNsCjpnORTJ0yaGZHoJoodDFvlEFKVXgRXvt9/5/BBUDqXVmqzroEZYjlIDJ8JjQneJ/GKJQnDGyUEb9EPGop8XIOuXbNNWPq1fO2pe2oe6GliN/pQNz6+SGbfkAsUc3q6bN3ljnNMvA9XcaK909AHcHLAr2P9h5ZhzYI6ewI2CPOqNM65+b9wasSzfFKJbPgnrylvw5kv/FA76LGRBNMmKlWC4Qv36r7uqnxXPaISMLqvIwVT5JDt6wrsOLcVhSgWbTSfpTswB8f7HGrscXUzS8CZKkgQGBe5P7fhV0pkc5NddIGhZq1pZ3ne3v/0jg96JXFOWTtMU3EPrhYwoMcLln3iIj3nHVMN30wfM06KaWWoGe2dzB9pmxGQRcK5RbzmIY2pbFBG+mAvaOundpJ409XvfdOevPP/aTRJoGQ2UgNcW9O2HkWoUsL7Tt5IjwtpqVqzg9sjweyfxUXeEojZnVemRr8QxKwiXFhzheAehrS02HEVJwUi5yfvQPteHbBMCQb/NWGZkWkvZVHtqLUGTV28RZoPiwnqldyPcLuCu14xAg= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2017 06:45:31.2584 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0202MB2553 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7947 Lines: 218 On 2017-07-12 03:02, Stephen Boyd wrote: > On the db410c 96boards platform we have a TC7USB40MU on the board > to mux the D+/D- lines coming from the controller between a micro > usb "device" port and a USB hub for "host" roles[1]. During a > role switch, we need to toggle this mux to forward the D+/D- > lines to either the port or the hub. Add the necessary code to do > the role switch in chipidea core via the generic mux framework. > Board configurations like on db410c are expected to change roles > via the sysfs API described in > Documentation/ABI/testing/sysfs-platform-chipidea-usb2. > > [1] https://github.com/96boards/documentation/raw/master/ConsumerEdition/DragonBoard-410c/HardwareDocs/Schematics_DragonBoard.pdf > > Cc: Peter Rosin > Cc: Peter Chen > Cc: Greg Kroah-Hartman > Cc: > Signed-off-by: Stephen Boyd > --- > Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt | 8 ++++++++ > drivers/usb/chipidea/core.c | 17 +++++++++++++++++ > drivers/usb/chipidea/host.c | 10 ++++++++++ > drivers/usb/chipidea/udc.c | 11 +++++++++++ > include/linux/usb/chipidea.h | 14 ++++++++++++++ > 5 files changed, 60 insertions(+) > > diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt > index 0e03344e2e8b..96ce81d975d5 100644 > --- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt > +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt > @@ -76,6 +76,11 @@ Optional properties: > needs to make sure it does not send more than 90% > maximum_periodic_data_per_frame. The use case is multiple transactions, but > less frame rate. > +- mux-controls: The mux control for toggling host/device output of this > + controller. > +- mux-control-names: Shall be "usb_switch" if mux-controls is specified. > +- usb-switch-states: Two u32's defining the state to set on the mux for the > + host mode and device modes respectively. > > i.mx specific properties > - fsl,usbmisc: phandler of non-core register device, with one > @@ -102,4 +107,7 @@ Example: > rx-burst-size-dword = <0x10>; > extcon = <0>, <&usb_id>; > phy-clkgate-delay-us = <400>; > + mux-controls = <&usb_switch>; > + mux-control-names = "usb_switch"; > + usb-switch-states = <0>, <1>; I don't see the need for usb-switch-states? Just assume states 0/1 and if someone later needs some other states, make them add a property that overrides the defaults. Just document that 0 is host and 1 is device. > }; > diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c > index b17ed3a9a304..6531d771f296 100644 > --- a/drivers/usb/chipidea/core.c > +++ b/drivers/usb/chipidea/core.c > @@ -64,6 +64,7 @@ > #include > #include > #include > +#include > > #include "ci.h" > #include "udc.h" > @@ -606,6 +607,7 @@ static int ci_get_platdata(struct device *dev, > { > struct extcon_dev *ext_vbus, *ext_id; > struct ci_hdrc_cable *cable; > + struct ci_hdrc_switch *usb_switch; > int ret; > > if (!platdata->phy_mode) > @@ -690,6 +692,21 @@ static int ci_get_platdata(struct device *dev, > if (of_find_property(dev->of_node, "non-zero-ttctrl-ttha", NULL)) > platdata->flags |= CI_HDRC_SET_NON_ZERO_TTHA; > > + if (IS_ENABLED(CONFIG_MULTIPLEXER)) { > + usb_switch = &platdata->usb_switch; > + usb_switch->mux = devm_mux_control_get(dev, "usb_switch"); > + if (!IS_ERR(usb_switch->mux)) { > + if (of_property_read_u32_index(dev->of_node, > + "usb-switch-states", > + 0, &usb_switch->device)) > + return -EINVAL; > + if (of_property_read_u32_index(dev->of_node, > + "usb-switch-states", > + 1, &usb_switch->host)) > + return -EINVAL; > + } > + } > + > ext_id = ERR_PTR(-ENODEV); > ext_vbus = ERR_PTR(-ENODEV); > if (of_property_read_bool(dev->of_node, "extcon")) { > diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c > index 18cb8e46262d..9fd23ecc2da3 100644 > --- a/drivers/usb/chipidea/host.c > +++ b/drivers/usb/chipidea/host.c > @@ -25,6 +25,7 @@ > #include > #include > #include > +#include > > #include "../host/ehci.h" > > @@ -123,6 +124,13 @@ static int host_start(struct ci_hdrc *ci) > if (usb_disabled()) > return -ENODEV; > > + if (!IS_ERR(ci->platdata->usb_switch.mux)) { > + ret = mux_control_select(ci->platdata->usb_switch.mux, > + ci->platdata->usb_switch.host); > + if (ret) > + return ret; > + } > + You *must* call mux_control_deselect to clean up if there is a failure later in host_start. Is that handled in some non-obvious way? > hcd = __usb_create_hcd(&ci_ehci_hc_driver, ci->dev->parent, > ci->dev, dev_name(ci->dev), NULL); > if (!hcd) > @@ -205,6 +213,8 @@ static void host_stop(struct ci_hdrc *ci) > if (ci->platdata->reg_vbus && !ci_otg_is_fsm_mode(ci) && > (ci->platdata->flags & CI_HDRC_TURN_VBUS_EARLY_ON)) > regulator_disable(ci->platdata->reg_vbus); > + if (!IS_ERR(ci->platdata->usb_switch.mux)) > + mux_control_deselect(ci->platdata->usb_switch.mux); > } > ci->hcd = NULL; > ci->otg.host = NULL; > diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c > index d68b125796f9..ab3355905740 100644 > --- a/drivers/usb/chipidea/udc.c > +++ b/drivers/usb/chipidea/udc.c > @@ -22,6 +22,7 @@ > #include > #include > #include > +#include > > #include "ci.h" > #include "udc.h" > @@ -1899,6 +1900,13 @@ static int udc_start(struct ci_hdrc *ci) > ci->gadget.name = ci->platdata->name; > ci->gadget.otg_caps = otg_caps; > > + if (!IS_ERR(ci->platdata->usb_switch.mux)) { > + retval = mux_control_select(ci->platdata->usb_switch.mux, > + ci->platdata->usb_switch.device); > + if (retval) > + return retval; > + } > + Dito. Cheers, peda > if (ci->is_otg && (otg_caps->hnp_support || otg_caps->srp_support || > otg_caps->adp_support)) > ci->gadget.is_otg = 1; > @@ -1982,6 +1990,9 @@ static void udc_id_switch_for_host(struct ci_hdrc *ci) > hw_write_otgsc(ci, OTGSC_BSVIE | OTGSC_BSVIS, OTGSC_BSVIS); > > ci->vbus_active = 0; > + > + if (!IS_ERR(ci->platdata->usb_switch.mux)) > + mux_control_deselect(ci->platdata->usb_switch.mux); > } > > /** > diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h > index c5fdfcf99828..559bd470b8c0 100644 > --- a/include/linux/usb/chipidea.h > +++ b/include/linux/usb/chipidea.h > @@ -9,6 +9,7 @@ > #include > > struct ci_hdrc; > +struct mux_control; > > /** > * struct ci_hdrc_cable - structure for external connector cable state tracking > @@ -29,6 +30,18 @@ struct ci_hdrc_cable { > struct notifier_block nb; > }; > > +/** > + * struct ci_hdrc_switch - structure for usb mux control > + * @mux: mux to set @host state or @device state on during role switch > + * @host: Value to set for mux to connect D+/D- to host D+/D- lines > + * @device: Value to set for mux to connect D+/D- to device D+/D- lines > + */ > +struct ci_hdrc_switch { > + struct mux_control *mux; > + int host; > + int device; > +}; > + > struct ci_hdrc_platform_data { > const char *name; > /* offset of the capability registers */ > @@ -74,6 +87,7 @@ struct ci_hdrc_platform_data { > /* VBUS and ID signal state tracking, using extcon framework */ > struct ci_hdrc_cable vbus_extcon; > struct ci_hdrc_cable id_extcon; > + struct ci_hdrc_switch usb_switch; > u32 phy_clkgate_delay_us; > }; > >