From patchwork Tue Feb 21 09:50:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pin-yen Lin X-Patchwork-Id: 655422 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5073EC64EC7 for ; Tue, 21 Feb 2023 09:52:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234097AbjBUJwv (ORCPT ); Tue, 21 Feb 2023 04:52:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234096AbjBUJwa (ORCPT ); Tue, 21 Feb 2023 04:52:30 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD8C625B84 for ; Tue, 21 Feb 2023 01:52:06 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id pt11so4807803pjb.1 for ; Tue, 21 Feb 2023 01:52:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7KeF8sbIF5LHnbX7Evn75V4pUil7wWg+hWCOFBTaCWI=; b=U/8WpNYMcjlAqZBfStPokuW49nUktWatijn7WvRieR36wOdR8dnb1wadNo6P4/DVgg JOU7TrIHTnw5Ax61Z1zxb3lAdr4/n23kzJc4gkoU+dFJHg3YTcI7eE/uuE6Znnq0FL9C CZECyO5WacoY/m3q7e6/BCPtkFmxbrz0bQWDA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7KeF8sbIF5LHnbX7Evn75V4pUil7wWg+hWCOFBTaCWI=; b=P9p4Z+tBbvwzmt302eSxIHdQFIcpHKHtCSwdWF0+CJSgFdKhryX/GUBleO/AgjfEPe IjFrPn9eIm9sfSvAi9J7mKdUb/JViq5Un9F4aV2ph0PDeiXSzYKBG8A0dK2dF7xKKU56 qz2ebX3BvuvWdFWjGcd4SOj5oIoanKFbjfZ7B5W1AM7HD+WBqENUGqcxyD2/00vzFfzv P6lyaz1A5zgvEDNElrMh7n/L55TH/gVcb2O94lVhA4vPRDF9uZTnLFWx4QiWIvOsj+Jt 26yeLa0x0YZ5f2oAfTpaha3UCKD1ngSBhwyAMZ34IYl2KbVcQoKkoHvGCSKU+p0NruyU /nyQ== X-Gm-Message-State: AO0yUKUMBWnT2ibkjK7DI3Au2QW73XyeZWfKLRbFB4heLHMvHty0e8ur zG+/o3O1zMK0RM09qe0soy2SYg== X-Google-Smtp-Source: AK7set879xuB5FMuYlzSIOYc5OubRRJ8vL3kx+uLoHWbJr2CHpGSArrdkpmvQSW25X1iJjN943zB3g== X-Received: by 2002:a05:6a20:6683:b0:c7:34af:65ac with SMTP id o3-20020a056a20668300b000c734af65acmr617149pzh.14.1676973125232; Tue, 21 Feb 2023 01:52:05 -0800 (PST) Received: from treapking.tpe.corp.google.com ([2401:fa00:1:10:a1f5:f58d:584e:5906]) by smtp.gmail.com with ESMTPSA id t25-20020a656099000000b004eca54eab50sm3524918pgu.28.2023.02.21.01.51.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 01:52:04 -0800 (PST) From: Pin-yen Lin To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J . Wysocki" , Prashant Malani , Benson Leung , Guenter Roeck Cc: Pin-yen Lin , linux-kernel@vger.kernel.org, Hsin-Yi Wang , Marek Vasut , Thomas Zimmermann , dri-devel@lists.freedesktop.org, Xin Ji , Lyude Paul , Allen Chen , devicetree@vger.kernel.org, AngeloGioacchino Del Regno , =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= , chrome-platform@lists.linux.dev, Javier Martinez Canillas , linux-acpi@vger.kernel.org, Stephen Boyd Subject: [PATCH v12 08/10] dt-bindings: display: bridge: it6505: Add mode-switch support Date: Tue, 21 Feb 2023 17:50:52 +0800 Message-Id: <20230221095054.1868277-9-treapking@chromium.org> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog In-Reply-To: <20230221095054.1868277-1-treapking@chromium.org> References: <20230221095054.1868277-1-treapking@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org ITE IT6505 can be used in systems to switch the DP traffic between two downstreams, which can be USB Type-C DisplayPort alternate mode lane or regular DisplayPort output ports. Update the binding to accommodate this usage by introducing a data-lanes and a mode-switch property on endpoints. Signed-off-by: Pin-yen Lin --- Changes in v12: - Fixed the schema of "data-lanes" property for it6505 - Reworded the description of the mode-switch property Changes in v11: - Updated the description of the endpoints in the bindings - Referenced video-interfaces.yaml instead for the endpoints binding - Removed duplicated definitions from inherited schema Changes in v9: - Fixed subject prefix again - Changed the naming of the example node for it6505 Changes in v8: - Updated bindings for data-lanes property - Fixed subject prefix Changes in v7: - Fixed issues reported by dt_binding_check. - Updated the schema and the example dts for data-lanes. - Changed to generic naming for the example dts node. Changes in v6: - Remove switches node and use endpoints and data-lanes property to describe the connections. .../bindings/display/bridge/ite,it6505.yaml | 101 +++++++++++++++--- 1 file changed, 88 insertions(+), 13 deletions(-) diff --git a/Documentation/devicetree/bindings/display/bridge/ite,it6505.yaml b/Documentation/devicetree/bindings/display/bridge/ite,it6505.yaml index c9a882ee6d98..348b02f26041 100644 --- a/Documentation/devicetree/bindings/display/bridge/ite,it6505.yaml +++ b/Documentation/devicetree/bindings/display/bridge/ite,it6505.yaml @@ -75,22 +75,49 @@ properties: port@1: $ref: /schemas/graph.yaml#/$defs/port-base unevaluatedProperties: false - description: Video port for DP output + description: + Video port for DP output. Each endpoint connects to a video output + downstream, and the "data-lanes" property is used to describe the pin + connections. 0, 1, 2, 3 in "data-lanes" maps to TX0, TX1, TX2, TX3, + respectively. - properties: - endpoint: - $ref: /schemas/graph.yaml#/$defs/endpoint-base + + patternProperties: + "^endpoint@[01]$": + $ref: /schemas/media/video-interfaces.yaml# unevaluatedProperties: false properties: + reg: true + + remote-endpoint: true + data-lanes: - minItems: 1 - uniqueItems: true - items: - - enum: [ 0, 1 ] - - const: 1 - - const: 2 - - const: 3 + oneOf: + - items: + - enum: [0, 3] + + - items: + - const: 0 + - const: 1 + + - items: + - const: 3 + - const: 2 + + - items: + - const: 0 + - const: 1 + - const: 2 + - const: 3 + + mode-switch: + type: boolean + description: Serves as Type-C mode switch if present. + + required: + - reg + - remote-endpoint required: - port@0 @@ -102,7 +129,6 @@ required: - pwr18-supply - interrupts - reset-gpios - - extcon - ports additionalProperties: false @@ -139,8 +165,11 @@ examples: }; port@1 { + #address-cells = <1>; + #size-cells = <0>; reg = <1>; - it6505_out: endpoint { + it6505_out: endpoint@0 { + reg = <0>; remote-endpoint = <&dp_in>; data-lanes = <0 1>; }; @@ -148,3 +177,49 @@ examples: }; }; }; + - | + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + dp-bridge@5c { + compatible = "ite,it6505"; + interrupts = <8 IRQ_TYPE_LEVEL_LOW 8 0>; + reg = <0x5c>; + pinctrl-names = "default"; + pinctrl-0 = <&it6505_pins>; + ovdd-supply = <&mt6366_vsim2_reg>; + pwr18-supply = <&pp1800_dpbrdg_dx>; + reset-gpios = <&pio 177 0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + it6505_dpi_in: endpoint { + remote-endpoint = <&dpi_out>; + }; + }; + port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + ite_typec0: endpoint@0 { + reg = <0>; + mode-switch; + data-lanes = <0 1>; + remote-endpoint = <&typec_port0>; + }; + ite_typec1: endpoint@1 { + reg = <1>; + mode-switch; + data-lanes = <3 2>; + remote-endpoint = <&typec_port1>; + }; + }; + }; + }; + };