Skip to content

Commit 2db63e9

Browse files
committed
wcd937x codec fixes
Merge series from Alexey Klimov <alexey.klimov@linaro.org>: This sent as RFC because of the following: - regarding the LO switch patch. I've got info about that from two persons independently hence not sure what tags to put there and who should be the author. Please let me know if that needs to be corrected. - the wcd937x pdm watchdog is a problem for audio playback and needs to be fixed. The minimal fix would be to at least increase timeout value but it will still trigger in case of plenty of dbg messages or other delay-generating things. Unfortunately, I can't test HPHL/R outputs hence the patch is only for AUX. The other options would be introducing module parameter for debugging and using HOLD_OFF bit for that or adding Kconfig option. Alexey Klimov (2): ASoC: codecs: wcd937x: add missing LO Switch control ASoC: codecs: wcd937x: relax the AUX PDM watchdog sound/soc/codecs/wcd937x.c | 12 ++++++++++-- sound/soc/codecs/wcd937x.h | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) -- 2.45.2
2 parents cc8475a + 107a5c8 commit 2db63e9

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

sound/soc/codecs/wcd937x.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,12 +715,17 @@ static int wcd937x_codec_enable_aux_pa(struct snd_soc_dapm_widget *w,
715715
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
716716
struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component);
717717
int hph_mode = wcd937x->hph_mode;
718+
u8 val;
718719

719720
switch (event) {
720721
case SND_SOC_DAPM_PRE_PMU:
722+
val = WCD937X_DIGITAL_PDM_WD_CTL2_EN |
723+
WCD937X_DIGITAL_PDM_WD_CTL2_TIMEOUT_SEL |
724+
WCD937X_DIGITAL_PDM_WD_CTL2_HOLD_OFF;
721725
snd_soc_component_update_bits(component,
722726
WCD937X_DIGITAL_PDM_WD_CTL2,
723-
BIT(0), BIT(0));
727+
WCD937X_DIGITAL_PDM_WD_CTL2_MASK,
728+
val);
724729
break;
725730
case SND_SOC_DAPM_POST_PMU:
726731
usleep_range(1000, 1010);
@@ -741,7 +746,8 @@ static int wcd937x_codec_enable_aux_pa(struct snd_soc_dapm_widget *w,
741746
hph_mode);
742747
snd_soc_component_update_bits(component,
743748
WCD937X_DIGITAL_PDM_WD_CTL2,
744-
BIT(0), 0x00);
749+
WCD937X_DIGITAL_PDM_WD_CTL2_MASK,
750+
0x00);
745751
break;
746752
}
747753

@@ -2049,6 +2055,8 @@ static const struct snd_kcontrol_new wcd937x_snd_controls[] = {
20492055
wcd937x_get_swr_port, wcd937x_set_swr_port),
20502056
SOC_SINGLE_EXT("HPHR Switch", WCD937X_HPH_R, 0, 1, 0,
20512057
wcd937x_get_swr_port, wcd937x_set_swr_port),
2058+
SOC_SINGLE_EXT("LO Switch", WCD937X_LO, 0, 1, 0,
2059+
wcd937x_get_swr_port, wcd937x_set_swr_port),
20522060

20532061
SOC_SINGLE_EXT("ADC1 Switch", WCD937X_ADC1, 1, 1, 0,
20542062
wcd937x_get_swr_port, wcd937x_set_swr_port),

sound/soc/codecs/wcd937x.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,10 @@
391391
#define WCD937X_DIGITAL_PDM_WD_CTL0 0x3465
392392
#define WCD937X_DIGITAL_PDM_WD_CTL1 0x3466
393393
#define WCD937X_DIGITAL_PDM_WD_CTL2 0x3467
394+
#define WCD937X_DIGITAL_PDM_WD_CTL2_HOLD_OFF BIT(2)
395+
#define WCD937X_DIGITAL_PDM_WD_CTL2_TIMEOUT_SEL BIT(1)
396+
#define WCD937X_DIGITAL_PDM_WD_CTL2_EN BIT(0)
397+
#define WCD937X_DIGITAL_PDM_WD_CTL2_MASK GENMASK(2, 0)
394398
#define WCD937X_DIGITAL_INTR_MODE 0x346A
395399
#define WCD937X_DIGITAL_INTR_MASK_0 0x346B
396400
#define WCD937X_DIGITAL_INTR_MASK_1 0x346C

0 commit comments

Comments
 (0)