mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 07:04:48 +01:00
ASoC: tas2783A: sdw_utils: support ch 3 & 4
Currently the machine driver for tas2783A can only support 2 channels. This patch adds support for 2 channel playback with 4 device setup. Signed-off-by: Niranjan H Y <niranjan.hy@ti.com> Link: https://patch.msgid.link/20251215153219.810-1-niranjan.hy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
f764645cb8
commit
5965df0670
2 changed files with 22 additions and 4 deletions
|
|
@ -58,6 +58,10 @@ int asoc_sdw_ti_spk_rtd_init(struct snd_soc_pcm_runtime *rtd,
|
|||
strscpy(speaker, "Left Spk", sizeof(speaker));
|
||||
} else if (!strncmp(prefix, "tas2783-2", strlen("tas2783-2"))) {
|
||||
strscpy(speaker, "Right Spk", sizeof(speaker));
|
||||
} else if (!strncmp(prefix, "tas2783-3", strlen("tas2783-3"))) {
|
||||
strscpy(speaker, "Left Spk2", sizeof(speaker));
|
||||
} else if (!strncmp(prefix, "tas2783-4", strlen("tas2783-4"))) {
|
||||
strscpy(speaker, "Right Spk2", sizeof(speaker));
|
||||
} else {
|
||||
ret = -EINVAL;
|
||||
dev_err(card->dev, "unhandled prefix %s", prefix);
|
||||
|
|
|
|||
|
|
@ -40,11 +40,25 @@ static const struct snd_soc_dapm_widget lr_spk_widgets[] = {
|
|||
SND_SOC_DAPM_SPK("Right Spk", NULL),
|
||||
};
|
||||
|
||||
static const struct snd_soc_dapm_widget lr_4spk_widgets[] = {
|
||||
SND_SOC_DAPM_SPK("Left Spk", NULL),
|
||||
SND_SOC_DAPM_SPK("Right Spk", NULL),
|
||||
SND_SOC_DAPM_SPK("Left Spk2", NULL),
|
||||
SND_SOC_DAPM_SPK("Right Spk2", NULL),
|
||||
};
|
||||
|
||||
static const struct snd_kcontrol_new lr_spk_controls[] = {
|
||||
SOC_DAPM_PIN_SWITCH("Left Spk"),
|
||||
SOC_DAPM_PIN_SWITCH("Right Spk"),
|
||||
};
|
||||
|
||||
static const struct snd_kcontrol_new lr_4spk_controls[] = {
|
||||
SOC_DAPM_PIN_SWITCH("Left Spk"),
|
||||
SOC_DAPM_PIN_SWITCH("Right Spk"),
|
||||
SOC_DAPM_PIN_SWITCH("Left Spk2"),
|
||||
SOC_DAPM_PIN_SWITCH("Right Spk2"),
|
||||
};
|
||||
|
||||
static const struct snd_soc_dapm_widget rt700_widgets[] = {
|
||||
SND_SOC_DAPM_HP("Headphones", NULL),
|
||||
SND_SOC_DAPM_MIC("AMIC", NULL),
|
||||
|
|
@ -69,10 +83,10 @@ struct asoc_sdw_codec_info codec_info_list[] = {
|
|||
.dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID},
|
||||
.init = asoc_sdw_ti_amp_init,
|
||||
.rtd_init = asoc_sdw_ti_spk_rtd_init,
|
||||
.controls = lr_spk_controls,
|
||||
.num_controls = ARRAY_SIZE(lr_spk_controls),
|
||||
.widgets = lr_spk_widgets,
|
||||
.num_widgets = ARRAY_SIZE(lr_spk_widgets),
|
||||
.controls = lr_4spk_controls,
|
||||
.num_controls = ARRAY_SIZE(lr_4spk_controls),
|
||||
.widgets = lr_4spk_widgets,
|
||||
.num_widgets = ARRAY_SIZE(lr_4spk_widgets),
|
||||
},
|
||||
},
|
||||
.dai_num = 1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue