ASoC: codecs: tx-macro: Drop unimplemented DMIC clock divider
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Fri, 2 Feb 2024 15:41:32 +0000 (16:41 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 13 Feb 2024 17:36:00 +0000 (17:36 +0000)
Downstream driver configures DMIC clock rate through the divider
register but only parts of this code ended up in the upstream driver: we
always write the same value 0, so DIV2.  Same default value is used also
for the AMIC rate control.

Let's make it obvious and drop unneeded parts of the code.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240202154134.66967-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/lpass-tx-macro.c

index 124c2e144f337357af954e1ee4bc9d7b1e3c4b37..cdceccf64ac85ccb4ec9a3b0cf9cfd1a6ed73028 100644 (file)
@@ -38,6 +38,8 @@
 #define CDC_TX_TOP_CSR_I2S_RESET       (0x00AC)
 #define CDC_TX_TOP_CSR_SWR_DMICn_CTL(n)        (0x00C0 + n * 0x4)
 #define CDC_TX_TOP_CSR_SWR_DMIC0_CTL   (0x00C0)
+/* Default divider for AMIC and DMIC clock: DIV2 */
+#define CDC_TX_SWR_MIC_CLK_DEFAULT     0
 #define CDC_TX_SWR_DMIC_CLK_SEL_MASK   GENMASK(3, 1)
 #define CDC_TX_TOP_CSR_SWR_DMIC1_CTL   (0x00C4)
 #define CDC_TX_TOP_CSR_SWR_DMIC2_CTL   (0x00C8)
@@ -270,7 +272,6 @@ struct tx_macro {
        struct clk_hw hw;
        bool dec_active[NUM_DECIMATORS];
        int tx_mclk_users;
-       u16 dmic_clk_div;
        bool bcs_enable;
        int dec_mode[NUM_DECIMATORS];
        struct lpass_macro *pds;
@@ -743,7 +744,6 @@ static int tx_macro_put_dec_enum(struct snd_kcontrol *kcontrol,
        unsigned int val, dmic;
        u16 mic_sel_reg;
        u16 dmic_clk_reg;
-       struct tx_macro *tx = snd_soc_component_get_drvdata(component);
 
        val = ucontrol->value.enumerated.item[0];
        if (val >= e->items)
@@ -793,7 +793,7 @@ static int tx_macro_put_dec_enum(struct snd_kcontrol *kcontrol,
                        dmic_clk_reg = CDC_TX_TOP_CSR_SWR_DMICn_CTL(dmic);
                        snd_soc_component_write_field(component, dmic_clk_reg,
                                                CDC_TX_SWR_DMIC_CLK_SEL_MASK,
-                                               tx->dmic_clk_div);
+                                               CDC_TX_SWR_MIC_CLK_DEFAULT);
                }
        }
 
@@ -882,7 +882,7 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w,
 
                                snd_soc_component_write_field(component, dmic_clk_reg,
                                                        CDC_TX_SWR_DMIC_CLK_SEL_MASK,
-                                                       tx->dmic_clk_div);
+                                                       CDC_TX_SWR_MIC_CLK_DEFAULT);
                        }
                }
                snd_soc_component_write_field(component, dec_cfg_reg,