lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230718-pm8916-mclk-v1-1-4b4a58b4240a@gerhold.net>
Date:   Tue, 18 Jul 2023 13:40:13 +0200
From:   Stephan Gerhold <stephan@...hold.net>
To:     Mark Brown <broonie@...nel.org>
Cc:     Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        Banajit Goswami <bgoswami@...cinc.com>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <andersson@...nel.org>,
        Konrad Dybcio <konrad.dybcio@...aro.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>,
        linux-arm-msm@...r.kernel.org, alsa-devel@...a-project.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        Otto Pflüger <otto.pflueger@...cue.de>,
        Stephan Gerhold <stephan@...hold.net>
Subject: [PATCH 1/6] ASoC: dt-bindings: pm8916-analog-codec: Fix misleading
 example

SPMI devices typically have a single address cell and no size cell,
i.e. reg = <0xf000> for the audio codec instead of reg = <0xf000 0x200>.

The example is a bit misleading because it uses the latter. Copying
this into the device tree would be incorrect and was fixed before for
pm8916.dtsi in commit c2f0cbb57dba ("arm64: dts: qcom: pm8916: Remove
invalid reg size from wcd_codec").

Make the example more clear by adding the outer "pmic" node which
specifies the same #address/size-cells that would be used in the
real deivce tree.

Signed-off-by: Stephan Gerhold <stephan@...hold.net>
---
 .../sound/qcom,pm8916-wcd-analog-codec.yaml        | 92 ++++++++++++----------
 1 file changed, 50 insertions(+), 42 deletions(-)

diff --git a/Documentation/devicetree/bindings/sound/qcom,pm8916-wcd-analog-codec.yaml b/Documentation/devicetree/bindings/sound/qcom,pm8916-wcd-analog-codec.yaml
index c385028c4296..77e3cfba4746 100644
--- a/Documentation/devicetree/bindings/sound/qcom,pm8916-wcd-analog-codec.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,pm8916-wcd-analog-codec.yaml
@@ -115,46 +115,54 @@ examples:
   - |
     #include <dt-bindings/clock/qcom,gcc-msm8916.h>
     #include <dt-bindings/interrupt-controller/irq.h>
-
-    audio-codec@...0{
-      compatible = "qcom,pm8916-wcd-analog-codec";
-      reg = <0xf000 0x200>;
-      reg-names = "pmic-codec-core";
-      clocks = <&gcc GCC_CODEC_DIGCODEC_CLK>;
-      clock-names = "mclk";
-      qcom,mbhc-vthreshold-low = <75 150 237 450 500>;
-      qcom,mbhc-vthreshold-high = <75 150 237 450 500>;
-      interrupt-parent = <&spmi_bus>;
-      interrupts = <0x1 0xf0 0x0 IRQ_TYPE_NONE>,
-            <0x1 0xf0 0x1 IRQ_TYPE_NONE>,
-            <0x1 0xf0 0x2 IRQ_TYPE_NONE>,
-            <0x1 0xf0 0x3 IRQ_TYPE_NONE>,
-            <0x1 0xf0 0x4 IRQ_TYPE_NONE>,
-            <0x1 0xf0 0x5 IRQ_TYPE_NONE>,
-            <0x1 0xf0 0x6 IRQ_TYPE_NONE>,
-            <0x1 0xf0 0x7 IRQ_TYPE_NONE>,
-            <0x1 0xf1 0x0 IRQ_TYPE_NONE>,
-            <0x1 0xf1 0x1 IRQ_TYPE_NONE>,
-            <0x1 0xf1 0x2 IRQ_TYPE_NONE>,
-            <0x1 0xf1 0x3 IRQ_TYPE_NONE>,
-            <0x1 0xf1 0x4 IRQ_TYPE_NONE>,
-            <0x1 0xf1 0x5 IRQ_TYPE_NONE>;
-      interrupt-names = "cdc_spk_cnp_int",
-                        "cdc_spk_clip_int",
-                        "cdc_spk_ocp_int",
-                        "mbhc_ins_rem_det1",
-                        "mbhc_but_rel_det",
-                        "mbhc_but_press_det",
-                        "mbhc_ins_rem_det",
-                        "mbhc_switch_int",
-                        "cdc_ear_ocp_int",
-                        "cdc_hphr_ocp_int",
-                        "cdc_hphl_ocp_det",
-                        "cdc_ear_cnp_int",
-                        "cdc_hphr_cnp_int",
-                        "cdc_hphl_cnp_int";
-      vdd-cdc-io-supply = <&pm8916_l5>;
-      vdd-cdc-tx-rx-cx-supply = <&pm8916_l5>;
-      vdd-micbias-supply = <&pm8916_l13>;
-      #sound-dai-cells = <1>;
+    #include <dt-bindings/spmi/spmi.h>
+
+    pmic@1 {
+      compatible = "qcom,pm8916", "qcom,spmi-pmic";
+      reg = <0x1 SPMI_USID>;
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      audio-codec@...0 {
+        compatible = "qcom,pm8916-wcd-analog-codec";
+        reg = <0xf000>;
+        reg-names = "pmic-codec-core";
+        clocks = <&gcc GCC_CODEC_DIGCODEC_CLK>;
+        clock-names = "mclk";
+        qcom,mbhc-vthreshold-low = <75 150 237 450 500>;
+        qcom,mbhc-vthreshold-high = <75 150 237 450 500>;
+        interrupt-parent = <&spmi_bus>;
+        interrupts = <0x1 0xf0 0x0 IRQ_TYPE_NONE>,
+              <0x1 0xf0 0x1 IRQ_TYPE_NONE>,
+              <0x1 0xf0 0x2 IRQ_TYPE_NONE>,
+              <0x1 0xf0 0x3 IRQ_TYPE_NONE>,
+              <0x1 0xf0 0x4 IRQ_TYPE_NONE>,
+              <0x1 0xf0 0x5 IRQ_TYPE_NONE>,
+              <0x1 0xf0 0x6 IRQ_TYPE_NONE>,
+              <0x1 0xf0 0x7 IRQ_TYPE_NONE>,
+              <0x1 0xf1 0x0 IRQ_TYPE_NONE>,
+              <0x1 0xf1 0x1 IRQ_TYPE_NONE>,
+              <0x1 0xf1 0x2 IRQ_TYPE_NONE>,
+              <0x1 0xf1 0x3 IRQ_TYPE_NONE>,
+              <0x1 0xf1 0x4 IRQ_TYPE_NONE>,
+              <0x1 0xf1 0x5 IRQ_TYPE_NONE>;
+        interrupt-names = "cdc_spk_cnp_int",
+                          "cdc_spk_clip_int",
+                          "cdc_spk_ocp_int",
+                          "mbhc_ins_rem_det1",
+                          "mbhc_but_rel_det",
+                          "mbhc_but_press_det",
+                          "mbhc_ins_rem_det",
+                          "mbhc_switch_int",
+                          "cdc_ear_ocp_int",
+                          "cdc_hphr_ocp_int",
+                          "cdc_hphl_ocp_det",
+                          "cdc_ear_cnp_int",
+                          "cdc_hphr_cnp_int",
+                          "cdc_hphl_cnp_int";
+        vdd-cdc-io-supply = <&pm8916_l5>;
+        vdd-cdc-tx-rx-cx-supply = <&pm8916_l5>;
+        vdd-micbias-supply = <&pm8916_l13>;
+        #sound-dai-cells = <1>;
+      };
     };

-- 
2.41.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ