Skip to content

Commit 8dbed90

Browse files
committed
Merge branch 'topic/qcom' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-msm8916
2 parents 52981e2 + 3a88a37 commit 8dbed90

File tree

2 files changed

+42
-6
lines changed

2 files changed

+42
-6
lines changed

sound/soc/codecs/msm8916-wcd-digital.c

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ static const char *const rx_mix1_text[] = {
218218
static const char *const dec_mux_text[] = {
219219
"ZERO", "ADC1", "ADC2", "ADC3", "DMIC1", "DMIC2"
220220
};
221+
222+
static const char *const cic_mux_text[] = { "AMIC", "DMIC" };
221223
static const char *const rx_mix2_text[] = { "ZERO", "IIR1", "IIR2" };
222224
static const char *const adc2_mux_text[] = { "ZERO", "INP2", "INP3" };
223225

@@ -256,11 +258,21 @@ static const struct soc_enum dec1_mux_enum = SOC_ENUM_SINGLE(
256258
static const struct soc_enum dec2_mux_enum = SOC_ENUM_SINGLE(
257259
LPASS_CDC_CONN_TX_B1_CTL, 3, 6, dec_mux_text);
258260

261+
/* CIC */
262+
static const struct soc_enum cic1_mux_enum = SOC_ENUM_SINGLE(
263+
LPASS_CDC_TX1_MUX_CTL, 0, 2, cic_mux_text);
264+
static const struct soc_enum cic2_mux_enum = SOC_ENUM_SINGLE(
265+
LPASS_CDC_TX2_MUX_CTL, 0, 2, cic_mux_text);
266+
259267
/* RDAC2 MUX */
260268
static const struct snd_kcontrol_new dec1_mux = SOC_DAPM_ENUM(
261269
"DEC1 MUX Mux", dec1_mux_enum);
262270
static const struct snd_kcontrol_new dec2_mux = SOC_DAPM_ENUM(
263271
"DEC2 MUX Mux", dec2_mux_enum);
272+
static const struct snd_kcontrol_new cic1_mux = SOC_DAPM_ENUM(
273+
"CIC1 MUX Mux", cic1_mux_enum);
274+
static const struct snd_kcontrol_new cic2_mux = SOC_DAPM_ENUM(
275+
"CIC2 MUX Mux", cic2_mux_enum);
264276
static const struct snd_kcontrol_new rx_mix1_inp1_mux = SOC_DAPM_ENUM(
265277
"RX1 MIX1 INP1 Mux", rx_mix1_inp_enum[0]);
266278
static const struct snd_kcontrol_new rx_mix1_inp2_mux = SOC_DAPM_ENUM(
@@ -500,6 +512,8 @@ static const struct snd_soc_dapm_widget msm8916_wcd_digital_dapm_widgets[] = {
500512
SND_SOC_DAPM_MUX("RX3 MIX1 INP3", SND_SOC_NOPM, 0, 0,
501513
&rx3_mix1_inp3_mux),
502514

515+
SND_SOC_DAPM_MUX("CIC1 MUX", SND_SOC_NOPM, 0, 0, &cic1_mux),
516+
SND_SOC_DAPM_MUX("CIC2 MUX", SND_SOC_NOPM, 0, 0, &cic2_mux),
503517
/* TX */
504518
SND_SOC_DAPM_MIXER("ADC1", SND_SOC_NOPM, 0, 0, NULL, 0),
505519
SND_SOC_DAPM_MIXER("ADC2", SND_SOC_NOPM, 0, 0, NULL, 0),
@@ -536,6 +550,8 @@ static const struct snd_soc_dapm_widget msm8916_wcd_digital_dapm_widgets[] = {
536550
/* Connectivity Clock */
537551
SND_SOC_DAPM_SUPPLY_S("CDC_CONN", -2, LPASS_CDC_CLK_OTHR_CTL, 2, 0,
538552
NULL, 0),
553+
SND_SOC_DAPM_MIC("Digital Mic1", NULL),
554+
SND_SOC_DAPM_MIC("Digital Mic2", NULL),
539555

540556
};
541557

@@ -655,6 +671,11 @@ static const struct snd_soc_dapm_route msm8916_wcd_digital_audio_map[] = {
655671
{"AIF1 Capture", NULL, "I2S TX2"},
656672
{"AIF1 Capture", NULL, "I2S TX3"},
657673

674+
{"CIC1 MUX", "DMIC", "DEC1 MUX"},
675+
{"CIC1 MUX", "AMIC", "DEC1 MUX"},
676+
{"CIC2 MUX", "DMIC", "DEC2 MUX"},
677+
{"CIC2 MUX", "AMIC", "DEC2 MUX"},
678+
658679
/* Decimator Inputs */
659680
{"DEC1 MUX", "DMIC1", "DMIC1"},
660681
{"DEC1 MUX", "DMIC2", "DMIC2"},
@@ -673,8 +694,8 @@ static const struct snd_soc_dapm_route msm8916_wcd_digital_audio_map[] = {
673694
{"DMIC1", NULL, "DMIC_CLK"},
674695
{"DMIC2", NULL, "DMIC_CLK"},
675696

676-
{"I2S TX1", NULL, "DEC1 MUX"},
677-
{"I2S TX2", NULL, "DEC2 MUX"},
697+
{"I2S TX1", NULL, "CIC1 MUX"},
698+
{"I2S TX2", NULL, "CIC2 MUX"},
678699

679700
{"I2S TX1", NULL, "TX_I2S_CLK"},
680701
{"I2S TX2", NULL, "TX_I2S_CLK"},

sound/soc/qcom/apq8016_sbc.c

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@ struct apq8016_sbc_data {
3434
#define MIC_CTRL_QUA_WS_SLAVE_SEL_10 BIT(17)
3535
#define MIC_CTRL_TLMM_SCLK_EN BIT(1)
3636
#define SPKR_CTL_PRI_WS_SLAVE_SEL_11 (BIT(17) | BIT(16))
37+
#define DEFAULT_MCLK_RATE 9600000
3738

3839
static int apq8016_sbc_dai_init(struct snd_soc_pcm_runtime *rtd)
3940
{
4041
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
42+
struct snd_soc_codec *codec;
43+
struct snd_soc_dai_link *dai_link = rtd->dai_link;
4144
struct snd_soc_card *card = rtd->card;
4245
struct apq8016_sbc_data *pdata = snd_soc_card_get_drvdata(card);
43-
int rval = 0;
46+
int i, rval;
4447

4548
switch (cpu_dai->id) {
4649
case MI2S_PRIMARY:
@@ -63,12 +66,24 @@ static int apq8016_sbc_dai_init(struct snd_soc_pcm_runtime *rtd)
6366

6467
default:
6568
dev_err(card->dev, "unsupported cpu dai configuration\n");
66-
rval = -EINVAL;
67-
break;
69+
return -EINVAL;
70+
71+
}
6872

73+
for (i = 0 ; i < dai_link->num_codecs; i++) {
74+
struct snd_soc_dai *dai = rtd->codec_dais[i];
75+
76+
codec = dai->codec;
77+
/* Set default mclk for internal codec */
78+
rval = snd_soc_codec_set_sysclk(codec, 0, 0, DEFAULT_MCLK_RATE,
79+
SND_SOC_CLOCK_IN);
80+
if (rval != 0 && rval != -ENOTSUPP) {
81+
dev_warn(card->dev, "Failed to set mclk: %d\n", rval);
82+
return rval;
83+
}
6984
}
7085

71-
return rval;
86+
return 0;
7287
}
7388

7489
static struct apq8016_sbc_data *apq8016_sbc_parse_of(struct snd_soc_card *card)

0 commit comments

Comments
 (0)