From patchwork Thu Oct 28 16:49:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 12590587 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE22FC4321E for ; Thu, 28 Oct 2021 16:47:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BCCA861073 for ; Thu, 28 Oct 2021 16:47:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229761AbhJ1QuO (ORCPT ); Thu, 28 Oct 2021 12:50:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230264AbhJ1QuN (ORCPT ); Thu, 28 Oct 2021 12:50:13 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFCA7C061570 for ; Thu, 28 Oct 2021 09:47:45 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id 192so4837237wme.3 for ; Thu, 28 Oct 2021 09:47:45 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=EIQZtiL4sO2h//qQWQnW0bsrqU7jClGfSi+dVnwdw8M=; b=TBUrWftD5XqHvD8PbQTlOVzGtVGKEwU91QaDNYmSa6TC9xVVaG3SMjqL7vRMqcjz/T osNT37veogQdizbTV9+l4/OYKmnY7+qvzbVVrve+XhkR22qNX3Met4AcHEAsA2fBfAzL JB6mqq4XqYe90DFApw2Bw9GhbM7Bsru3/ri8omaEedengnCsyb01OWFkfuiVVYNBsyc6 NvFfH0r6decoNiIFxqeM7Nt5P0j2UmsE4u54APOQEnkQp8SYHUMNMXyTixKw2huogTJA uSa8sdcKZWW9U5oAYG8jhguHP4l6eQwjuJJ6k6k7w+7ejlOw4JYccX5RMfyIZPaFu9CH 48vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EIQZtiL4sO2h//qQWQnW0bsrqU7jClGfSi+dVnwdw8M=; b=BF/UC7vDauNNhLU4CO5NgjOl0C+YmistHLM49+1j3dUupJvyDfGXJn8Qya5E/Aqczw 0A6dgzKTEzxZAYLfNXidKU47I4NnChPyBl4EyLAaW4e65msXMEdRINn/Ei1z2iIgeJya CT4TItTfAY6Jz+B8qHI3Y4IaL5t5Ut8hyzwpi7Bn40Ib0d0OvmQcZFsoeRIYBJJoF3no 2x+MUn/Zfp9Vop1XP67hg1ujg8nBGW+WF1jjDBn7X7SLlEqsjjzNbVcgn/QEs5fBh6N5 7ReblRr+eYt33vN1LFNTU61+/KrXjqsa/5OtCQtcwbAvm8A/U3vupZGMhFM1gDHuGcDP z5Rg== X-Gm-Message-State: AOAM5333oKTB9d8oynrL54a8mhR2cAIFykCcyj/rJDVGeyIJ2+gfvg1C IdwFvuiTN7ELJmpRgn8VJBd+qg== X-Google-Smtp-Source: ABdhPJzzMGmZvBQ71k3dB4DPQXaIymT4UYekuWhVAwPb6ERWZ63hT5hdLCl6NeJvrc1+mV50On9NWw== X-Received: by 2002:a1c:9891:: with SMTP id a139mr211737wme.152.1635439664526; Thu, 28 Oct 2021 09:47:44 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id y8sm3601724wrq.77.2021.10.28.09.47.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 09:47:43 -0700 (PDT) From: Bryan O'Donoghue To: linux@roeck-us.net, heikki.krogerus@linux.intel.com, rdunlap@infradead.org, gregkh@linuxfoundation.org, bjorn.andersson@linaro.org, robh+dt@kernel.org, linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org Cc: wcheng@codeaurora.org, bryan.odonoghue@linaro.org Subject: [RESEND PATCH v2 2/7] dt-bindings: usb: Add Qualcomm PMIC type C controller YAML schema Date: Thu, 28 Oct 2021 17:49:36 +0100 Message-Id: <20211028164941.831918-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211028164941.831918-1-bryan.odonoghue@linaro.org> References: <20211028164941.831918-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Add a YAML binding for the type-c silicon interface inside Qualcomm's pm8150b hardware block. The type-c driver operates with a pdphy driver inside of a high level single TCPM device. Based on original work by Wesley. Signed-off-by: Wesley Cheng Signed-off-by: Bryan O'Donoghue --- .../bindings/usb/qcom,pmic-typec.yaml | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml diff --git a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml new file mode 100644 index 0000000000000..72602daf910bb --- /dev/null +++ b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml @@ -0,0 +1,116 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/usb/qcom,pmic-typec.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Qualcomm PMIC based USB type C Detection Driver + +maintainers: + - Bryan O'Donoghue + +description: | + Qualcomm PMIC Type C Detect + +properties: + compatible: + enum: + - qcom,pm8150b-usb-typec + + reg: + maxItems: 1 + description: Type C base address + + interrupts: + items: + - description: Bitmask of CC attach, VBUS error, tCCDebounce done and more + - description: VCONN Powered Detection + - description: CC state change + - description: VCONN over-current condition + - description: VBUS state change + - description: Attach Deteach notification + - description: Legacy cable detect + - description: Try.Src Try.Snk state change + + interrupt-names: + items: + - const: pmic-typec-or-rid-detect-change + - const: pmic-typec-vpd-detect + - const: pmic-typec-cc-state-change + - const: pmic-typec-vconn-oc + - const: pmic-typec-vbus-change + - const: pmic-typec-attach-detach + - const: pmic-typec-legacy-cable-detect + - const: pmic-typec-try-snk-src-detect + + ports: + description: Remote endpoint connections + $ref: /connector/usb-connector.yaml#/properties/ports + + properties: + port@0: + description: Remote endpoints for the TCPM driver + + required: + - port@0 + +required: + - compatible + - reg + - interrupts + - interrupt-names + - ports + +additionalProperties: false + +examples: + - | + #include + #include + pm8150b { + #address-cells = <1>; + #size-cells = <0>; + + pm8150b_typec: typec@1500 { + compatible = "qcom,pm8150b-typec"; + reg = <0x1500>; + #address-cells = <1>; + #size-cells = <0>; + interrupts = <0x2 0x15 PMIC_TYPEC_OR_RID_IRQ + IRQ_TYPE_EDGE_RISING>, + <0x2 0x15 PMIC_TYPEC_VPD_IRQ + IRQ_TYPE_EDGE_BOTH>, + <0x2 0x15 PMIC_TYPEC_CC_STATE_IRQ + IRQ_TYPE_EDGE_RISING>, + <0x2 0x15 PMIC_TYPEC_VCONN_OC_IRQ + IRQ_TYPE_EDGE_BOTH>, + <0x2 0x15 PMIC_TYPEC_VBUS_IRQ + IRQ_TYPE_EDGE_RISING>, + <0x2 0x15 PMIC_TYPEC_ATTACH_DETACH_IRQ + IRQ_TYPE_EDGE_RISING>, + <0x2 0x15 PMIC_TYPEC_LEGACY_CABLE_IRQ + IRQ_TYPE_EDGE_BOTH>, + <0x2 0x15 PMIC_TYPEC_TRY_SNK_SRC_IRQ + IRQ_TYPE_EDGE_RISING>; + interrupt-names = "pmic-typec-or-rid-detect-change", + "pmic-typec-vpd-detect", + "pmic-typec-cc-state-change", + "pmic-typec-vconn-oc", + "pmic-typec-vbus-change", + "pmic-typec-attach-detach", + "pmic-typec-legacy-cable-detect", + "pmic-typec-try-snk-src-detect"; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + pmic_typec: endpoint { + remote-endpoint = <&pmic_tcpm_typec>; + }; + }; + }; + }; + }; +...