From patchwork Thu Dec 12 01:42:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 181379 Delivered-To: patches@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp280432ile; Wed, 11 Dec 2019 17:42:44 -0800 (PST) X-Received: by 2002:a63:cc02:: with SMTP id x2mr7770890pgf.114.1576114964316; Wed, 11 Dec 2019 17:42:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576114964; cv=none; d=google.com; s=arc-20160816; b=UOOvw7r+7mMCB8mXPEOwZxxlKCbfKT8G4kE5uxQ24hjsgoDQozSvrDMSvPdtVm/kq9 Y/5h8NfXUkNTiKtMc3tjX+H2ojQCAPjQvKQcQoxCaQvAYpEv1ZTsVxtD5/ufvFPtderK rfRW6U3Mf5pHSf38k0tTizeVEymL8btpVnRB+jdejOvrD3FfzmP6KtijonVCzeqVwgdZ wec1VyvDmK2yONxt3SFo+36MOnWDpSCmQoCiubL7e0G3zjcwVgQOpHIb5KnsmNtnN4Qw cvabx7GCcjLSllvtfWIJgG2DzcMzug0avZR+XLI1VMBqgxFClS+9gpjhJnpHSTCmuy2R K6NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=d5IhBp23ryMELmIbYMLe3sqyK/4LNM7fr/2bl3WTuCg=; b=UvXBYzluNxpsE2Xb8UnuEK/52RSJ3L5o3nyE3Jdv3WEmWWHV2Hw3oKPtbC/V2Nm+69 cjbhveElqsuViIL0/FpeDIoxnDKnwBxh4UBVwJVhLCE1tInN2ekOFYN7LYmQ5gVHYhPi IABlWdq4lmC1GLRdrfFD66QrYaL29cpny98WoKzLapaakQ1NB8YDy74Gn0JMtNIYziCv Sy9I/jIRrdLcLM8ZcTxeQeTswcXspiQUQ51x82gQ0WypRq1gTYdbSWhDf/IjDS+KUWg/ MhI1C6CnDfSz9KWmt4XiUXWjt+SjGjOA5fDn1yczhWtH3mocMtFeG4Tj3NuwfGDGbtDw xL9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=raMTtuMO; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 91sor4546329plc.12.2019.12.11.17.42.44 for (Google Transport Security); Wed, 11 Dec 2019 17:42:44 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=raMTtuMO; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=d5IhBp23ryMELmIbYMLe3sqyK/4LNM7fr/2bl3WTuCg=; b=raMTtuMOBRn5KhhTiB2f+cKZAxr9j94dux8XwBg+AdQkCEszcB2OukPcmMasMfVQ06 obOieKjaUu1K6HpjLXsqBa8lKtiiUbw9JKGzh1vTkCJR9L4im0LQY6BuNMr5ET9fqipd NbyMlxiNyOUaan4utvYpFBN4yr7w+UxPKgbkXFLyK6HxJnuutbTleFouaTh9nevPuXUQ nbIlbU5Wc6+YzMdLxUN01dtD7Z6Zs0TwmqTLfw+zQx8+mWebDDRTS93U/2fmuBPbC0Gy A9F5wrvWUQDpg+Ixnzo0cMRkcfHHIALCeLm/WJUdzdL0BkxyF7vkJgeRMyh+5iuytXHU 09Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=d5IhBp23ryMELmIbYMLe3sqyK/4LNM7fr/2bl3WTuCg=; b=DyPPm/8FEQhit1JNWT2sXdF/VvGZrmzDqcokIpeWaTaPNAuQ0DYqqGWElDgHT8lofy 0Nzq4WVgmAmilEIjLdVjevbo1LI8INkFz9iglCywSevrpIM+8Mkh9I1xrJjRd8vBZY6G 8KNm8W68e5tQA6YbPFYpRPAHsN/SWt/6R1Aq8mngjVnrPQZMYU9eW/QciU1GpoXG+n6o z8QcDxgWx1bNveelsasVNxmYlkH9cGtQ9hw+ZvexwOfFc5ES0oPomM5DksCNvyNT0UUB zT/pvJSNFLhFJ7JxEPbZGcY6Rj9rdVTTY6DnY5Ygt/SKn+HLJ2AsdRJxGb+Ib7+lkG0y XdZg== X-Gm-Message-State: APjAAAUbAtUO1AH+79O1A1HM/x5Jhok8geok/K0XwJm124QNvm2tisfO sH2qrjm5OffBVZmZh/eF7BttJvMS X-Google-Smtp-Source: APXvYqx4StIFuAQtmNTyT3ogARV1ggychWzi6oW+9zl7DfM3kHg2TvXG6rV3Qqhf7Sfk/eBtLVc2yw== X-Received: by 2002:a17:902:d883:: with SMTP id b3mr6353801plz.231.1576114963862; Wed, 11 Dec 2019 17:42:43 -0800 (PST) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id p16sm4217996pgi.50.2019.12.11.17.42.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2019 17:42:43 -0800 (PST) From: John Stultz To: lkml Cc: Yu Chen , Greg Kroah-Hartman , Rob Herring , Mark Rutland , ShuFan Lee , Heikki Krogerus , Suzuki K Poulose , Chunfeng Yun , Felipe Balbi , Hans de Goede , Andy Shevchenko , Jun Li , Valentin Schneider , Guillaume Gardet , Jack Pham , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, John Stultz Subject: [PATCH v7 7/8] dt-bindings: misc: Add bindings for HiSilicon usb hub and data role switch functionality on HiKey960 Date: Thu, 12 Dec 2019 01:42:32 +0000 Message-Id: <20191212014233.32799-8-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191212014233.32799-1-john.stultz@linaro.org> References: <20191212014233.32799-1-john.stultz@linaro.org> From: Yu Chen This patch adds binding documentation to support usb hub and usb data role switch of Hisilicon HiKey960 Board. Cc: Greg Kroah-Hartman Cc: Rob Herring Cc: Mark Rutland CC: ShuFan Lee Cc: Heikki Krogerus Cc: Suzuki K Poulose Cc: Chunfeng Yun Cc: Yu Chen Cc: Felipe Balbi Cc: Hans de Goede Cc: Andy Shevchenko Cc: Jun Li Cc: Valentin Schneider Cc: Guillaume Gardet Cc: Jack Pham Cc: linux-usb@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Yu Chen Signed-off-by: John Stultz --- v3: Reworked as usb-role-switch intermediary v7: Switched over to YAML dt binding description --- .../bindings/misc/hisilicon-hikey-usb.yaml | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/hisilicon-hikey-usb.yaml -- 2.17.1 diff --git a/Documentation/devicetree/bindings/misc/hisilicon-hikey-usb.yaml b/Documentation/devicetree/bindings/misc/hisilicon-hikey-usb.yaml new file mode 100644 index 000000000000..1fc3b198ef73 --- /dev/null +++ b/Documentation/devicetree/bindings/misc/hisilicon-hikey-usb.yaml @@ -0,0 +1,85 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2019 Linaro Ltd. +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/misc/hisilicon-hikey-usb.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: HiKey960 onboard USB GPIO Hub + +maintainers: + - John Stultz + +description: | + Supports the onboard HiKey960 USB GPIO hub, which acts as a + role-switch intermediary to detect the state of the USB-C + port, to switch the hub into dual-role USB-C or host mode, + which enables the onboard USB-A host ports. + + Schematics about the hub can be found here: + https://github.com/96boards/documentation/raw/master/consumer/hikey/hikey960/hardware-docs/HiKey960_Schematics.pdf + +properties: + compatible: + items: + - const: hisilicon,gpio_hubv1 + + typec-vbus-gpios: + $ref: /schemas/types.yaml#/definitions/phandle + description: phandle to the typec-vbus gpio + + otg-switch-gpios: + $ref: /schemas/types.yaml#/definitions/phandle + description: phandle to the otg-switch gpio + + hub-vdd33-en-gpios: + $ref: /schemas/types.yaml#/definitions/phandle + description: phandle to the hub 3.3v power enablement gpio + + usb-role-switch: + $ref: /schemas/types.yaml#/definitions/flag + description: Support role switch. + + port: + description: | + any connector to the data bus of this controller should be modelled + using the OF graph bindings specified, if the "usb-role-switch" + property is used. Note for this driver, two ports are supported, + the first being the endpoint that will be notified by this driver, + and the second being the endpoint that notifies this driver of a + role switch. + + +required: + - compatible + - typec-vbus-gpios + - otg-switch-gpios + - hub-vdd33-en-gpios + - usb-role-switch + - port + +additionalProperties: false + +examples: + - | + hisi_hikey_usb: hisi_hikey_usb { + compatible = "hisilicon,gpio_hubv1"; + 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>; + usb-role-switch; + + port { + #address-cells = <1>; + #size-cells = <0>; + + hikey_usb_ep0: endpoint@0 { + reg = <0>; + remote-endpoint = <&dwc3_role_switch>; + }; + hikey_usb_ep1: endpoint@1 { + reg = <1>; + remote-endpoint = <&rt1711h_ep>; + }; + }; + };