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>; + }; diff --git a/qcom/kalama-pmic-overlay.dtsi b/qcom/kalama-pmic-overlay.dtsi index 991f2da4..6701ee40 100644 --- a/qcom/kalama-pmic-overlay.dtsi +++ b/qcom/kalama-pmic-overlay.dtsi @@ -547,4 +547,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>;