mediatek: don't break auxadc without 32k clk
authorDaniel Golle <daniel@makrotopia.org>
Sun, 16 Oct 2022 18:35:50 +0000 (19:35 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Tue, 18 Oct 2022 19:08:25 +0000 (20:08 +0100)
Make the newly added 32k clock optional for the auxadc driver also used
on pre-filogic platforms.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
target/linux/mediatek/patches-5.15/501-auxadc-add-auxadc-32k-clk.patch

index a49fbca4ee70f7d5f8e9b50539f951deb630293c..5b98235ff413b00a2f9d68c29158a6e29a85d34c 100644 (file)
@@ -8,14 +8,16 @@
        struct mutex lock;
        const struct mtk_auxadc_compatible *dev_comp;
  };
-@@ -222,6 +223,12 @@ static int __maybe_unused mt6577_auxadc_
+@@ -222,6 +223,14 @@ static int __maybe_unused mt6577_auxadc_
                return ret;
        }
  
-+      ret = clk_prepare_enable(adc_dev->adc_32k_clk);
-+      if (ret) {
-+              pr_err("failed to enable auxadc clock\n");
-+              return ret;
++      if (!IS_ERR(adc_dev->adc_32k_clk)) {
++              ret = clk_prepare_enable(adc_dev->adc_32k_clk);
++              if (ret) {
++                      pr_err("failed to enable auxadc clock\n");
++                      return ret;
++              }
 +      }
 +
        mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,