From patchwork Thu Oct 28 16:49:35 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: 1547611 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=tCH7i0Nf; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4HgBLp2YRlz9sRK for ; Fri, 29 Oct 2021 03:47:46 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230248AbhJ1QuM (ORCPT ); Thu, 28 Oct 2021 12:50:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230008AbhJ1QuM (ORCPT ); Thu, 28 Oct 2021 12:50:12 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C54E7C061767 for ; Thu, 28 Oct 2021 09:47:44 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id z14so11321055wrg.6 for ; Thu, 28 Oct 2021 09:47:44 -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=28ILwbMYYFYo+iwfSu1OAenWdD1ePSsQXhSvTodKWcU=; b=tCH7i0NfpZmsvt1HOmWniPk+M0M7bhXHwP8/OiTJ43dnw429qDh7MzDO5sloB7vzDS d7TwroAbKpMFv+goAKbx42H89EYgPfa8Cd6cBptBfowp8UDQWYKxsxUltZrLNjqa2iFU DiqJYck1jBkYdLBYkZQWf9JHsSrFPo4LRfPBkfOR0zi4EQqMZ8KTCuhVNLiHAAr4ML3G teuBxexzhy02hVqP0jaNANDWKJ7RF37lQMsafySycwcBndNR6mVpBeDlQJHOhagTTes/ dxFV6DjCuEjFwk2X5AGRrQ5349yd72x7Dlcr0LVmJ0JM9rt+tjzm4l7ARm1gNMhb6cws Xc4g== 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=28ILwbMYYFYo+iwfSu1OAenWdD1ePSsQXhSvTodKWcU=; b=1CMO+6zhEUgcNEBYjz+eXpYnlc0/ndSoP7YFCnECHomAalKtaub42TiUKxlpDdpw56 +dAaTkEueEYAj81oufweWbIcMC9jDP4duLpKKSg1Q7/GOpik3o+aYhewUkSmvcghugSR AjFytIJmcS8j/XRubDpNENlm+krjs8IDPfnZGZw7jUfVRWOyolKS+HbM7y8GHDUgPUfD rv9en92LW+sw2InuAVlJxw7BTviKv9Fkr5DGaMFxXx4ihNzEedPqPVnE0BfKQGxxTcr3 IaFMFhUorsmvMtg2hAQjeKR2KRsDNKBzqia/kS0XUI0KfVBQpPD+mP1bHuSTZCr8ZP2K sGEQ== X-Gm-Message-State: AOAM532QSZvUT+Q2LnnWXIEUhdGSriW35Jg8oZsKKABDTRRg601Vvs8N mWX/G3PjAWc2lAbcdu2UiksyWA== X-Google-Smtp-Source: ABdhPJzvsIhsV1dDj5Q5oNo13hardH75LFlX46pBlSHkeDYiUvCjve4Y0emWMS+uYvx5ChzRa+cjWw== X-Received: by 2002:a5d:660e:: with SMTP id n14mr7264151wru.388.1635439663437; Thu, 28 Oct 2021 09:47:43 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 09:47:42 -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 1/7] dt-bindings: usb: Add qcom,pmic-usb-typec dt-binding header Date: Thu, 28 Oct 2021 17:49:35 +0100 Message-Id: <20211028164941.831918-2-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: devicetree@vger.kernel.org Adds a series of defines which are used in the DTS and type-c driver for identifying interrupts. Signed-off-by: Bryan O'Donoghue --- .../usb/typec/tcpm/qcom,pmic-usb-typec.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 include/dt-bindings/usb/typec/tcpm/qcom,pmic-usb-typec.h diff --git a/include/dt-bindings/usb/typec/tcpm/qcom,pmic-usb-typec.h b/include/dt-bindings/usb/typec/tcpm/qcom,pmic-usb-typec.h new file mode 100644 index 0000000000000..263c999b59b8d --- /dev/null +++ b/include/dt-bindings/usb/typec/tcpm/qcom,pmic-usb-typec.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2021, The Linux Foundation. All rights reserved. + */ + +#ifndef _DT_BINDINGS_TCPM_QCOM_PMIC_USB_TYPEC_H +#define _DT_BINDINGS_TCPM_QCOM_PMIC_USB_TYPEC_H + +#define PMIC_TYPEC_OR_RID_IRQ 0x0 +#define PMIC_TYPEC_VPD_IRQ 0x1 +#define PMIC_TYPEC_CC_STATE_IRQ 0x2 +#define PMIC_TYPEC_VCONN_OC_IRQ 0x3 +#define PMIC_TYPEC_VBUS_IRQ 0x4 +#define PMIC_TYPEC_ATTACH_DETACH_IRQ 0x5 +#define PMIC_TYPEC_LEGACY_CABLE_IRQ 0x6 +#define PMIC_TYPEC_TRY_SNK_SRC_IRQ 0x7 + +#endif 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: 1547612 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=TBUrWftD; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4HgBLq6xZCz9sRK for ; Fri, 29 Oct 2021 03:47:47 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230321AbhJ1QuN (ORCPT ); Thu, 28 Oct 2021 12:50:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229761AbhJ1QuN (ORCPT ); Thu, 28 Oct 2021 12:50:13 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0DFBC061745 for ; Thu, 28 Oct 2021 09:47:45 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id j128-20020a1c2386000000b003301a98dd62so1641427wmj.5 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=r9I6wUiXhPILqz9VRPtkQQwj24Jh0pg0X6YGu43ApHVV+8UMbfz7aQdHJT7WRPhFtQ lSYHHfk8kuuiKtxh5CopMXileOnjoqx4Ync3Vicz1XWuyUm5CHEvwP/ddrxun6Ce34FJ alcWLDdPQhNEDMqkPlnSNlp3fhlTpdciw8Eo4OzcCIFoFHrtNJpk6Tq9xg3WIbRkKYBp A/3TMPanof2WAtKvph0m8SSJ9Ctiru9ZSZ+vGcZeG6JvOdOARkxZC8BiGK+X/ExAvCSd oh08KHwtjEFAtNdc/CWbXzi36pRfriBKF1A6wqaYfxELUrTnK6OqfrPTDv0oK1gTiJVr CmLw== X-Gm-Message-State: AOAM5331rPTKYE4a73lxMOY0PS51+2tO9988DEKzu53BcQI+3VyqYh8M P4eRYqGgEoPZaZHxsMNMvcq+nQ== 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: devicetree@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>; + }; + }; + }; + }; + }; +... From patchwork Thu Oct 28 16:49:37 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: 1547613 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=fSEgbfCm; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4HgBLs0YpNz9sRK for ; Fri, 29 Oct 2021 03:47:49 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230281AbhJ1QuP (ORCPT ); Thu, 28 Oct 2021 12:50:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230295AbhJ1QuO (ORCPT ); Thu, 28 Oct 2021 12:50:14 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BE1DC061745 for ; Thu, 28 Oct 2021 09:47:47 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id u18so11334471wrg.5 for ; Thu, 28 Oct 2021 09:47:47 -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=q128a9lhY0ksiYIyPMAMQms4ozwMnmwzN8Z/nJ9OKEQ=; b=fSEgbfCmAD7l1maFzzfo4ntux8Czn15LspIDvE89ZBeycOzGCJ5MBex42lORU2wYL3 4np+8KErBWQVQwoIc4vJw/BU2wRrPGot3CeomaV9A8JsiFXJl33RVuH15HS4nJymZ8S1 E3Gy7ZyE7McfDiZsgGBzzpF0z0Bv+Y/J+GNdJbDhXdUXdTdrFyiIhI/nkwf3479FA3Yx CVS9EATZAwb4NRVBwoM2i/MmfKGZjdQfGMrYCPYiGNcWeHtmtygdJKDeKBsvXpj+Rpsi s9KlxZt0Elm7iYX03JTiKIBJy1N/HgMA7RkXPaglM1AXqdeHIYE0hKqoVXEf46AkQU1P ptow== 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=q128a9lhY0ksiYIyPMAMQms4ozwMnmwzN8Z/nJ9OKEQ=; b=ElU06hm/2e8ayCkP5tIi+/yjOsrjVwmh7yf7vSjdW8GBJvBHGFQUDAV0qDNjR2FVSu FWDLXf094TjPcEE+nemxbPWVB8gPgzfwlNeb9chhMDfSBbBLfFhChctvinWoKkgNWCCF ZXTncvP73ARFWzEyK9Q4IHh7KcGjLtT5DfS9+mL/ldGBGftFXORYty72ULhHwLgOkxnz Xz5MBd5JCNwL12NeLHDXyep3x7Fxg4c1hHvbHUpHT5v1N6/qASzWfe3NuA65EQsCIr8e dy9rC7R28WxjdS0emK2fLYm+olQ1Tmu8+rHRc7Mb5RLyfMPWE3/TBQYDm1pJqppA7ZjL 0+1A== X-Gm-Message-State: AOAM532jHYb27uDKIox7EWAaqxks5//VcGR0ZCqvQlbknxc1EJuWGhW0 uZE9Q9CSLOw/xl+GYZeV/k/5YoNHb/syug== X-Google-Smtp-Source: ABdhPJxBvNicteu8Kk/NeIdXVz2M6mgN0Smm9jf26pymA0l62seqMqOH8acTkvmBZWynMQBqELhWEA== X-Received: by 2002:adf:8b06:: with SMTP id n6mr7276270wra.5.1635439665711; Thu, 28 Oct 2021 09:47:45 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 09:47:45 -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 3/7] dt-bindings: usb: Add qcom,pmic-usb-pdphy dt-binding header Date: Thu, 28 Oct 2021 17:49:37 +0100 Message-Id: <20211028164941.831918-4-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: devicetree@vger.kernel.org Adds a series of defines which are used in the DTS and pdphy driver for identifying interrupts. Signed-off-by: Bryan O'Donoghue --- .../usb/typec/tcpm/qcom,pmic-usb-pdphy.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 include/dt-bindings/usb/typec/tcpm/qcom,pmic-usb-pdphy.h diff --git a/include/dt-bindings/usb/typec/tcpm/qcom,pmic-usb-pdphy.h b/include/dt-bindings/usb/typec/tcpm/qcom,pmic-usb-pdphy.h new file mode 100644 index 0000000000000..0bb1ce677fe5c --- /dev/null +++ b/include/dt-bindings/usb/typec/tcpm/qcom,pmic-usb-pdphy.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2021, Linaro Ltd. All rights reserved. + */ + +#ifndef _DT_BINDINGS_TCPM_QCOM_PMIC_USB_PDPHY_H +#define _DT_BINDINGS_TCPM_QCOM_PMIC_USB_PDPHY_H + +#define PMIC_PDPHY_SIG_TX_IRQ 0x0 +#define PMIC_PDPHY_SIG_RX_IRQ 0x1 +#define PMIC_PDPHY_MSG_TX_IRQ 0x2 +#define PMIC_PDPHY_MSG_RX_IRQ 0x3 +#define PMIC_PDPHY_MSG_TX_FAIL_IRQ 0x4 +#define PMIC_PDPHY_MSG_TX_DISCARD_IRQ 0x5 +#define PMIC_PDPHY_MSG_RX_DISCARD_IRQ 0x6 +#define PMIC_PDPHY_FR_SWAP_IRQ 0x7 + +#endif From patchwork Thu Oct 28 16:49:38 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: 1547614 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=BeYbIMck; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4HgBLt0lpJz9sRK for ; Fri, 29 Oct 2021 03:47:50 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230367AbhJ1QuQ (ORCPT ); Thu, 28 Oct 2021 12:50:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230335AbhJ1QuP (ORCPT ); Thu, 28 Oct 2021 12:50:15 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 543A2C061767 for ; Thu, 28 Oct 2021 09:47:48 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id m22so11408017wrb.0 for ; Thu, 28 Oct 2021 09:47:48 -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=W6folD6S9BqLGM99G5RWE+A4n/cypELvZBV4a40T5Hg=; b=BeYbIMck+3lnUds9p1ZqEeBUc2UYqrTMpUgZoLOxyUO6a8df0jjmJysbQ4BCS5yPTw UPzgXv0wGrlS+NWOq0zDFl/O/iJuIW7sN2AcPm7i9n7iRFxRy4YVu0aHcL7N0wsZr5wY sbfVmWi1hkhi7Eti2EFke3ZDiTH/JOY2wGdjetwPvRZWy3wP5gtA2U25lPfY5B3dFg42 6SwYv5bOAzsFmR2n24b/dnH9Gf+A2feWwTrwch3zGRcrUguN7zwhePnx+LnD5UuTcd8G K/bbUqHcZnF5rn8fD8gEtg4AVmuVQobEPXJ98sgIyAoYM4ghUC0PLAdQXQ9hJoTesDgA aaTw== 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=W6folD6S9BqLGM99G5RWE+A4n/cypELvZBV4a40T5Hg=; b=nrkPJmqrZO6f9bCjbQKgqRJo7TVGZBJEZT/fN+FwaXfTHHckzxtH42qyFarpKzN5xE EQ0Z/ETiXocNrq7oWspvpwC9aMwtV8GdhN4zS5LDk94ts9cfQsg04fs7mPIbO/3Y2I81 6BXCNvyqQGF8Vi22Or020vfdP+tMsxVnsrEtOu/BXDDEwZqnltxqiBqZfptJKbWYOorB BsPureUHsVw9Trh6408ot9lvfUKmcV4hrkb+eSkDUE87KKQbQ2j0DPsLAiWXBv5W1Wyf C3eyf1OIjrhEmXoUhduiSKIMKgWtgJtKjN6c9iG3ykhjey2aIJlFvpJVsIXqP8yb3gCl lRmA== X-Gm-Message-State: AOAM531TN5CE9qSUkhSlxSr7gQ0cCKWG08uo05YXS32h3iW9iwx9fnuF FbjpyeUOi64IgAU/rwyV0vJgqF+egjhqGQ== X-Google-Smtp-Source: ABdhPJzrBPTOHwPGKTed7p0gjwIxznNcIltdVW33kHWHvAkC4KXF2eDg9hHVZxkxIRky4/nx2cG4Dw== X-Received: by 2002:adf:dc0d:: with SMTP id t13mr7129659wri.158.1635439666918; Thu, 28 Oct 2021 09:47:46 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 09:47:46 -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 4/7] dt-bindings: usb: Add Qualcomm PMIC PDPHY controller YAML schema Date: Thu, 28 Oct 2021 17:49:38 +0100 Message-Id: <20211028164941.831918-5-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: devicetree@vger.kernel.org Add a YAML binding for the power-delivery PHY silicon interface inside Qualcomm's pm8150b hardware block. The pdphy driver operates with a type-c driver inside of a high level single TCPM device to provide overall TCPM functionality. Signed-off-by: Bryan O'Donoghue --- .../bindings/usb/qcom,pmic-pdphy.yaml | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/qcom,pmic-pdphy.yaml diff --git a/Documentation/devicetree/bindings/usb/qcom,pmic-pdphy.yaml b/Documentation/devicetree/bindings/usb/qcom,pmic-pdphy.yaml new file mode 100644 index 0000000000000..9110f6203b87f --- /dev/null +++ b/Documentation/devicetree/bindings/usb/qcom,pmic-pdphy.yaml @@ -0,0 +1,115 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/usb/qcom,pmic-pdphy.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Qualcomm PMIC based USB PDPHY driver + +maintainers: + - Bryan O'Donoghue + +description: | + Qualcomm PMIC Power Delivery PHY driver + +properties: + compatible: + enum: + - qcom,pm8150b-pdphy + + reg: + maxItems: 1 + description: PDPHY base address + + interrupts: + items: + - description: Sig TX - transmitted reset signal + - description: Sig RX - received reset signal + - description: TX completion + - description: RX completion + - description: TX fail + - description: TX discgard + - description: RX discgard + - description: Fast Role Swap event + + interrupt-names: + items: + - const: pmic-pdphy-sig-tx + - const: pmic-pdphy-sig-rx + - const: pmic-pdphy-msg-tx + - const: pmic-pdphy-msg-rx + - const: pmic-pdphy-msg-tx-failed + - const: pmic-pdphy-msg-tx-discarded + - const: pmic-pdphy-msg-rx-discarded + - const: pmic-pdphy-fr-swap + + 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_pdphy: pdphy@1700 { + compatible = "qcom,pm8150b-pdphy"; + reg = <0x1700>; + interrupts = <0x2 0x17 PMIC_PDPHY_SIG_TX_IRQ + IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 PMIC_PDPHY_SIG_RX_IRQ + IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 PMIC_PDPHY_MSG_TX_IRQ + IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 PMIC_PDPHY_MSG_RX_IRQ + IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 PMIC_PDPHY_MSG_TX_FAIL_IRQ + IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 PMIC_PDPHY_MSG_TX_DISCARD_IRQ + IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 PMIC_PDPHY_MSG_RX_DISCARD_IRQ + IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 PMIC_PDPHY_FR_SWAP_IRQ + IRQ_TYPE_EDGE_RISING>; + interrupt-names = "pmic-pdphy-sig-tx", + "pmic-pdphy-sig-rx", + "pmic-pdphy-msg-tx", + "pmic-pdphy-msg-rx", + "pmic-pdphy-msg-tx-failed", + "pmic-pdphy-msg-tx-discarded", + "pmic-pdphy-msg-rx-discarded", + "pmic-pdphy-fr-swap"; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + pmic_pdphy: endpoint { + remote-endpoint = <&pmic_tcpm_pdphy>; + }; + }; + }; + }; + }; +... From patchwork Thu Oct 28 16:49:39 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: 1547615 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=DUwxeibw; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4HgBLv56XXz9sRK for ; Fri, 29 Oct 2021 03:47:51 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230389AbhJ1QuR (ORCPT ); Thu, 28 Oct 2021 12:50:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230356AbhJ1QuQ (ORCPT ); Thu, 28 Oct 2021 12:50:16 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 652D6C0613B9 for ; Thu, 28 Oct 2021 09:47:49 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 192so4837420wme.3 for ; Thu, 28 Oct 2021 09:47:49 -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=PZk6JFL+PMEwlKXRxZklRKHFN+eWFOBgIo8Rr0VffV0=; b=DUwxeibwYyQa9WmZtgXkmGdqasxfixfDBdceDdiqzpzZxE3FXo9xLcYxgEs+u+pG5a 3cz1O6bkPOyFg1iq89+kkEkEroM3NpOg/Bw7jZAlgAyHDN/l+2hUmsxX6/ZLR7J+1T65 q1wLS7ME4pTpuZQX3BtaXoEx5nnJQfUk5I/9r7dxX+5wpHH85bU/ygT5YUt3HP+4qrDt O9IfzVt10Qiat0PlAeLDP944N8a4z8+wCQLZiOlPsTX/oPJuRycyfFxR8jI/oO0GsODc FQP/9NbKZoZnyAxkx3y4XwZFn1na9b3hmeKozJAVeBAhRERK2ul+fD4FgwfmfEmZbGms 2hMQ== 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=PZk6JFL+PMEwlKXRxZklRKHFN+eWFOBgIo8Rr0VffV0=; b=YSVe6BHF/+5UkuEJVqDSEg+1S3nGe4DzAXwhaFM/DH3c3R+tCfsaLxHZyUaJinzJ01 qU3avn4PNAAEE2ZUjKHKYxqak06ckETPsF4o4hZD/j04LzPoWjk083yoKujYyYwtPnJL vyWIcsFdRFP2mWgAfeUk7lBJdyIJJcB9OZmPiLOvQdSvGKQhUKcw29FHRtd74DeLoY5Y AQKg6kBMJvrahFr0reD8OO9yPGY3YJEy8s419mANSltCCDUuTr/izT0crA7VlRLkrcsE ZwfV32ymcBA95tZQRPbupvo1YymNk5vdoN1fc2k62cnbnswWt0LVnlMrUpEBeJWOa2K1 dAKw== X-Gm-Message-State: AOAM531BRYPixkxZeiUm7KZY1NUeM52DbXRUpMfKJLfppoB+EETKlRIj ZA4y3Iajj2tAsNKaazRYsfPivA== X-Google-Smtp-Source: ABdhPJzdYiZE7f+CWc1YeTE2iPYd2yEHoxgSMPv+l63dC9FyqMa3rgXQ2EOZOqGozinkldaXlgtXxg== X-Received: by 2002:a1c:8096:: with SMTP id b144mr8515958wmd.20.1635439668021; Thu, 28 Oct 2021 09:47:48 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 09:47:47 -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 5/7] dt-bindings: usb: Add Qualcomm PMIC TCPM YAML schema Date: Thu, 28 Oct 2021 17:49:39 +0100 Message-Id: <20211028164941.831918-6-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: devicetree@vger.kernel.org Add a YAML description for the pm8150b-tcpm driver. The pm8150b-tcpm encapsulates a type-c block and a pdphy block into one block presented to the tcpm Linux API. Signed-off-by: Bryan O'Donoghue --- .../bindings/usb/qcom,pmic-tcpm.yaml | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/qcom,pmic-tcpm.yaml diff --git a/Documentation/devicetree/bindings/usb/qcom,pmic-tcpm.yaml b/Documentation/devicetree/bindings/usb/qcom,pmic-tcpm.yaml new file mode 100644 index 0000000000000..6dd51a1dd944f --- /dev/null +++ b/Documentation/devicetree/bindings/usb/qcom,pmic-tcpm.yaml @@ -0,0 +1,110 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/usb/qcom,pmic-tcpm.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Qualcomm PMIC TCPM Driver + +maintainers: + - Bryan O'Donoghue + +description: | + Qualcomm PMIC Type-C Port Manager Driver + +properties: + compatible: + enum: + - qcom,pm8150b-tcpm + + ports: + description: Remote endpoint connections + $ref: /connector/usb-connector.yaml#/properties/ports + + properties: + port@0: + description: Remote endpoints for the type-c device + + port@1: + description: Remote endpoints for the pdphy device + + port@2: + description: Connection to role switch node + + required: + - port@0 + - port@1 + - port@2 + +required: + - compatible + - ports + +additionalProperties: false + +examples: + - | + #include + #include + #include + #include + + pm8150b_tcpm: pmic-tcpm { + compatible = "qcom,pmic-tcpm"; + + #address-cells = <1>; + #size-cells = <0>; + + status = "disabled"; + ports { + + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + pmic_tcpm_typec: endpoint { + remote-endpoint = <&pmic_typec>; + }; + }; + port@1 { + reg = <1>; + pmic_tcpm_pdphy: endpoint { + remote-endpoint = <&pmic_pdphy>; + }; + }; + port@2 { + ret = <2>; + usb3_role: endpoint@0 { + remote-endpoint = <&dwc3_drd_switch>; + }; + }; + }; + + connector { + compatible = "usb-c-connector"; + + power-role = "source"; + data-role = "dual"; + self-powered; + + source-pdos = ; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + pmic_tcpm_ss_mux: endpoint@0 { + remote-endpoint = <&qmp_ss_mux>; + }; + }; + }; + }; + }; + +...