From 961822b1c92f323848b82568a35c696f2e504d87 Mon Sep 17 00:00:00 2001 From: David Collins Date: Fri, 8 Apr 2022 17:34:16 -0700 Subject: [PATCH 1/2] dt-bindings: regulator: add QTI OCP notifier bindings documentation Add a bindings documentation file for QTI regulator over-current (OCP) notifier devices. These devices can be used to monitor and notifier consumers of regulator OCP events on certain Qualcomm Technologies, Inc. PMICs. Change-Id: Id86cf62144c6e9f970cd09b7fe7a93ab40ef6cd8 --- bindings/regulator/qcom,ocp-notifier.yaml | 63 +++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 bindings/regulator/qcom,ocp-notifier.yaml diff --git a/bindings/regulator/qcom,ocp-notifier.yaml b/bindings/regulator/qcom,ocp-notifier.yaml new file mode 100644 index 00000000..8db9703f --- /dev/null +++ b/bindings/regulator/qcom,ocp-notifier.yaml @@ -0,0 +1,63 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/regulator/qcom,ocp-notifier.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Qualcomm Technologies, Inc. Regulator Over-Current Notifier binding + +maintainers: + - David Collins + +description: | + This device provides support for logging and notifying consumers about + regulator over-current (OCP) events on certain Qualcomm Technologies, + Inc. PMIC devices. This is useful for debugging as well as for providing a + more graceful recovery mechanism than resetting the entire system. + +properties: + compatible: + const: qcom,regulator-ocp-notifier + + interrupts: + description: PMIC regulator OCP notification summary interrupt. + maxItems: 1 + + nvmem-cells: + description: | + phandle of the nvmem cell for the PMIC register region which stores the + PMIC OCP log. + maxItems: 1 + + nvmem-cell-names: + const: ocp_log + +patternProperties: + "^periph-[0-9a-f]{3}-supply$": + description: | + phandle for regulator device corresponding to the PMIC peripheral with + PPID equal to the hex value listed in the supply property name. + +required: + - compatible + - interrupts + - nvmem-cells + - nvmem-cell-names + +additionalProperties: false + +examples: + - | + #include + + regulator-ocp-notifier { + compatible = "qcom,regulator-ocp-notifier"; + interrupt-parent = <&spmi_bus>; + interrupts = <0x0 0x71 0x1 IRQ_TYPE_EDGE_RISING>; + nvmem-cells = <&ocp_log>; + nvmem-cell-names = "ocp_log"; + + periph-1c1-supply = <&L1B>; + periph-1c2-supply = <&L2B>; + periph-1c5-supply = <&L5B>; + }; From 0c8fae07f6897f337310f49f7fef6dfa6df7319b Mon Sep 17 00:00:00 2001 From: David Collins Date: Wed, 6 Apr 2022 15:29:26 -0700 Subject: [PATCH 2/2] ARM: dts: msm: add regulator OCP notifier device for Kalama Add a regulator over-current (OCP) notifier device along with supply properties to map from PMIC peripherals to specific regulator devices. This provides a mechanism to notify consumers of a particular regulator when OCP occurs. Also add a PMK8550 SDAM01 nvmem device and nvmem cell subnode. This is needed by the OCP notifier device. Change-Id: Ib81b066733c15038938bb22d7fd8bac22874aece --- qcom/kalama-pmic-overlay.dtsi | 63 +++++++++++++++++++++++++++++++++++ qcom/pmk8550.dtsi | 11 ++++++ 2 files changed, 74 insertions(+) diff --git a/qcom/kalama-pmic-overlay.dtsi b/qcom/kalama-pmic-overlay.dtsi index b6dc51cf..b425a1b3 100644 --- a/qcom/kalama-pmic-overlay.dtsi +++ b/qcom/kalama-pmic-overlay.dtsi @@ -501,4 +501,67 @@ nvmem = <&pmk8550_sdam_5>, <&pmk8550_sdam_6>; nvmem-names = "pon_log0", "pon_log1"; }; + + regulator-ocp-notifier { + compatible = "qcom,regulator-ocp-notifier"; + interrupt-parent = <&spmi_bus>; + interrupts = <0x0 0x71 0x1 IRQ_TYPE_EDGE_RISING>; + nvmem-cells = <&ocp_log>; + nvmem-cell-names = "ocp_log"; + + periph-1c1-supply = <&L1B>; + periph-1c2-supply = <&L2B>; + periph-1c5-supply = <&L5B>; + periph-1c6-supply = <&L6B>; + periph-1c7-supply = <&L7B>; + periph-1c8-supply = <&L8B>; + periph-1c9-supply = <&L9B>; + periph-1ca-supply = <&L10B>; + periph-1cb-supply = <&L11B>; + periph-1cc-supply = <&L12B>; + periph-1cd-supply = <&L13B>; + periph-1ce-supply = <&L14B>; + periph-1cf-supply = <&L15B>; + periph-1d0-supply = <&L16B>; + periph-1d1-supply = <&L17B>; + periph-2c1-supply = <&L1C>; + periph-2c3-supply = <&L3C>; + periph-3c1-supply = <&L1D>; + periph-3c2-supply = <&L2D_LEVEL>; + periph-4c1-supply = <&L1E>; + periph-4c2-supply = <&L2E>; + periph-4c3-supply = <&L3E>; + periph-5c1-supply = <&L1F>; + periph-5c2-supply = <&L2F>; + periph-5c3-supply = <&L3F>; + periph-6c1-supply = <&L1G>; + periph-6c2-supply = <&L2G>; + periph-6c3-supply = <&L3G>; + periph-ac1-supply = <&L1K>; + periph-ac2-supply = <&L2K>; + periph-ac3-supply = <&L3K>; + periph-ac4-supply = <&L4K>; + periph-ac5-supply = <&L5K>; + periph-ac6-supply = <&L6K>; + periph-ac7-supply = <&L7K>; + periph-bc3-supply = <&L3L>; + periph-bc4-supply = <&L4L>; + periph-bc5-supply = <&L5L>; + periph-bc6-supply = <&L6L>; + periph-bc7-supply = <&L7L>; + periph-c40-supply = <&L1M>; + periph-c41-supply = <&L2M>; + periph-c42-supply = <&L3M>; + periph-c43-supply = <&L4M>; + periph-c44-supply = <&L5M>; + periph-c45-supply = <&L6M>; + periph-c46-supply = <&L7M>; + periph-d40-supply = <&L1N>; + periph-d41-supply = <&L2N>; + periph-d42-supply = <&L3N>; + periph-d43-supply = <&L4N>; + periph-d44-supply = <&L5N>; + periph-d45-supply = <&L6N>; + periph-d46-supply = <&L7N>; + }; }; diff --git a/qcom/pmk8550.dtsi b/qcom/pmk8550.dtsi index 73051e10..fb8a985d 100644 --- a/qcom/pmk8550.dtsi +++ b/qcom/pmk8550.dtsi @@ -36,6 +36,17 @@ }; }; + pmk8550_sdam_1: sdam@7000 { + compatible = "qcom,spmi-sdam"; + reg = <0x7000>; + #address-cells = <1>; + #size-cells = <1>; + + ocp_log: ocp-log@76 { + reg = <0x76 0x6>; + }; + }; + pmk8550_sdam_2: sdam@7100 { compatible = "qcom,spmi-sdam"; reg = <0x7100>;