Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp117812yba; Thu, 25 Apr 2019 19:18:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLbVPpTjgr+8klTwOT1VCiUxMj8X+h6UlI19EkLEwCYjqz1Tsd9NBn5/4nh3Rzcu8U90ea X-Received: by 2002:a63:dd0f:: with SMTP id t15mr8178894pgg.414.1556245133993; Thu, 25 Apr 2019 19:18:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556245133; cv=none; d=google.com; s=arc-20160816; b=Yi8iYI/V7qQKNJGYwILhwn8DkwaRLNF0bnr15a5VnE0P1ygfjDf7sYWvuAlv3A/zX6 Iy1aujoxcCrW82l7mFdIr+ym3vD963w5PxHFJrZKjfGh1MN7HX7BcPGxQ3RoCOIeOR2W MkWhCoqIKjCQ/Myc6VHsGXptChgOONkdchzcqNM2voyS11maVnC4VWaeXwLr62llQB1G VhaWPDUw93mTBYbj2SPv4zFKkPI9OVI/J1qJ9N7lMFhnb3YE7N7X/DzSLnUv3W39vxGO JFuuF/d438hWKZM41byZCLdHLyzJmn5eFgzv+uS6wQ5yi+ManTUaz4pof2beWF1Ja/6C eDUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=83boPgIPT34libWzNARLDjvIg1pZbDlCd/DXPurJI3U=; b=l38NFEezYpkpJEHzHJW1Yrwq68vNVu5Y5bhHxJggSy2wae3/jy/QiUlTwGuQ/+r+R1 z/P/+bw6qs4fTu5zmU6u3k1DCj60Ri2c1I8U8wRzr6Fklc6GDbbcbXKL3EXj9JxwGhsl HUNC+2CxfOb6LuDoqAPIlWBudPTuVJkg3SgWW67VGSZ0FpvDR62l/BZSY7vFtLQY0g7X 81UoWe08Gp+YZorMkF5ADR5WRhT7hLPNotC6sgzYa8e5HsqhmHMBW/lb7mbSfLyTXW3t jyW66B0j94AH00V14UFmW+tmXRpkgkyfuk2rscbGLlwySnOUhRbe5U0fZYT9ONUl06K8 PW9A== ARC-Authentication-Results: i=1; mx.google.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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p8si23967291plq.225.2019.04.25.19.18.36; Thu, 25 Apr 2019 19:18:53 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731202AbfDYVff (ORCPT + 99 others); Thu, 25 Apr 2019 17:35:35 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:44075 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbfDYVff (ORCPT ); Thu, 25 Apr 2019 17:35:35 -0400 Received: by mail-oi1-f193.google.com with SMTP id l7so1263877oil.11; Thu, 25 Apr 2019 14:35:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=83boPgIPT34libWzNARLDjvIg1pZbDlCd/DXPurJI3U=; b=k7v4ZCOcUCx4pGTQQ0t4sTN5CIEmcJ0ux0Pw/65aiLB8/QX+3CgLkdGaTiJNbajK8z ba6YddbFHP9lA2jJM0NXdunt7g7t+NTojPyd1ZgZLBGKYeMo07p7l2zRXrb9aZ7iT0FS bFXLapW4eLAGNG1KoDYdTnLF8lJx6yjJwnElD0CdnTyd4SR9CUzz9wV+PbeOaAYOZde/ cQipPb7zkkB6uc4Qh1EjQ0wVnzQrG3QyDW/D/fSf4IXa3+vu68bku4S6XsMJtrf0Axyz EreSVNlBHLMfaqdbJnobpJAnt7RMMbIUwhCihwSKChyevoAapwoQMq1/WgV/ExbJhtuw QmUw== X-Gm-Message-State: APjAAAVtDvxVLxmHSWTYBUpSyc5+ffQw2JRq8b78yFApzlDQk1RfoANG /8al6oZ+uz8PUuW9vDHy7w== X-Received: by 2002:aca:6086:: with SMTP id u128mr4453169oib.79.1556228133472; Thu, 25 Apr 2019 14:35:33 -0700 (PDT) Received: from localhost (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id p189sm733424oih.7.2019.04.25.14.35.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2019 14:35:32 -0700 (PDT) Date: Thu, 25 Apr 2019 16:35:32 -0500 From: Rob Herring To: Yu Chen Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, john.stultz@linaro.org, suzhuangluan@hisilicon.com, kongfei@hisilicon.com, liuyu712@hisilicon.com, wanghu17@hisilicon.com, butao@hisilicon.com, chenyao11@huawei.com, fangshengzhou@hisilicon.com, lipengcheng8@huawei.com, songxiaowei@hisilicon.com, xuyiping@hisilicon.com, xuyoujun4@huawei.com, yudongbin@hisilicon.com, zangleigang@hisilicon.com, Kishon Vijay Abraham I , Sergei Shtylyov , Mark Rutland , Binghui Wang Subject: Re: [PATCH v6 02/13] dt-bindings: misc: Add bindings for HiSilicon usb hub and data role switch functionality on HiKey960 Message-ID: <20190425213532.GA32028@bogus> References: <20190420064019.57522-1-chenyu56@huawei.com> <20190420064019.57522-3-chenyu56@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190420064019.57522-3-chenyu56@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 20, 2019 at 02:40:08PM +0800, Yu Chen wrote: > This patch adds binding documentation to support usb hub and usb > data role switch of Hisilicon HiKey960 Board. Sorry I've been slow to really review this, but I needed to look at the schematics to see what exactly is going on here. I think this needs some changes to better reflect the h/w and utilize existing bindings. It should really be designed ignoring the muxing to start with. Define the binding for the TypeC connector and then the host hub and make sure they can coexist. Then overlay what you need to switch between the 2 modes which AFAICT is just a single GPIO. > > Cc: Kishon Vijay Abraham I > Cc: Sergei Shtylyov > Cc: Rob Herring > Cc: Mark Rutland > Cc: John Stultz > Cc: Binghui Wang > Signed-off-by: Yu Chen > --- > v1: > * Fix some format errors as suggested by Sergei. > * Modify gpio description to use gpiod API. > v2: > * Remove information about Hikey. > * Fix gpio description. > * Remove device_type of endpoint. > v3: > * Remove property typec-vbus-enable-val. > * Add description of pinctrl-names. > * Add example for "hisilicon,gpio-hubv1" > * Add flag in gpiod properties. > --- > --- > .../bindings/misc/hisilicon-hikey-usb.txt | 52 ++++++++++++++++++++++ > 1 file changed, 52 insertions(+) > create mode 100644 Documentation/devicetree/bindings/misc/hisilicon-hikey-usb.txt > > diff --git a/Documentation/devicetree/bindings/misc/hisilicon-hikey-usb.txt b/Documentation/devicetree/bindings/misc/hisilicon-hikey-usb.txt > new file mode 100644 > index 000000000000..422e844df719 > --- /dev/null > +++ b/Documentation/devicetree/bindings/misc/hisilicon-hikey-usb.txt > @@ -0,0 +1,52 @@ > +Support usb hub and usb data role switch of Hisilicon HiKey960 Board. > + > +----------------------------- > + > +Required properties: > +- compatible: "hisilicon,gpio-hubv1","hisilicon,hikey960-usb" > +- typec-vbus-gpios: gpio to control the vbus of typeC port This should be a gpio regulator and then connected to 'vbus-supply' in a usb-connector node (see .../bindings/connectors/usb-connector.txt). Then you also need the RT1711HWSC TypeC controller in DT. That is typically the parent device of the connector node. > +- otg-switch-gpios: gpio to switch DP & DM between the hub and typeC port This probably belongs in USB controller node. > +- hub-vdd33-en-gpios: gpio to enable the power of hub This too should be a gpio regulator and then in a hub node. We have 2 ways to represent hubs. Either as an I2C device or as a child of the host controller. The latter is preferred, but I'm not too sure how the OF graph connection linking the controller to the TypeC connector will work with the usb bus binding. > +- pinctrl-names: pin configuration state name ("default") > +- pinctrl-0: pinctrl config > + > +Example > +----- > + > + hisi_hikey_usb: hisi_hikey_usb { > + compatible = "hisilicon,hikey960-usb"; > + typec-vbus-gpios = <&gpio25 2 GPIO_ACTIVE_HIGH>; > + otg-switch-gpios = <&gpio25 6 GPIO_ACTIVE_HIGH>; > + hub-vdd33-en-gpios = <&gpio5 6 GPIO_ACTIVE_HIGH>; > + pinctrl-names = "default"; > + pinctrl-0 = <&usbhub5734_pmx_func>; > + > + port { > + #address-cells = <1>; > + #size-cells = <0>; > + > + hikey_usb_ep: endpoint@0 { > + reg = <0>; > + remote-endpoint = <&dwc3_role_switch_notify>; > + }; > + }; > + }; > + > + hisi_hikey_usb: hisi_hikey_usb { Perhaps doesn't matter with my above feedback, but I don't understand the point of this 2nd example. > + compatible = "hisilicon,gpio-hubv1"; > + typec-vbus-gpios = <&gpio25 2 GPIO_ACTIVE_LOW>; > + otg-switch-gpios = <&gpio25 6 GPIO_ACTIVE_HIGH>; > + hub-vdd33-en-gpios = <&gpio5 6 GPIO_ACTIVE_HIGH>; > + pinctrl-names = "default"; > + pinctrl-0 = <&usbhub5734_pmx_func>; > + > + port { > + #address-cells = <1>; > + #size-cells = <0>; > + > + hikey_usb_ep: endpoint@0 { > + reg = <0>; > + remote-endpoint = <&dwc3_role_switch_notify>; > + }; > + }; > + }; > -- > 2.15.0-rc2 >