From 38420f520915949834919d4d5e2d354175bdc956 Mon Sep 17 00:00:00 2001 From: David Collins Date: Thu, 15 Jun 2023 16:38:27 -0700 Subject: [PATCH 1/4] bindings: add support for qcom,qti-pmic-glink The PMIC Glink device provides the interface for clients to communicate over GLink for sending/receiving data to/from charger firmware that runs on a remote subsystem (e.g. ADSP) which supports charging and gauging. Add the bindings for it. This is a snapshot taken as of qcom-6.1 commit 2927dc2d179b ("bindings: add support for qcom,pmic-glink") which was then converted to yaml. Rename qcom,pmic-glink.yaml to qcom,qti-pmic-glink.yaml to avoid a conflict with the independent upstream implementation of this file. Change-Id: Ia4f5ff346ebfa773bc0fe3d0410626ea67e1da31 Signed-off-by: David Collins --- bindings/soc/qcom/qcom,qti-pmic-glink.yaml | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 bindings/soc/qcom/qcom,qti-pmic-glink.yaml diff --git a/bindings/soc/qcom/qcom,qti-pmic-glink.yaml b/bindings/soc/qcom/qcom,qti-pmic-glink.yaml new file mode 100644 index 00000000..217870de --- /dev/null +++ b/bindings/soc/qcom/qcom,qti-pmic-glink.yaml @@ -0,0 +1,50 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/qcom/qcom,qti-pmic-glink.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Technologies, Inc. PMIC Glink Firmware Interface Device + +maintainers: + - Subbaraman Narayanamurthy + +description: | + This binding describes the Qualcomm Technologies, Inc. PMIC GLink device. + PMIC Glink handles the communication between different clients (e.g. battery + charger, UCSI PPM) on the Application processor and charger firmware running + on a remote subsystem (e.g. DSP) over Glink channel. + + Each subnode specifies a client of PMIC Glink device that will be instantiated + after the PMIC Glink device initializes. + +properties: + compatible: + const: qcom,qti-pmic-glink + + qcom,pmic-glink-channel: + description: Glink channel name + $ref: /schemas/types.yaml#/definitions/string + + qcom,subsys-name: + description: Subsystem name used for subsystem restart. + $ref: /schemas/types.yaml#/definitions/string + + qcom,protection-domain: + description: Protection domain names used for protection domain restart. + $ref: /schemas/types.yaml#/definitions/string-array + +required: + - compatible + - qcom,pmic-glink-channel + +additionalProperties: false + +examples: + - | + pmic_glink { + compatible = "qcom,qti-pmic-glink"; + qcom,pmic-glink-channel = "PMIC_RTR_ADSP_APPS"; + qcom,subsys-name = "lpass"; + qcom,protection-domain = "tms/servreg", "msm/adsp/charger_pd"; + }; From 798c3428753ee66dbb454941ba0f53fa871da21f Mon Sep 17 00:00:00 2001 From: David Collins Date: Thu, 15 Jun 2023 16:38:55 -0700 Subject: [PATCH 2/4] bindings: Add altmode-glink The altmode mode device provides an interface for Type-C alternate mode clients to receive data such as Pin Assignment Notifications from the Type-C stack running on a remote subsystem (e.g. DSP) via the PMIC GLINK interface. This is a snapshot taken as of qcom-6.1 commit 956e9008b1cf ("bindings: Add altmode-glink") which was then converted to yaml. Change-Id: Iec1cf5e64ed9b4eb93fbfa6aacc998d4f4f730e7 Signed-off-by: David Collins --- bindings/soc/qcom/qcom,altmode-glink.yaml | 41 +++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 bindings/soc/qcom/qcom,altmode-glink.yaml diff --git a/bindings/soc/qcom/qcom,altmode-glink.yaml b/bindings/soc/qcom/qcom,altmode-glink.yaml new file mode 100644 index 00000000..76dca762 --- /dev/null +++ b/bindings/soc/qcom/qcom,altmode-glink.yaml @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/qcom/qcom,altmode-glink.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Technologies, Inc. Type-C Alternate Mode GLINK device + +maintainers: + - Subbaraman Narayanamurthy + +description: | + The Qualcomm Technologies, Inc. Type-C Alternate (Alt) Mode GLINK device + provides an interface for Type-C alternate mode clients to receive data such + as Pin Assignment Notifications from the Type-C stack running on a remote + subsystem (e.g. DSP) via the PMIC GLINK interface. + +properties: + compatible: + const: qcom,altmode-glink + + qcom,altmode-name: + description: Alt-mode name + $ref: /schemas/types.yaml#/definitions/string + enum: [altmode_0, altmode_1, altmode_2, altmode_3, altmode_4, + altmode_5, altmode_6, altmode_7, altmode_8, altmode_9] + +required: + - compatible + - qcom,altmode-name + +additionalProperties: false + +examples: + - | + pmic_glink { + altmode { + compatible = "qcom,altmode-glink"; + qcom,altmode-name = "altmode_0"; + }; + }; From 8dd209e5664433adc780b0ae4da2c1162c7fbce4 Mon Sep 17 00:00:00 2001 From: David Collins Date: Thu, 15 Jun 2023 16:39:02 -0700 Subject: [PATCH 3/4] bindings: power: supply: add QTI battery charger Add DT bindings for QTI battery charger which gets and sets power supply properties by communicating with charger firmware running on the remote subsystem (e.g. DSP) over PMIC Glink. This is a snapshot taken as of qcom-6.1 commit 7b5e13f9043d ("dt-bindings: power: supply: qcom,battery-charger: Add display panel property") which was then converted to yaml. Change-Id: I8e3aedfb70c627807388db3c449c283f35ecfd59 Signed-off-by: David Collins --- .../power/supply/qcom,battery-charger.yaml | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 bindings/power/supply/qcom,battery-charger.yaml diff --git a/bindings/power/supply/qcom,battery-charger.yaml b/bindings/power/supply/qcom,battery-charger.yaml new file mode 100644 index 00000000..b3de6112 --- /dev/null +++ b/bindings/power/supply/qcom,battery-charger.yaml @@ -0,0 +1,86 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/supply/qcom,battery-charger.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Technologies, Inc. Battery Charger Glink Device + +maintainers: + - Subbaraman Narayanamurthy + +description: | + This binding describes the Qualcomm Technologies, Inc. battery charger device. + The QTI battery charger gets and sets power supply properties by communicating + with charger firmware running on a remote subsystem (e.g. DSP) over PMIC + Glink. + +properties: + compatible: + const: qcom,battery-charger + + qcom,thermal-mitigation: + description: | + Array of fast charge current limit values for different system thermal + mitigation levels. This should be a flat array that denotes the maximum + charging current (in uA) for each thermal level. Elements should be listed + in monotonically decreasing (non-increasing) order. + $ref: /schemas/types.yaml#/definitions/uint32-array + + qcom,thermal-mitigation-step: + description: | + Fast charging current step (in uA) which if specified would be used to + calculate different system thermal mitigation levels based on the maximum + charging current provided by the charger firmware. This property can be + specified only if "qcom,thermal-mitigation" property is not specified. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 500000 + + qcom,wireless-fw-name: + description: | + Firmware name that is used for updating wireless charger firmware. + $ref: /schemas/types.yaml#/definitions/string + + qcom,shutdown-voltage: + description: | + Battery voltage (in mV) when shutdown needs to be initiated when battery + SOC reaches 0 and device is not charging. + $ref: /schemas/types.yaml#/definitions/uint32 + + qcom,display-panels: + description: | + Array of one or more phandles of the display panel(s) that sends the DRM + blank/unblank notifications. + $ref: /schemas/types.yaml#/definitions/phandle-array + minItems: 1 + +required: + - compatible + +allOf: + - if: + required: + - qcom,thermal-mitigation + then: + properties: + qcom,thermal-mitigation-step: false + + - if: + required: + - qcom,thermal-mitigation-step + then: + properties: + qcom,thermal-mitigation: false + +additionalProperties: false + +examples: + - | + pmic_glink { + battery_charger { + compatible = "qcom,battery-charger"; + qcom,thermal-mitigation = <3000000 1500000 1000000 500000>; + qcom,wireless-fw-name = "idt9412.bin"; + qcom,shutdown-voltage = <3100>; + }; + }; From 5db888f27d243b833a7ca5066eb42f414530c54b Mon Sep 17 00:00:00 2001 From: David Collins Date: Thu, 15 Jun 2023 16:39:06 -0700 Subject: [PATCH 4/4] bindings: add support for qcom,ucsi-glink The UCSI Glink device handles the communication between OPM on the Application processor and PPM which is charger firmware running on the remote subsystem (e.g. DSP) over PMIC Glink. This is a snapshot taken as of qcom-6.1 commit de2a781818d7 ("bindings: add support for qcom,ucsi-glink") which was then converted to yaml. Change-Id: I1ff3756302c40c88954109b6dccaf87e59e66919 Signed-off-by: David Collins --- bindings/usb/qcom,ucsi-glink.yaml | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 bindings/usb/qcom,ucsi-glink.yaml diff --git a/bindings/usb/qcom,ucsi-glink.yaml b/bindings/usb/qcom,ucsi-glink.yaml new file mode 100644 index 00000000..396d25e8 --- /dev/null +++ b/bindings/usb/qcom,ucsi-glink.yaml @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/qcom/qcom,ucsi-glink.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Technologies, Inc. UCSI Glink Device + +maintainers: + - Subbaraman Narayanamurthy + +description: | + This binding describes the Qualcomm Technologies, Inc. UCSI device. UCSI + handles the communication between OPM on the Application processor and PPM + which is charger firmware running on a remote subsystem (e.g. DSP) over + PMIC Glink. + +properties: + compatible: + const: qcom,ucsi-glink + +required: + - compatible + +additionalProperties: false + +examples: + - | + pmic_glink { + ucsi { + compatible = "qcom,ucsi-glink"; + }; + };