Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion include/sound/soc_sdw_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
*/
#define SOC_SDW_SIDECAR_AMPS BIT(16)
#define SOC_SDW_CODEC_MIC BIT(17)
/* Amp on hosts without DSP, capture ref stream should be disabled */
#define ASOC_SDW_CODEC_EXCLUDE_SPK_REF_STREAM BIT(18)

#define SOC_SDW_UNUSED_DAI_ID -1
#define SOC_SDW_JACK_OUT_DAI_ID 0
Expand Down Expand Up @@ -57,7 +59,7 @@ struct asoc_sdw_mc_private {
};

struct asoc_sdw_dai_info {
const bool direction[2]; /* playback & capture support */
bool direction[2]; /* playback & capture support */
const char *codec_name;
const char *dai_name;
const char *component_name;
Expand Down Expand Up @@ -189,6 +191,8 @@ int asoc_sdw_parse_sdw_endpoints(struct device *dev,
struct asoc_sdw_endpoint *soc_ends,
int *num_devs);

void asoc_sdw_disable_spk_ref_stream(void);

int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd);

/* DMIC support */
Expand Down
4 changes: 3 additions & 1 deletion sound/soc/amd/acp/acp-sdw-legacy-mach.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "soc_amd_sdw_common.h"
#include "../../codecs/rt711.h"

static unsigned long soc_sdw_quirk = RT711_JD1;
static unsigned long soc_sdw_quirk = RT711_JD1 | ASOC_SDW_CODEC_EXCLUDE_SPK_REF_STREAM;;
static int quirk_override = -1;
module_param_named(quirk, quirk_override, int, 0444);
MODULE_PARM_DESC(quirk, "Board-specific quirk override");
Expand Down Expand Up @@ -533,6 +533,8 @@ static int mc_probe(struct platform_device *pdev)
/* reset amp_num to ensure amp_num++ starts from 0 in each probe */
for (i = 0; i < ctx->codec_info_list_count; i++)
codec_info_list[i].amp_num = 0;
if (soc_sdw_quirk & ASOC_SDW_CODEC_EXCLUDE_SPK_REF_STREAM)
asoc_sdw_disable_spk_ref_stream();

ret = soc_card_dai_links_create(card);
if (ret < 0)
Expand Down
16 changes: 16 additions & 0 deletions sound/soc/sdw_utils/soc_sdw_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -2374,5 +2374,21 @@ int asoc_sdw_parse_sdw_endpoints(struct device *dev,
}
EXPORT_SYMBOL_NS(asoc_sdw_parse_sdw_endpoints, "SND_SOC_SDW_UTILS");

void asoc_sdw_disable_spk_ref_stream(void)
{
int i, j, dai_num, codec_list_count;
struct asoc_sdw_dai_info *dais;
codec_list_count = asoc_sdw_get_codec_info_list_count();
for (i = 0; i < codec_list_count; i++) {
dai_num = codec_info_list[i].dai_num;
dais = codec_info_list[i].dais;
for (j = 0; j < dai_num; j++) {
if (dais[j].dai_type == SOC_SDW_DAI_TYPE_AMP)
dais[j].direction[SNDRV_PCM_STREAM_CAPTURE] = false;
Comment on lines +2386 to +2387
}
}
}
EXPORT_SYMBOL_NS(asoc_sdw_disable_spk_ref_stream, "SND_SOC_SDW_UTILS");

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("SoundWire ASoC helpers");
Loading