Skip to content

Commit 8eb94ba

Browse files
committed
ASoC: tas2783A: sdw_utils: support ch 3 & 4
Signed-off-by: Niranjan H Y <niranjan.hy@ti.com>
1 parent 951dec3 commit 8eb94ba

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

sound/soc/sdw_utils/soc_sdw_ti_amp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ int asoc_sdw_ti_spk_rtd_init(struct snd_soc_pcm_runtime *rtd,
5757
strscpy(speaker, "Left Spk", sizeof(speaker));
5858
} else if (!strncmp(prefix, "tas2783-2", strlen("tas2783-2"))) {
5959
strscpy(speaker, "Right Spk", sizeof(speaker));
60+
} else if (!strncmp(prefix, "tas2783-3", strlen("tas2783-3"))) {
61+
strscpy(speaker, "Left Spk2", sizeof(speaker));
62+
} else if (!strncmp(prefix, "tas2783-4", strlen("tas2783-4"))) {
63+
strscpy(speaker, "Right Spk2", sizeof(speaker));
6064
} else {
6165
ret = -EINVAL;
6266
dev_err(card->dev, "unhandled prefix %s", prefix);

sound/soc/sdw_utils/soc_sdw_utils.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,25 @@ static const struct snd_soc_dapm_widget lr_spk_widgets[] = {
4040
SND_SOC_DAPM_SPK("Right Spk", NULL),
4141
};
4242

43+
static const struct snd_soc_dapm_widget lr_4spk_widgets[] = {
44+
SND_SOC_DAPM_SPK("Left Spk", NULL),
45+
SND_SOC_DAPM_SPK("Right Spk", NULL),
46+
SND_SOC_DAPM_SPK("Left Spk2", NULL),
47+
SND_SOC_DAPM_SPK("Right Spk2", NULL),
48+
};
49+
4350
static const struct snd_kcontrol_new lr_spk_controls[] = {
4451
SOC_DAPM_PIN_SWITCH("Left Spk"),
4552
SOC_DAPM_PIN_SWITCH("Right Spk"),
4653
};
4754

55+
static const struct snd_kcontrol_new lr_4spk_controls[] = {
56+
SOC_DAPM_PIN_SWITCH("Left Spk"),
57+
SOC_DAPM_PIN_SWITCH("Right Spk"),
58+
SOC_DAPM_PIN_SWITCH("Left Spk2"),
59+
SOC_DAPM_PIN_SWITCH("Right Spk2"),
60+
};
61+
4862
static const struct snd_soc_dapm_widget rt700_widgets[] = {
4963
SND_SOC_DAPM_HP("Headphones", NULL),
5064
SND_SOC_DAPM_MIC("AMIC", NULL),
@@ -69,10 +83,10 @@ struct asoc_sdw_codec_info codec_info_list[] = {
6983
.dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID},
7084
.init = asoc_sdw_ti_amp_init,
7185
.rtd_init = asoc_sdw_ti_spk_rtd_init,
72-
.controls = lr_spk_controls,
73-
.num_controls = ARRAY_SIZE(lr_spk_controls),
74-
.widgets = lr_spk_widgets,
75-
.num_widgets = ARRAY_SIZE(lr_spk_widgets),
86+
.controls = lr_4spk_controls,
87+
.num_controls = ARRAY_SIZE(lr_4spk_controls),
88+
.widgets = lr_4spk_widgets,
89+
.num_widgets = ARRAY_SIZE(lr_4spk_widgets),
7690
},
7791
},
7892
.dai_num = 1,

0 commit comments

Comments
 (0)