Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751121AbdGNV1S (ORCPT ); Fri, 14 Jul 2017 17:27:18 -0400 Received: from mail-pg0-f46.google.com ([74.125.83.46]:35493 "EHLO mail-pg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751049AbdGNV1Q (ORCPT ); Fri, 14 Jul 2017 17:27:16 -0400 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 To: Andy Gross , Peter Chen , Peter Rosin From: Stephen Boyd In-Reply-To: <149998530228.4532.1798948469358915658@sboyd-linaro> 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 , Greg Kroah-Hartman References: <20170712010255.26855-1-stephen.boyd@linaro.org> <149998530228.4532.1798948469358915658@sboyd-linaro> Message-ID: <150006762899.13439.5431012472808314482@sboyd-linaro> User-Agent: alot/0.6.0dev Subject: Re: [PATCH 0/3] USB Mux support for Chipidea Date: Fri, 14 Jul 2017 14:27:09 -0700 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v6ELROMG008805 Content-Length: 1297 Lines: 32 Quoting Stephen Boyd (2017-07-13 15:35:02) > Quoting Peter Rosin (2017-07-11 22:04:46) > > > > Maybe no need for a compatible update either, if it works to do something > > like this in the DT? > > > > usb_switch: usb-switch { > > compatible = "gpio-mux"; > > mux-gpios = <&pm8916_gpios 4 GPIO_ACTIVE_HIGH>, > > <&pm8916_gpios XXX GPIO_ACTIVE_XXX>; > > idle-state = <2>; > > #mux-control-cells = <0>; > > pinctrl-names = "default"; > > pinctrl-0 = <&usb_sw_sel_pm>; > > }; > > > > But I obviously know little about how things are wired and really works, > > so that might be totally off... > > > > Otherwise, maybe a generic mux-pinctrl driver would do the trick? > > (compare with drivers/i2c/muxes/i2c-mux-pinctrl.c) > > > > Agreed. Testing looks good when I use the gpio-mux binding. The only thing I noticed is that gpio-mux driver is requesting the gpio with GPIOD_OUT_LOW. Is that intentional? I worry that may randomly mux the D+/D- lines during probe if the gpio is asserted at probe time. It isn't a problem for me right now, because the mux is power on defaulted to have the gpio deasserted, but it may be a problem if the default changes.