build/patch/kernel/archive/sunxi-6.1/patches.megous/ASoC-codec-rt5640-Fix-output-mixer-input-channel-list.patch

94 lines
3.4 KiB
Diff

From 553e27c5dbe5653af44ed8b7207b366ad9fb39c8 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Fri, 19 Aug 2022 22:01:23 +0200
Subject: [PATCH 386/389] ASoC: codec: rt5640: Fix output mixer input channel
list
It did not match the RT5640 datasheet. Now it does.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
sound/soc/codecs/rt5640.c | 14 +++++++-------
sound/soc/codecs/rt5640.h | 16 ++++++----------
2 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c
index 18e01949f20e..03b9bc47cb61 100644
--- a/sound/soc/codecs/rt5640.c
+++ b/sound/soc/codecs/rt5640.c
@@ -653,8 +653,8 @@ static const struct snd_kcontrol_new rt5640_spk_r_mix[] = {
};
static const struct snd_kcontrol_new rt5640_out_l_mix[] = {
- SOC_DAPM_SINGLE("SPK MIXL Switch", RT5640_OUT_L3_MIXER,
- RT5640_M_SM_L_OM_L_SFT, 1, 1),
+ SOC_DAPM_SINGLE("BST3 Switch", RT5640_OUT_L3_MIXER,
+ RT5640_M_BST3_OM_L_SFT, 1, 1),
SOC_DAPM_SINGLE("BST1 Switch", RT5640_OUT_L3_MIXER,
RT5640_M_BST1_OM_L_SFT, 1, 1),
SOC_DAPM_SINGLE("INL Switch", RT5640_OUT_L3_MIXER,
@@ -670,10 +670,10 @@ static const struct snd_kcontrol_new rt5640_out_l_mix[] = {
};
static const struct snd_kcontrol_new rt5640_out_r_mix[] = {
- SOC_DAPM_SINGLE("SPK MIXR Switch", RT5640_OUT_R3_MIXER,
- RT5640_M_SM_L_OM_R_SFT, 1, 1),
SOC_DAPM_SINGLE("BST2 Switch", RT5640_OUT_R3_MIXER,
- RT5640_M_BST4_OM_R_SFT, 1, 1),
+ RT5640_M_BST2_OM_R_SFT, 1, 1),
+ SOC_DAPM_SINGLE("BST3 Switch", RT5640_OUT_R3_MIXER,
+ RT5640_M_BST3_OM_R_SFT, 1, 1),
SOC_DAPM_SINGLE("BST1 Switch", RT5640_OUT_R3_MIXER,
RT5640_M_BST1_OM_R_SFT, 1, 1),
SOC_DAPM_SINGLE("INR Switch", RT5640_OUT_R3_MIXER,
@@ -1605,8 +1605,8 @@ static const struct snd_soc_dapm_route rt5640_specific_dapm_routes[] = {
{"SPK MIXL", "DAC L2 Switch", "DAC L2"},
{"SPK MIXR", "DAC R2 Switch", "DAC R2"},
- {"OUT MIXL", "SPK MIXL Switch", "SPK MIXL"},
- {"OUT MIXR", "SPK MIXR Switch", "SPK MIXR"},
+ {"OUT MIXL", "BST3 Switch", "BST3"},
+ {"OUT MIXR", "BST3 Switch", "BST3"},
{"OUT MIXL", "DAC R2 Switch", "DAC R2"},
{"OUT MIXL", "DAC L2 Switch", "DAC L2"},
diff --git a/sound/soc/codecs/rt5640.h b/sound/soc/codecs/rt5640.h
index 9847a1ae01f4..b70259a88bec 100644
--- a/sound/soc/codecs/rt5640.h
+++ b/sound/soc/codecs/rt5640.h
@@ -654,12 +654,8 @@
#define RT5640_G_DAC_L1_OM_L_SFT 7
/* Output Left Mixer Control 3 (0x4f) */
-#define RT5640_M_SM_L_OM_L (0x1 << 8)
-#define RT5640_M_SM_L_OM_L_SFT 8
-#define RT5640_M_BST3_OM_L (0x1 << 7)
-#define RT5640_M_BST3_OM_L_SFT 7
-#define RT5640_M_BST2_OM_L (0x1 << 6)
-#define RT5640_M_BST2_OM_L_SFT 6
+#define RT5640_M_BST3_OM_L (0x1 << 6)
+#define RT5640_M_BST3_OM_L_SFT 6
#define RT5640_M_BST1_OM_L (0x1 << 5)
#define RT5640_M_BST1_OM_L_SFT 5
#define RT5640_M_IN_L_OM_L (0x1 << 4)
@@ -694,12 +690,12 @@
#define RT5640_G_DAC_R1_OM_R_SFT 7
/* Output Right Mixer Control 3 (0x52) */
-#define RT5640_M_SM_L_OM_R (0x1 << 8)
-#define RT5640_M_SM_L_OM_R_SFT 8
#define RT5640_M_BST4_OM_R (0x1 << 7)
#define RT5640_M_BST4_OM_R_SFT 7
-#define RT5640_M_BST2_OM_R (0x1 << 6)
-#define RT5640_M_BST2_OM_R_SFT 6
+#define RT5640_M_BST2_OM_R (0x1 << 7)
+#define RT5640_M_BST2_OM_R_SFT 7
+#define RT5640_M_BST3_OM_R (0x1 << 6)
+#define RT5640_M_BST3_OM_R_SFT 6
#define RT5640_M_BST1_OM_R (0x1 << 5)
#define RT5640_M_BST1_OM_R_SFT 5
#define RT5640_M_IN_R_OM_R (0x1 << 4)
--
2.35.3