Skip to content

Commit 720d154

Browse files
author
André Apitzsch
committed
ASoC: qcom: apq8016_sbc: Add support for arizona WM8998
Signed-off-by: André Apitzsch <[email protected]>
1 parent ae75cc7 commit 720d154

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

sound/soc/qcom/apq8016_sbc.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222

2323
#define MI2S_COUNT (MI2S_QUATERNARY + 1)
2424

25+
#define ARIZONA_CLK_SYSCLK 1
26+
#define ARIZONA_CLK_SRC_MCLK1 0
27+
2528
struct apq8016_sbc_data {
2629
struct snd_soc_card card;
2730
void __iomem *mic_iomux;
@@ -127,11 +130,21 @@ static int apq8016_dai_init(struct snd_soc_pcm_runtime *rtd, int mi2s)
127130
}
128131

129132
for_each_rtd_codec_dais(rtd, i, codec_dai) {
130-
133+
int clk_id, pll_out, source;
134+
135+
if (!strcmp(codec_dai->name, "wm8998-aif1")) {
136+
clk_id = ARIZONA_CLK_SYSCLK;
137+
pll_out = 12288000;
138+
source = ARIZONA_CLK_SRC_MCLK1;
139+
} else {
140+
clk_id = 0;
141+
pll_out = DEFAULT_MCLK_RATE;
142+
source = 0;
143+
}
131144
component = codec_dai->component;
132145
/* Set default mclk for internal codec */
133-
rval = snd_soc_component_set_sysclk(component, 0, 0, DEFAULT_MCLK_RATE,
134-
SND_SOC_CLOCK_IN);
146+
rval = snd_soc_component_set_sysclk(component, clk_id, source,
147+
pll_out, SND_SOC_CLOCK_IN);
135148
if (rval != 0 && rval != -ENOTSUPP) {
136149
dev_warn(card->dev, "Failed to set mclk: %d\n", rval);
137150
return rval;

0 commit comments

Comments
 (0)