ASoC: Intel: machine driver updates for 6.5
Subsystems (3)
cover ASoC: Intel: machine driver updates for 6.5
An unusually large set of patches to deal with new SoundWire-based platforms.
The bulk of the patches addresses support for MTL using RT712, RT713, MAX98363, CS42L42 jack codec and amplifiers. The sof_sdw machine driver had to be updated to remove limitations on number of codecs per links, dai types, dai naming, etc. We also moved parts of the Realtek and Maxim support in common code to avoid duplication.
Community users also reported two Dell SKUs which were not supported in the mainline due to hardware permutations.
Balamurugan C (3):
ASoC: Intel: ADL: Enable HDMI-In capture feature support for non-I2S
codec boards.
ASoC: Intel: ADL: Moving amp only boards into end of the table.
ASoC: Intel: Sof_ssp_amp: Correcting author name.
Bard Liao (14):
ASoC: Intel: sof_sdw: add missing exit callback
ASoC: Intel: sof_sdw: add dai info
ASoC: Intel: sof_sdw: use predefine dailink id
ASoC: Intel: sof_sdw: add codec_info pointer
ASoC: Intel: sdw_sof: append dai_type and remove codec_type
ASoC: Intel: sof_sdw: add multi dailink support for a codec
ASoC: Intel: sof_sdw_rt_sdca_jack_common: test SOF_JACK_JDSRC in _exit
ASoC: Intel: sof_sdw: rename SOF_RT711_JDSRC to SOF_JACK_JDSRC
ASoC: Intel: sof_sdw: make rt711_sdca be generic
ASoC: Intel: sof_sdw: add rt712 support
ASoC: Intel: soc-acpi-intel-tgl-match: add rt712 ID
ASoC: Intel: soc-acpi-intel-mtl-match: add rt712 ID
ASoC: Intel: sof_sdw: add rt713 support
ASoC: Intel: sof_sdw: increase sdw pin index for each sdw link
Pierre-Louis Bossart (4):
ASoC: Intel: soc-acpi: add table for RPL Dell SKU 0BDA
ASoC: Intel: sof_sdw: add quick for Dell SKU 0BDA
ASoC: Intel: soc-acpi: add tables for Dell SKU 0B34
ASoC: Intel: sof-sdw: add Dell SKU 0B34
Terry Cheong (1):
ASoC: Intel: Add rpl_rt1019_rt5682 driver
Uday M Bhat (6):
ASoC: Intel: sof_sdw: Add helper function for cs42l42 codec
ASoC: Intel: sof_sdw: Rename sof_sdw_max98373.c file to
sof_sdw_maxim.c
ASoC: Intel: sof_sdw: Modify maxim helper functions and structure
names
ASoC: Intel: sof_sdw: Add support for MAX98363 codec
ASoC: Intel: sof_sdw: Add support for Rex soundwire
ASoC: Intel: soc-acpi: add Rex CS42l42 and MAX98363 SoundWire entries
sound/soc/intel/boards/Kconfig | 4 +
sound/soc/intel/boards/Makefile | 10 +-
sound/soc/intel/boards/sof_rt5682.c | 11 +
sound/soc/intel/boards/sof_sdw.c | 542 +++++++++++++-----
sound/soc/intel/boards/sof_sdw_common.h | 86 ++-
sound/soc/intel/boards/sof_sdw_cs42l42.c | 131 +++++
.../{sof_sdw_max98373.c => sof_sdw_maxim.c} | 58 +-
sound/soc/intel/boards/sof_sdw_rt711.c | 4 +-
sound/soc/intel/boards/sof_sdw_rt712_sdca.c | 102 ++++
...1_sdca.c => sof_sdw_rt_sdca_jack_common.c} | 73 ++-
sound/soc/intel/boards/sof_ssp_amp.c | 11 +-
.../intel/common/soc-acpi-intel-adl-match.c | 46 +-
.../intel/common/soc-acpi-intel-mtl-match.c | 98 ++++
.../intel/common/soc-acpi-intel-rpl-match.c | 42 ++
.../intel/common/soc-acpi-intel-tgl-match.c | 53 ++
15 files changed, 1045 insertions(+), 226 deletions(-)
create mode 100644 sound/soc/intel/boards/sof_sdw_cs42l42.c
rename sound/soc/intel/boards/{sof_sdw_max98373.c => sof_sdw_maxim.c} (66%)
create mode 100644 sound/soc/intel/boards/sof_sdw_rt712_sdca.c
rename sound/soc/intel/boards/{sof_sdw_rt711_sdca.c => sof_sdw_rt_sdca_jack_common.c} (61%)Signature · 1 line
2.37.2
PATCH 1/28 ASoC: Intel: sof_sdw: add missing exit callback
From: Bard Liao <[email protected]>
Somehow .exit = sof_sdw_rt_amp_exit was missing in rt1318 codec info.
--- sound/soc/intel/boards/sof_sdw.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/intel/boards/sof_sdw.c +1 -0
@@ -609,6 +609,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .direction = {true, true}, .dai_name = "rt1318-aif", .init = sof_sdw_rt_amp_init, + .exit = sof_sdw_rt_amp_exit, .codec_type = SOF_SDW_CODEC_TYPE_AMP, }, {
Signature · 1 line
2.37.2
PATCH 2/28 ASoC: Intel: sof_sdw: add dai info
In reply to Pierre-Louis BossartFrom: Bard Liao <[email protected]>
The existing code create a dailink for a codec. However, we may need multi dailinks for a codec. This commit adds a new struct in sof_sdw_codec_info{} to store the dai info of a codec.
The initial assumption if that we will create at most 3 dailink types for a codec, since this is the max known with upcoming SDCA devices. We may need to increase this number as new SDCA 'functions' become available.
One strong assumption is that all dailinks exposed are independent, as per SDCA directions.
This commit just moves some items into the new sof_sdw_dai_info struct. There is no function changed. Multi dais supported will be added in the follow up commits.
--- sound/soc/intel/boards/sof_sdw.c | 225 +++++++++++++++++------- sound/soc/intel/boards/sof_sdw_common.h | 31 +++- 2 files changed, 183 insertions(+), 73 deletions(-)
sound/soc/intel/boards/sof_sdw.c +161 -64
@@ -563,134 +563,231 @@ static const struct snd_soc_ops sdw_ops = {static struct sof_sdw_codec_info codec_info_list[] = { { .part_id =0x700 , - .direction = {true, true}, - .dai_name ="rt700-aif1" , - .init = sof_sdw_rt700_init, + .dais = { + { + .direction = {true, true}, + .dai_name ="rt700-aif1" , + .dai_type =SOF_SDW_DAI_TYPE_JACK , + .init = sof_sdw_rt700_init, + }, + }, + .dai_num =1 , .codec_type =SOF_SDW_CODEC_TYPE_JACK , }, { .part_id =0x711 , .version_id =3 , - .direction = {true, true}, - .dai_name ="rt711-sdca-aif1" , - .init = sof_sdw_rt711_sdca_init, - .exit = sof_sdw_rt711_sdca_exit, + .dais = { + { + .direction = {true, true}, + .dai_name ="rt711-sdca-aif1" , + .dai_type =SOF_SDW_DAI_TYPE_JACK , + .init = sof_sdw_rt711_sdca_init, + .exit = sof_sdw_rt711_sdca_exit, + }, + }, + .dai_num =1 , .codec_type =SOF_SDW_CODEC_TYPE_JACK , }, { .part_id =0x711 , .version_id =2 , - .direction = {true, true}, - .dai_name ="rt711-aif1" , - .init = sof_sdw_rt711_init, - .exit = sof_sdw_rt711_exit, + .dais = { + { + .direction = {true, true}, + .dai_name ="rt711-aif1" , + .dai_type =SOF_SDW_DAI_TYPE_JACK , + .init = sof_sdw_rt711_init, + .exit = sof_sdw_rt711_exit, + }, + }, + .dai_num =1 , .codec_type =SOF_SDW_CODEC_TYPE_JACK , }, { .part_id =0x1308 , .acpi_id ="10EC1308" , - .direction = {true, false}, - .dai_name ="rt1308-aif" , + .dais = { + { + .direction = {true, false}, + .dai_name ="rt1308-aif" , + .dai_type =SOF_SDW_DAI_TYPE_AMP , + .init = sof_sdw_rt_amp_init, + .exit = sof_sdw_rt_amp_exit, + }, + }, + .dai_num =1 , .ops = &sof_sdw_rt1308_i2s_ops, - .init = sof_sdw_rt_amp_init, - .exit = sof_sdw_rt_amp_exit, .codec_type =SOF_SDW_CODEC_TYPE_AMP , }, { .part_id =0x1316 , - .direction = {true, true}, - .dai_name ="rt1316-aif" , - .init = sof_sdw_rt_amp_init, - .exit = sof_sdw_rt_amp_exit, + .dais = { + { + .direction = {true, true}, + .dai_name ="rt1316-aif" , + .dai_type =SOF_SDW_DAI_TYPE_AMP , + .init = sof_sdw_rt_amp_init, + .exit = sof_sdw_rt_amp_exit, + }, + }, + .dai_num =1 , .codec_type =SOF_SDW_CODEC_TYPE_AMP , }, { .part_id =0x1318 , - .direction = {true, true}, - .dai_name ="rt1318-aif" , - .init = sof_sdw_rt_amp_init, - .exit = sof_sdw_rt_amp_exit, + .dais = { + { + .direction = {true, true}, + .dai_name ="rt1318-aif" , + .dai_type =SOF_SDW_DAI_TYPE_AMP , + .init = sof_sdw_rt_amp_init, + .exit = sof_sdw_rt_amp_exit, + }, + }, + .dai_num =1 , .codec_type =SOF_SDW_CODEC_TYPE_AMP , }, { .part_id =0x714 , .version_id =3 , - .direction = {false, true}, .ignore_pch_dmic = true, - .dai_name ="rt715-aif2" , - .init = sof_sdw_rt715_sdca_init, + .dais = { + { + .direction = {false, true}, + .dai_name ="rt715-aif2" , + .dai_type =SOF_SDW_DAI_TYPE_MIC , + .init = sof_sdw_rt715_sdca_init, + }, + }, + .dai_num =1 , .codec_type =SOF_SDW_CODEC_TYPE_MIC , }, { .part_id =0x715 , .version_id =3 , - .direction = {false, true}, .ignore_pch_dmic = true, - .dai_name ="rt715-aif2" , - .init = sof_sdw_rt715_sdca_init, + .dais = { + { + .direction = {false, true}, + .dai_name ="rt715-aif2" , + .dai_type =SOF_SDW_DAI_TYPE_MIC , + .init = sof_sdw_rt715_sdca_init, + }, + }, + .dai_num =1 , .codec_type =SOF_SDW_CODEC_TYPE_MIC , }, { .part_id =0x714 , .version_id =2 , - .direction = {false, true}, .ignore_pch_dmic = true, - .dai_name ="rt715-aif2" , - .init = sof_sdw_rt715_init, + .dais = { + { + .direction = {false, true}, + .dai_name ="rt715-aif2" , + .dai_type =SOF_SDW_DAI_TYPE_MIC , + .init = sof_sdw_rt715_init, + }, + }, + .dai_num =1 , .codec_type =SOF_SDW_CODEC_TYPE_MIC , }, { .part_id =0x715 , .version_id =2 , - .direction = {false, true}, .ignore_pch_dmic = true, - .dai_name ="rt715-aif2" , - .init = sof_sdw_rt715_init, + .dais = { + { + .direction = {false, true}, + .dai_name ="rt715-aif2" , + .dai_type =SOF_SDW_DAI_TYPE_MIC , + .init = sof_sdw_rt715_init, + }, + }, + .dai_num =1 , .codec_type =SOF_SDW_CODEC_TYPE_MIC , }, { .part_id =0x8373 , - .direction = {true, true}, - .dai_name ="max98373-aif1" , - .init = sof_sdw_mx8373_init, + .dais = { + { + .direction = {true, true}, + .dai_name ="max98373-aif1" , + .dai_type =SOF_SDW_DAI_TYPE_AMP , + .init = sof_sdw_mx8373_init, + }, + }, + .dai_num =1 , .codec_type =SOF_SDW_CODEC_TYPE_AMP , }, { .part_id =0x5682 , - .direction = {true, true}, - .dai_name ="rt5682-sdw" , - .init = sof_sdw_rt5682_init, + .dais = { + { + .direction = {true, true}, + .dai_name ="rt5682-sdw" , + .dai_type =SOF_SDW_DAI_TYPE_JACK , + .init = sof_sdw_rt5682_init, + }, + }, + .dai_num =1 , .codec_type =SOF_SDW_CODEC_TYPE_JACK , }, { .part_id =0xaaaa ,/* generic codec mockup */ .version_id =0 , - .direction = {true, true}, - .dai_name ="sdw-mockup-aif1" , - .init =NULL , + .dais = { + { + .direction = {true, true}, + .dai_name ="sdw-mockup-aif1" , + .dai_type =SOF_SDW_DAI_TYPE_JACK , + .init =NULL , + }, + }, + .dai_num =1 , .codec_type =SOF_SDW_CODEC_TYPE_JACK , }, { .part_id =0xaa55 ,/* headset codec mockup */ .version_id =0 , - .direction = {true, true}, - .dai_name ="sdw-mockup-aif1" , - .init =NULL , + .dais = { + { + .direction = {true, true}, + .dai_name ="sdw-mockup-aif1" , + .dai_type =SOF_SDW_DAI_TYPE_JACK , + .init =NULL , + }, + }, + .dai_num =1 , .codec_type =SOF_SDW_CODEC_TYPE_JACK , }, { .part_id =0x55aa ,/* amplifier mockup */ .version_id =0 , - .direction = {true, false}, - .dai_name ="sdw-mockup-aif1" , - .init =NULL , + .dais = { + { + .direction = {true, false}, + .dai_name ="sdw-mockup-aif1" , + .dai_type =SOF_SDW_DAI_TYPE_AMP , + .init =NULL , + }, + }, + .dai_num =1 , .codec_type =SOF_SDW_CODEC_TYPE_AMP , }, { .part_id =0x5555 , .version_id =0 , - .direction = {false, true}, - .dai_name ="sdw-mockup-aif1" , + .dais = { + { + .dai_name ="sdw-mockup-aif1" , + .direction = {false, true}, + .dai_type =SOF_SDW_DAI_TYPE_MIC , + .init =NULL , + }, + }, + .dai_num =1 , .codec_type =SOF_SDW_CODEC_TYPE_MIC , }, };
@@ -780,7 +877,7 @@ static int get_sdw_dailink_info(struct device *dev, const struct snd_soc_acpi_li/* count DAI number for playback and capture */ for_each_pcm_streams (stream) { -if (!codec_info_list[codec_index].direction[stream]) +if (!codec_info_list[codec_index].dais[0 ].direction[stream])continue ; (*sdw_cpu_dai_num)++;
@@ -920,7 +1017,7 @@ static int create_codec_dai_name(struct device *dev, _codec_index = codec_index; codec[comp_index].dai_name = - codec_info_list[codec_index].dai_name; + codec_info_list[codec_index].dais[0 ].dai_name; codec_conf[*codec_conf_index].dlc = codec[comp_index]; codec_conf[*codec_conf_index].name_prefix = link->adr_d[i].name_prefix;
@@ -957,8 +1054,8 @@ static int set_codec_init_func(struct snd_soc_card *card,/* The group_id is > 0 iff the codec is aggregated */ if (link->adr_d[i].endpoints->group_id != group_id)continue ; -if (codec_info_list[codec_index].init) - codec_info_list[codec_index].init(card, +if (codec_info_list[codec_index].dais[0 ].init) + codec_info_list[codec_index].dais[0].init(card, link, dai_links, &codec_info_list[codec_index],
@@ -1154,7 +1251,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, "SDW%d-Capture-%s", }; -if (!codec_info_list[codec_index].direction[stream]) +if (!codec_info_list[codec_index].dais[0 ].direction[stream])continue ;/* create stream name according to first link id */
@@ -1458,18 +1555,18 @@ static int sof_card_dai_links_create(struct device *dev,return -ENOMEM ; ssp_components->name = codec_name; - ssp_components->dai_name = info->dai_name; + ssp_components->dai_name = info->dais[0 ].dai_name; cpus[cpu_id].dai_name = cpu_name; - playback = info->direction[SNDRV_PCM_STREAM_PLAYBACK ]; - capture = info->direction[SNDRV_PCM_STREAM_CAPTURE ]; + playback = info->dais[0 ].direction[SNDRV_PCM_STREAM_PLAYBACK ]; + capture = info->dais[0 ].direction[SNDRV_PCM_STREAM_CAPTURE ];init_dai_link (dev, links + link_index, be_id, name, playback, capture, cpus + cpu_id,1 , ssp_components,1 ,NULL , info->ops); - ret = info->init (card,NULL , links + link_index, info,0 ); + ret = info->dais[0 ].init (card,NULL , links + link_index, info,0 );if (ret <0 )return ret;
@@ -1606,7 +1703,7 @@ static void mc_dailink_exit_loop(struct snd_soc_card *card)int i, j;for (i =0 ; i <ARRAY_SIZE (codec_info_list); i++) { -if (!codec_info_list[i].exit) +if (!codec_info_list[i].dais[0 ].exit)continue ;/* * We don't need to call .exit function if there is no matched
@@ -1614,8 +1711,8 @@ static void mc_dailink_exit_loop(struct snd_soc_card *card)*/ for_each_card_prelinks (card, j, link) {if (!strcmp (link->codecs[0 ].dai_name, - codec_info_list[i].dai_name)) { - ret = codec_info_list[i].exit (card, link); + codec_info_list[i].dais[0 ].dai_name)) { + ret = codec_info_list[i].dais[0 ].exit (card, link);if (ret) dev_warn(card->dev, "codec exit failed %d\n",
sound/soc/intel/boards/sof_sdw_common.h +22 -9
@@ -56,24 +56,37 @@ enum {#define SOF_SDW_CODEC_TYPE_AMP 1#define SOF_SDW_CODEC_TYPE_MIC 2 +#define SOF_SDW_DAI_TYPE_JACK 0 +#define SOF_SDW_DAI_TYPE_AMP 1 +#define SOF_SDW_DAI_TYPE_MIC 2 + +#define SOF_SDW_MAX_DAI_NUM 3 + +struct sof_sdw_codec_info ; + +struct sof_sdw_dai_info { +const bool direction[2 ];/* playback & capture support */ +const char *dai_name; +const int dai_type; +int (*init)(struct snd_soc_card *card, +const struct snd_soc_acpi_link_adr *link, +struct snd_soc_dai_link *dai_links, +struct sof_sdw_codec_info *info, +bool playback); +int (*exit)(struct snd_soc_card *card,struct snd_soc_dai_link *dai_link); +}; +struct sof_sdw_codec_info {const int part_id;const int version_id;const int codec_type;int amp_num;const u8 acpi_id[ACPI_ID_LEN ]; -const bool direction[2 ];// playback & capture support const bool ignore_pch_dmic; -const char *dai_name;const struct snd_soc_ops *ops; +struct sof_sdw_dai_info dais[SOF_SDW_MAX_DAI_NUM ]; +const int dai_num; -int (*init)(struct snd_soc_card *card, -const struct snd_soc_acpi_link_adr *link, -struct snd_soc_dai_link *dai_links, -struct sof_sdw_codec_info *info, -bool playback); - -int (*exit)(struct snd_soc_card *card,struct snd_soc_dai_link *dai_link);int (*codec_card_late_probe)(struct snd_soc_card *card); };
Signature · 1 line
2.37.2
PATCH 3/28 ASoC: Intel: sof_sdw: use predefine dailink id
In reply to Pierre-Louis BossartFrom: Bard Liao <[email protected]>
Currently, we assign dailink ids in order, and shift with codec type. The purpose is to have consistent dailink ids for topologies. This can be simplified if we have a predefined dailink id in sof_sdw_dai_info.
We reuse the existing ids as the predefine ids. So the dailink ids will not be changed by this commit.
With this change, we no longer need to check the adr order described in a snd_soc_acpi_link_adr array.
--- sound/soc/intel/boards/sof_sdw.c | 42 +++++++++++++------------ sound/soc/intel/boards/sof_sdw_common.h | 7 ++++- 2 files changed, 28 insertions(+), 21 deletions(-)
sound/soc/intel/boards/sof_sdw.c +22 -20
@@ -568,6 +568,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .direction = {true, true}, .dai_name = "rt700-aif1", .dai_type = SOF_SDW_DAI_TYPE_JACK, + .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, .init = sof_sdw_rt700_init, }, },
@@ -582,6 +583,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .direction = {true, true}, .dai_name = "rt711-sdca-aif1", .dai_type = SOF_SDW_DAI_TYPE_JACK, + .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, .init = sof_sdw_rt711_sdca_init, .exit = sof_sdw_rt711_sdca_exit, },
@@ -597,6 +599,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .direction = {true, true}, .dai_name = "rt711-aif1", .dai_type = SOF_SDW_DAI_TYPE_JACK, + .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, .init = sof_sdw_rt711_init, .exit = sof_sdw_rt711_exit, },
@@ -612,6 +615,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .direction = {true, false}, .dai_name = "rt1308-aif", .dai_type = SOF_SDW_DAI_TYPE_AMP, + .dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID}, .init = sof_sdw_rt_amp_init, .exit = sof_sdw_rt_amp_exit, },
@@ -627,6 +631,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .direction = {true, true}, .dai_name = "rt1316-aif", .dai_type = SOF_SDW_DAI_TYPE_AMP, + .dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID}, .init = sof_sdw_rt_amp_init, .exit = sof_sdw_rt_amp_exit, },
@@ -641,6 +646,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .direction = {true, true}, .dai_name = "rt1318-aif", .dai_type = SOF_SDW_DAI_TYPE_AMP, + .dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID}, .init = sof_sdw_rt_amp_init, .exit = sof_sdw_rt_amp_exit, },
@@ -657,6 +663,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .direction = {false, true}, .dai_name = "rt715-aif2", .dai_type = SOF_SDW_DAI_TYPE_MIC, + .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, .init = sof_sdw_rt715_sdca_init, }, },
@@ -672,6 +679,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .direction = {false, true}, .dai_name = "rt715-aif2", .dai_type = SOF_SDW_DAI_TYPE_MIC, + .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, .init = sof_sdw_rt715_sdca_init, }, },
@@ -687,6 +695,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .direction = {false, true}, .dai_name = "rt715-aif2", .dai_type = SOF_SDW_DAI_TYPE_MIC, + .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, .init = sof_sdw_rt715_init, }, },
@@ -702,6 +711,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .direction = {false, true}, .dai_name = "rt715-aif2", .dai_type = SOF_SDW_DAI_TYPE_MIC, + .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, .init = sof_sdw_rt715_init, }, },
@@ -715,6 +725,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .direction = {true, true}, .dai_name = "max98373-aif1", .dai_type = SOF_SDW_DAI_TYPE_AMP, + .dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID}, .init = sof_sdw_mx8373_init, }, },
@@ -728,6 +739,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .direction = {true, true}, .dai_name = "rt5682-sdw", .dai_type = SOF_SDW_DAI_TYPE_JACK, + .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, .init = sof_sdw_rt5682_init, }, },
@@ -742,6 +754,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .direction = {true, true}, .dai_name = "sdw-mockup-aif1", .dai_type = SOF_SDW_DAI_TYPE_JACK, + .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, .init = NULL, }, },
@@ -756,6 +769,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .direction = {true, true}, .dai_name = "sdw-mockup-aif1", .dai_type = SOF_SDW_DAI_TYPE_JACK, + .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, .init = NULL, }, },
@@ -770,6 +784,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .direction = {true, false}, .dai_name = "sdw-mockup-aif1", .dai_type = SOF_SDW_DAI_TYPE_AMP, + .dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID}, .init = NULL, }, },
@@ -784,6 +799,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_name = "sdw-mockup-aif1", .direction = {false, true}, .dai_type = SOF_SDW_DAI_TYPE_MIC, + .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, .init = NULL, }, },
@@ -840,7 +856,6 @@ static int get_sdw_dailink_info(struct device *dev, const struct snd_soc_acpi_li int *sdw_be_num, int *sdw_cpu_dai_num) {const struct snd_soc_acpi_link_adr *link; -int _codec_type =SOF_SDW_CODEC_TYPE_JACK ;bool group_visited[SDW_MAX_GROUPS ];bool no_aggregation;int i;
@@ -867,12 +882,6 @@ static int get_sdw_dailink_info(struct device *dev, const struct snd_soc_acpi_liif (codec_index <0 )return codec_index; -if (codec_info_list[codec_index].codec_type < _codec_type) -dev_warn (dev, -"Unexpected address table ordering. Expected order: jack -> amp -> mic\n" ); - - _codec_type = codec_info_list[codec_index].codec_type; - endpoint = link->adr_d[i].endpoints;/* count DAI number for playback and capture */
@@ -1227,19 +1236,6 @@ static int create_sdw_dailink(struct snd_soc_card *card,if (codec_info_list[codec_index].ignore_pch_dmic) *ignore_pch_dmic = true; -/* Shift the first amplifier's *link_id to SDW_AMP_DAI_ID */ -if (codec_info_list[codec_index].codec_type ==SOF_SDW_CODEC_TYPE_AMP && - *link_id <SDW_AMP_DAI_ID ) - *link_id =SDW_AMP_DAI_ID ; - -/* -* DAI ID is fixed at SDW_DMIC_DAI_ID for MICs to -* keep sdw DMIC and HDMI setting static in UCM -*/ -if (codec_info_list[codec_index].codec_type ==SOF_SDW_CODEC_TYPE_MIC && - *link_id <SDW_DMIC_DAI_ID ) - *link_id =SDW_DMIC_DAI_ID ; - cpu_dai_index = *cpu_id;for_each_pcm_streams (stream) {char *name, *cpu_name;
@@ -1254,6 +1250,12 @@ static int create_sdw_dailink(struct snd_soc_card *card,if (!codec_info_list[codec_index].dais[0 ].direction[stream])continue ; + *link_id = codec_info_list[codec_index].dais[0 ].dailink[stream]; +if (*link_id <0 ) { +dev_err (dev,"Invalid dailink id %d\n" , *link_id); +return -EINVAL ; + } +/* create stream name according to first link id */ if (append_codec_type) { name = devm_kasprintf(dev, GFP_KERNEL,
sound/soc/intel/boards/sof_sdw_common.h +6 -1
@@ -15,7 +15,11 @@#define MAX_NO_PROPS 2#define MAX_HDMI_NUM 4 -#define SDW_AMP_DAI_ID 2 +#define SDW_UNUSED_DAI_ID -1 +#define SDW_JACK_OUT_DAI_ID 0 +#define SDW_JACK_IN_DAI_ID 1 +#define SDW_AMP_OUT_DAI_ID 2 +#define SDW_AMP_IN_DAI_ID 3#define SDW_DMIC_DAI_ID 4#define SDW_MAX_CPU_DAIS 16#define SDW_INTEL_BIDIR_PDI_BASE 2
@@ -68,6 +72,7 @@ struct sof_sdw_dai_info {const bool direction[2 ];/* playback & capture support */ const char *dai_name;const int dai_type; +const int dailink[2 ];/* dailink id for each direction */ int (*init)(struct snd_soc_card *card, const struct snd_soc_acpi_link_adr *link, struct snd_soc_dai_link *dai_links,
Signature · 1 line
2.37.2
PATCH 4/28 ASoC: Intel: sof_sdw: add codec_info pointer
In reply to Pierre-Louis BossartFrom: Bard Liao <[email protected]>
codec_info_list[codec_index] is used multiple times in the create_sdw_dailink() function. Adding a codec_info pointer to shorten the code. This is a preparation for the following up patches. No function changed.
--- sound/soc/intel/boards/sof_sdw.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
sound/soc/intel/boards/sof_sdw.c +9 -5
@@ -872,6 +872,7 @@ static int get_sdw_dailink_info(struct device *dev, const struct snd_soc_acpi_lifor (link = links; link->num_adr; link++) {const struct snd_soc_acpi_endpoint *endpoint; +struct sof_sdw_codec_info *codec_info;int codec_index;int stream;u64 adr;
@@ -881,12 +882,13 @@ static int get_sdw_dailink_info(struct device *dev, const struct snd_soc_acpi_li codec_index =find_codec_info_part (adr);if (codec_index <0 )return codec_index; + codec_info = &codec_info_list[codec_index]; endpoint = link->adr_d[i].endpoints;/* count DAI number for playback and capture */ for_each_pcm_streams (stream) { -if (!codec_info_list[codec_index].dais[0 ].direction[stream]) +if (!codec_info->dais[0 ].direction[stream])continue ; (*sdw_cpu_dai_num)++;
@@ -1184,6 +1186,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, {const struct snd_soc_acpi_link_adr *link_next;struct snd_soc_dai_link_component *codecs; +struct sof_sdw_codec_info *codec_info;int cpu_dai_id[SDW_MAX_CPU_DAIS ];int cpu_dai_num, cpu_dai_index;unsigned int group_id;
@@ -1232,8 +1235,9 @@ static int create_sdw_dailink(struct snd_soc_card *card, codec_index =find_codec_info_part (link->adr_d[adr_index].adr);if (codec_index <0 )return codec_index; + codec_info = &codec_info_list[codec_index]; -if (codec_info_list[codec_index].ignore_pch_dmic) +if (codec_info->ignore_pch_dmic) *ignore_pch_dmic = true; cpu_dai_index = *cpu_id;
@@ -1247,10 +1251,10 @@ static int create_sdw_dailink(struct snd_soc_card *card, "SDW%d-Capture-%s", }; -if (!codec_info_list[codec_index].dais[0 ].direction[stream]) +if (!codec_info->dais[0 ].direction[stream])continue ; - *link_id = codec_info_list[codec_index].dais[0 ].dailink[stream]; + *link_id = codec_info->dais[0 ].dailink[stream];if (*link_id <0 ) {dev_err (dev,"Invalid dailink id %d\n" , *link_id);return -EINVAL ;
@@ -1260,7 +1264,7 @@ static int create_sdw_dailink(struct snd_soc_card *card,if (append_codec_type) { name =devm_kasprintf (dev,GFP_KERNEL , sdw_stream_name[stream +2 ], cpu_dai_id[0 ], - type_strings[codec_info_list[codec_index].codec_type]); + type_strings[codec_info->codec_type]); }else { name =devm_kasprintf (dev,GFP_KERNEL , sdw_stream_name[stream], cpu_dai_id[0 ]);
Signature · 1 line
2.37.2
PATCH 5/28 ASoC: Intel: sdw_sof: append dai_type and remove codec_type
In reply to Pierre-Louis BossartFrom: Bard Liao <[email protected]>
We append codec type to dailink name to distinguish different dailink on the same sdw link and direction. But we could create multi dailinks for a codec and the dailink name will be duplicated if we append codec type to the dailink name.
Appending dai type instead of codec type can solve the issue. For example, if a codec supports JACK on dai 0 and AMP on dai 1, the existing code will create dailinks
SDW0-Playback-SimpleJack or SDW0-Playback-SmartAmp for both dailinks, and it will be SDW0-Playback-SimpleJack for dailink 0 and SDW0-Playback-SmartAmp for dailink 1 after this change. Then codec type is not used any more and can be removed.
--- sound/soc/intel/boards/sof_sdw.c | 28 ++++++------------------- sound/soc/intel/boards/sof_sdw_common.h | 5 ----- 2 files changed, 6 insertions(+), 27 deletions(-)
sound/soc/intel/boards/sof_sdw.c +6 -22
@@ -573,7 +573,6 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, }, .dai_num = 1, - .codec_type = SOF_SDW_CODEC_TYPE_JACK, }, { .part_id = 0x711,
@@ -589,7 +588,6 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, }, .dai_num = 1, - .codec_type = SOF_SDW_CODEC_TYPE_JACK, }, { .part_id = 0x711,
@@ -605,7 +603,6 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, }, .dai_num = 1, - .codec_type = SOF_SDW_CODEC_TYPE_JACK, }, { .part_id = 0x1308,
@@ -622,7 +619,6 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, .dai_num = 1, .ops = &sof_sdw_rt1308_i2s_ops, - .codec_type = SOF_SDW_CODEC_TYPE_AMP, }, { .part_id = 0x1316,
@@ -637,7 +633,6 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, }, .dai_num = 1, - .codec_type = SOF_SDW_CODEC_TYPE_AMP, }, { .part_id = 0x1318,
@@ -652,7 +647,6 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, }, .dai_num = 1, - .codec_type = SOF_SDW_CODEC_TYPE_AMP, }, { .part_id = 0x714,
@@ -668,7 +662,6 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, }, .dai_num = 1, - .codec_type = SOF_SDW_CODEC_TYPE_MIC, }, { .part_id = 0x715,
@@ -684,7 +677,6 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, }, .dai_num = 1, - .codec_type = SOF_SDW_CODEC_TYPE_MIC, }, { .part_id = 0x714,
@@ -700,7 +692,6 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, }, .dai_num = 1, - .codec_type = SOF_SDW_CODEC_TYPE_MIC, }, { .part_id = 0x715,
@@ -716,7 +707,6 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, }, .dai_num = 1, - .codec_type = SOF_SDW_CODEC_TYPE_MIC, }, { .part_id = 0x8373,
@@ -730,7 +720,6 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, }, .dai_num = 1, - .codec_type = SOF_SDW_CODEC_TYPE_AMP, }, { .part_id = 0x5682,
@@ -744,7 +733,6 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, }, .dai_num = 1, - .codec_type = SOF_SDW_CODEC_TYPE_JACK, }, { .part_id = 0xaaaa, /* generic codec mockup */
@@ -759,7 +747,6 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, }, .dai_num = 1, - .codec_type = SOF_SDW_CODEC_TYPE_JACK, }, { .part_id = 0xaa55, /* headset codec mockup */
@@ -774,7 +761,6 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, }, .dai_num = 1, - .codec_type = SOF_SDW_CODEC_TYPE_JACK, }, { .part_id = 0x55aa, /* amplifier mockup */
@@ -789,7 +775,6 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, }, .dai_num = 1, - .codec_type = SOF_SDW_CODEC_TYPE_AMP, }, { .part_id = 0x5555,
@@ -804,7 +789,6 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, }, .dai_num = 1, - .codec_type = SOF_SDW_CODEC_TYPE_MIC, }, };
@@ -1181,7 +1165,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, int codec_count, int *link_id, int *codec_conf_index, bool *ignore_pch_dmic, - bool append_codec_type, + bool append_dai_type, int adr_index) { const struct snd_soc_acpi_link_adr *link_next;
@@ -1261,10 +1245,10 @@ static int create_sdw_dailink(struct snd_soc_card *card, }/* create stream name according to first link id */ -if (append_codec_type) { +if (append_dai_type) { name =devm_kasprintf (dev,GFP_KERNEL , sdw_stream_name[stream +2 ], cpu_dai_id[0 ], - type_strings[codec_info->codec_type]); + type_strings[codec_info->dais[0 ].dai_type]); }else { name =devm_kasprintf (dev,GFP_KERNEL , sdw_stream_name[stream], cpu_dai_id[0 ]);
@@ -1384,7 +1368,7 @@ static int sof_card_dai_links_create(struct device *dev,const struct snd_soc_acpi_link_adr *adr_link;struct snd_soc_dai_link_component *cpus;struct snd_soc_codec_conf *codec_conf; -bool append_codec_type = false; +bool append_dai_type = false;bool ignore_pch_dmic = false;int codec_conf_count;int codec_conf_index =0 ;
@@ -1489,7 +1473,7 @@ static int sof_card_dai_links_create(struct device *dev, SDW_PART_ID(adr_link->adr_d[j].adr)) || (SDW_MFG_ID(adr_link->adr_d[i].adr) != SDW_MFG_ID(adr_link->adr_d[i].adr))) { - append_codec_type = true; + append_dai_type = true; goto out; } }
@@ -1519,7 +1503,7 @@ static int sof_card_dai_links_create(struct device *dev, &cpu_id, group_generated, codec_conf, codec_conf_count, &be_id, &codec_conf_index, - &ignore_pch_dmic, append_codec_type, i); + &ignore_pch_dmic, append_dai_type, i);if (ret <0 ) {dev_err (dev,"failed to create dai link %d" , link_index);return ret;
sound/soc/intel/boards/sof_sdw_common.h +0 -5
@@ -56,10 +56,6 @@ enum { (((quirk) << SOF_BT_OFFLOAD_SSP_SHIFT) & SOF_BT_OFFLOAD_SSP_MASK)#define SOF_SSP_BT_OFFLOAD_PRESENT BIT(18) -#define SOF_SDW_CODEC_TYPE_JACK 0 -#define SOF_SDW_CODEC_TYPE_AMP 1 -#define SOF_SDW_CODEC_TYPE_MIC 2 -#define SOF_SDW_DAI_TYPE_JACK 0#define SOF_SDW_DAI_TYPE_AMP 1#define SOF_SDW_DAI_TYPE_MIC 2
@@ -84,7 +80,6 @@ struct sof_sdw_dai_info {struct sof_sdw_codec_info {const int part_id;const int version_id; -const int codec_type;int amp_num;const u8 acpi_id[ACPI_ID_LEN ];const bool ignore_pch_dmic;
Signature · 1 line
2.37.2
PATCH 6/28 ASoC: Intel: sof_sdw: add multi dailink support for a codec
In reply to Pierre-Louis BossartFrom: Bard Liao <[email protected]>
A codec may support multiple dais for different purpose. For example, the rt712 codec supports jack and amp on different dais and machine driver needs to create different dailink for those dais.
--- sound/soc/intel/boards/sof_sdw.c | 129 +++++++++++++++++++++---------- 1 file changed, 89 insertions(+), 40 deletions(-)
sound/soc/intel/boards/sof_sdw.c +89 -40
@@ -843,6 +843,7 @@ static int get_sdw_dailink_info(struct device *dev, const struct snd_soc_acpi_libool group_visited[SDW_MAX_GROUPS ];bool no_aggregation;int i; +int j; no_aggregation = sof_sdw_quirk &SOF_SDW_NO_AGGREGATION ; *sdw_cpu_dai_num =0 ;
@@ -870,17 +871,19 @@ static int get_sdw_dailink_info(struct device *dev, const struct snd_soc_acpi_li endpoint = link->adr_d[i].endpoints; -/* count DAI number for playback and capture */ -for_each_pcm_streams (stream) { -if (!codec_info->dais[0 ].direction[stream]) -continue ; +for (j =0 ; j < codec_info->dai_num; j++) { +/* count DAI number for playback and capture */ +for_each_pcm_streams (stream) { +if (!codec_info->dais[j].direction[stream]) +continue ; - (*sdw_cpu_dai_num)++; + (*sdw_cpu_dai_num)++; -/* count BE for each non-aggregated slave or group */ -if (!endpoint->aggregated || no_aggregation || - !group_visited[endpoint->group_id]) - (*sdw_be_num)++; +/* count BE for each non-aggregated slave or group */ +if (!endpoint->aggregated || no_aggregation || + !group_visited[endpoint->group_id]) + (*sdw_be_num)++; + } }if (endpoint->aggregated)
@@ -956,7 +959,8 @@ static int create_codec_dai_name(struct device *dev,struct snd_soc_codec_conf *codec_conf, int codec_count, int *codec_conf_index, - int adr_index) + int adr_index, + int dai_index) { int _codec_index = -1;int i;
@@ -1012,7 +1016,7 @@ static int create_codec_dai_name(struct device *dev, _codec_index = codec_index; codec[comp_index].dai_name = - codec_info_list[codec_index].dais[0 ].dai_name; + codec_info_list[codec_index].dais[dai_index].dai_name; codec_conf[*codec_conf_index].dlc = codec[comp_index]; codec_conf[*codec_conf_index].name_prefix = link->adr_d[i].name_prefix;
@@ -1026,7 +1030,7 @@ static int create_codec_dai_name(struct device *dev,static int set_codec_init_func (struct snd_soc_card *card,const struct snd_soc_acpi_link_adr *link,struct snd_soc_dai_link *dai_links, -bool playback,int group_id,int adr_index) +bool playback,int group_id,int adr_index,int dai_index) {int i = adr_index;
@@ -1046,11 +1050,13 @@ static int set_codec_init_func(struct snd_soc_card *card,if (codec_index <0 )return codec_index; +/* The group_id is > 0 iff the codec is aggregated */ if (link->adr_d[i].endpoints->group_id != group_id)continue ; -if (codec_info_list[codec_index].dais[0 ].init) - codec_info_list[codec_index].dais[0].init(card, + +if (codec_info_list[codec_index].dais[dai_index].init) + codec_info_list[codec_index].dais[dai_index].init(card, link, dai_links, &codec_info_list[codec_index],
@@ -1166,7 +1172,8 @@ static int create_sdw_dailink(struct snd_soc_card *card,int *codec_conf_index, bool *ignore_pch_dmic, bool append_dai_type, - int adr_index) + int adr_index, + int dai_index) { const struct snd_soc_acpi_link_adr *link_next;struct snd_soc_dai_link_component *codecs;
@@ -1206,7 +1213,8 @@ static int create_sdw_dailink(struct snd_soc_card *card,continue ; ret =create_codec_dai_name (dev, link_next, codecs, codec_idx, - codec_conf, codec_count, codec_conf_index, adr_index); + codec_conf, codec_count, codec_conf_index, + adr_index, dai_index);if (ret <0 )return ret;
@@ -1235,10 +1243,10 @@ static int create_sdw_dailink(struct snd_soc_card *card, "SDW%d-Capture-%s", }; -if (!codec_info->dais[0 ].direction[stream]) +if (!codec_info->dais[dai_index].direction[stream])continue ; - *link_id = codec_info->dais[0 ].dailink[stream]; + *link_id = codec_info->dais[dai_index].dailink[stream];if (*link_id <0 ) {dev_err (dev,"Invalid dailink id %d\n" , *link_id);return -EINVAL ;
@@ -1248,7 +1256,7 @@ static int create_sdw_dailink(struct snd_soc_card *card,if (append_dai_type) { name =devm_kasprintf (dev,GFP_KERNEL , sdw_stream_name[stream +2 ], cpu_dai_id[0 ], - type_strings[codec_info->dais[0 ].dai_type]); + type_strings[codec_info->dais[dai_index].dai_type]); }else { name =devm_kasprintf (dev,GFP_KERNEL , sdw_stream_name[stream], cpu_dai_id[0 ]);
@@ -1305,7 +1313,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, dai_links[*link_index].nonatomic = true; ret =set_codec_init_func (card, link, dai_links + (*link_index)++, - playback, group_id, adr_index); + playback, group_id, adr_index, dai_index);if (ret <0 ) {dev_err (dev,"failed to init codec %d" , codec_index);return ret;
@@ -1328,6 +1336,7 @@ static int sof_card_codec_conf_alloc(struct device *dev,const struct snd_soc_acpi_link_adr *adr_link;struct snd_soc_codec_conf *c_conf;int num_codecs =0 ; +int codec_index;int i; adr_link = mach_params->links;
@@ -1342,8 +1351,11 @@ static int sof_card_codec_conf_alloc(struct device *dev, adr_link->adr_d[i].adr);return -EINVAL ; } + codec_index =find_codec_info_part (adr_link->adr_d[i].adr); +if (codec_index <0 ) +return codec_index; + num_codecs += codec_info_list[codec_index].dai_num; } - num_codecs += adr_link->num_adr; } c_conf =devm_kzalloc (dev, num_codecs *sizeof (*c_conf),GFP_KERNEL );
@@ -1380,6 +1392,7 @@ static int sof_card_dai_links_create(struct device *dev,int total_cpu_dai_num;int sdw_cpu_dai_num;int i, j, be_id =0 ; +int codec_index;int cpu_id =0 ;int comp_num;int ret;
@@ -1468,6 +1481,14 @@ static int sof_card_dai_links_create(struct device *dev,* snd_soc_acpi_adr_device array. They won't be described in different adr_links. */ for (i =0 ; i < adr_link->num_adr; i++) { +/* find codec info to get dai_num */ + codec_index =find_codec_info_part (adr_link->adr_d[i].adr); +if (codec_index <0 ) +return codec_index; +if (codec_info_list[codec_index].dai_num >1 ) { + append_dai_type = true; + goto out; + }for (j =0 ; j < i; j++) { if ((SDW_PART_ID(adr_link->adr_d[i].adr) != SDW_PART_ID(adr_link->adr_d[j].adr)) ||
@@ -1498,15 +1519,22 @@ static int sof_card_dai_links_create(struct device *dev, group_generated[endpoint->group_id])continue ; - ret =create_sdw_dailink (card, dev, &link_index, links, sdw_be_num, - sdw_cpu_dai_num, cpus, adr_link, - &cpu_id, group_generated, - codec_conf, codec_conf_count, - &be_id, &codec_conf_index, - &ignore_pch_dmic, append_dai_type, i); -if (ret <0 ) { -dev_err (dev,"failed to create dai link %d" , link_index); -return ret; +/* find codec info to get dai_num */ + codec_index =find_codec_info_part (adr_link->adr_d[i].adr); +if (codec_index <0 ) +return codec_index; + +for (j =0 ; j < codec_info_list[codec_index].dai_num ; j++) { + ret =create_sdw_dailink (card, dev, &link_index, links, sdw_be_num, + sdw_cpu_dai_num, cpus, adr_link, + &cpu_id, group_generated, + codec_conf, codec_conf_count, + &be_id, &codec_conf_index, + &ignore_pch_dmic, append_dai_type, i, j); +if (ret <0 ) { +dev_err (dev,"failed to create dai link %d" , link_index); +return ret; + } } } }
@@ -1545,6 +1573,7 @@ static int sof_card_dai_links_create(struct device *dev,return -ENOMEM ; ssp_components->name = codec_name; +/* TODO: support multi codec dai on SSP when it is needed */ ssp_components->dai_name = info->dais[0 ].dai_name; cpus[cpu_id].dai_name = cpu_name;
@@ -1686,6 +1715,24 @@ static struct snd_soc_card card_sof_sdw = { .late_probe = sof_sdw_card_late_probe, }; +/* helper to get the link that the codec DAI is used */ +static struct snd_soc_dai_link *mc_find_codec_dai_used (struct snd_soc_card *card, +const char *dai_name) +{ +struct snd_soc_dai_link *link; +int i; +int j; + +for_each_card_prelinks (card, i, link) { +for (j =0 ; j < link->num_codecs; j++) { +/* Check each codec in a link */ +if (!strcmp (link->codecs[j].dai_name, dai_name)) +return link; + } + } +return NULL ; +} +static void mc_dailink_exit_loop (struct snd_soc_card *card) {struct snd_soc_dai_link *link;
@@ -1693,16 +1740,18 @@ static void mc_dailink_exit_loop(struct snd_soc_card *card)int i, j;for (i =0 ; i <ARRAY_SIZE (codec_info_list); i++) { -if (!codec_info_list[i].dais[0 ].exit) -continue ; -/* -* We don't need to call .exit function if there is no matched -* dai link found. -*/ -for_each_card_prelinks (card, j, link) { -if (!strcmp (link->codecs[0 ].dai_name, - codec_info_list[i].dais[0 ].dai_name)) { - ret = codec_info_list[i].dais[0 ].exit (card, link); +for (j =0 ; j < codec_info_list[i].dai_num; j++) { +/* Check each dai in codec_info_lis to see if it is used in the link */ +if (!codec_info_list[i].dais[j].exit) +continue ; +/* +* We don't need to call .exit function if there is no matched +* dai link found. +*/ + link =mc_find_codec_dai_used (card, codec_info_list[i].dais[j].dai_name); +if (link) { +/* Do the .exit function if the codec dai is used in the link */ + ret = codec_info_list[i].dais[j].exit (card, link);if (ret) dev_warn(card->dev, "codec exit failed %d\n",
Signature · 1 line
2.37.2
PATCH 7/28 ASoC: Intel: sof_sdw_rt_sdca_jack_common: test SOF_JACK_JDSRC in _exit
In reply to Pierre-Louis BossartFrom: Bard Liao <[email protected]>
if (!SOF_RT711_JDSRC(sof_sdw_quirk)) is tested in rt711_sdca_add_codec_ device_props(), and we don't add software node to the device if jack source is not set. We need to do the same test in sof_sdw_rt711_sdca_exit(), and avoid removing software node if jack source is not set.
--- sound/soc/intel/boards/sof_sdw_rt711_sdca.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/intel/boards/sof_sdw_rt711_sdca.c +3 -0
@@ -143,6 +143,9 @@ int sof_sdw_rt711_sdca_exit(struct snd_soc_card *card, struct snd_soc_dai_link *if (!ctx->headset_codec_dev)return 0 ; +if (!SOF_RT711_JDSRC (sof_sdw_quirk)) +return 0 ; +device_remove_software_node (ctx->headset_codec_dev);put_device (ctx->headset_codec_dev);
Signature · 1 line
2.37.2
PATCH 8/28 ASoC: Intel: sof_sdw: rename SOF_RT711_JDSRC to SOF_JACK_JDSRC
In reply to Pierre-Louis BossartFrom: Bard Liao <[email protected]>
Jack Detection source can be applied to all jacks, not only rt711. No function changes.
--- sound/soc/intel/boards/sof_sdw.c | 4 ++-- sound/soc/intel/boards/sof_sdw_common.h | 2 +- sound/soc/intel/boards/sof_sdw_rt711.c | 4 ++-- sound/soc/intel/boards/sof_sdw_rt711_sdca.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-)
sound/soc/intel/boards/sof_sdw.c +2 -2
@@ -24,9 +24,9 @@ MODULE_PARM_DESC(quirk, "Board-specific quirk override");static void log_quirks (struct device *dev) { -if (SOF_RT711_JDSRC (sof_sdw_quirk)) +if (SOF_JACK_JDSRC (sof_sdw_quirk))dev_dbg (dev,"quirk realtek,jack-detect-source %ld\n" , -SOF_RT711_JDSRC (sof_sdw_quirk)); +SOF_JACK_JDSRC (sof_sdw_quirk));if (sof_sdw_quirk &SOF_SDW_FOUR_SPK )dev_dbg (dev,"quirk SOF_SDW_FOUR_SPK enabled\n" );if (sof_sdw_quirk &SOF_SDW_TGL_HDMI )
sound/soc/intel/boards/sof_sdw_common.h +1 -1
@@ -41,7 +41,7 @@ enum { SOF_I2S_SSP5 = BIT(5), }; -#define SOF_RT711_JDSRC (quirk) ((quirk) & GENMASK(3, 0)) +#define SOF_JACK_JDSRC (quirk) ((quirk) & GENMASK(3, 0))#define SOF_SDW_FOUR_SPK BIT(4)#define SOF_SDW_TGL_HDMI BIT(5)#define SOF_SDW_PCH_DMIC BIT(6)
sound/soc/intel/boards/sof_sdw_rt711.c +2 -2
@@ -27,9 +27,9 @@ static int rt711_add_codec_device_props(struct device *sdw_dev)struct fwnode_handle *fwnode;int ret; -if (!SOF_RT711_JDSRC (sof_sdw_quirk)) +if (!SOF_JACK_JDSRC (sof_sdw_quirk))return 0 ; - props[0 ] =PROPERTY_ENTRY_U32 ("realtek,jd-src" ,SOF_RT711_JDSRC (sof_sdw_quirk)); + props[0 ] =PROPERTY_ENTRY_U32 ("realtek,jd-src" ,SOF_JACK_JDSRC (sof_sdw_quirk)); fwnode =fwnode_create_software_node (props,NULL );if (IS_ERR (fwnode))
sound/soc/intel/boards/sof_sdw_rt711_sdca.c +3 -3
@@ -27,10 +27,10 @@ static int rt711_sdca_add_codec_device_props(struct device *sdw_dev)struct fwnode_handle *fwnode;int ret; -if (!SOF_RT711_JDSRC (sof_sdw_quirk)) +if (!SOF_JACK_JDSRC (sof_sdw_quirk))return 0 ; - props[0 ] =PROPERTY_ENTRY_U32 ("realtek,jd-src" ,SOF_RT711_JDSRC (sof_sdw_quirk)); + props[0 ] =PROPERTY_ENTRY_U32 ("realtek,jd-src" ,SOF_JACK_JDSRC (sof_sdw_quirk)); fwnode =fwnode_create_software_node (props,NULL );if (IS_ERR (fwnode))
@@ -143,7 +143,7 @@ int sof_sdw_rt711_sdca_exit(struct snd_soc_card *card, struct snd_soc_dai_link *if (!ctx->headset_codec_dev)return 0 ; -if (!SOF_RT711_JDSRC (sof_sdw_quirk)) +if (!SOF_JACK_JDSRC (sof_sdw_quirk))return 0 ;device_remove_software_node (ctx->headset_codec_dev);
Signature · 1 line
2.37.2
PATCH 9/28 ASoC: Intel: sof_sdw: make rt711_sdca be generic
In reply to Pierre-Louis BossartFrom: Bard Liao <[email protected]>
Let rename rt711_sdca to rt_sdca_jack and let it be used for all Realtek sdca jacks.
The commit uses component->name_prefix to construct card->components, and determine which codec it is. So, we have to set name_prefix properly.
---
sound/soc/intel/boards/Makefile | 2 +-
sound/soc/intel/boards/sof_sdw.c | 4 +-
sound/soc/intel/boards/sof_sdw_common.h | 12 ++--
...1_sdca.c => sof_sdw_rt_sdca_jack_common.c} | 57 ++++++++++---------
4 files changed, 40 insertions(+), 35 deletions(-)
rename sound/soc/intel/boards/{sof_sdw_rt711_sdca.c => sof_sdw_rt_sdca_jack_common.c} (68%)sound/soc/intel/boards/Makefile +1 -1
@@ -39,7 +39,7 @@ snd-soc-sof-ssp-amp-objs := sof_ssp_amp.o snd-soc-sof-sdw-objs += sof_sdw.o \ sof_sdw_max98373.o sof_sdw_rt_amp.o \ sof_sdw_rt5682.o sof_sdw_rt700.o \ - sof_sdw_rt711.o sof_sdw_rt711_sdca.o \ + sof_sdw_rt711.o sof_sdw_rt_sdca_jack_common.o \ sof_sdw_rt715.o sof_sdw_rt715_sdca.o \ sof_sdw_dmic.o sof_sdw_hdmi.o obj-$(CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH) += snd-soc-sof_rt5682.o
sound/soc/intel/boards/sof_sdw.c +2 -2
@@ -583,8 +583,8 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_name = "rt711-sdca-aif1", .dai_type = SOF_SDW_DAI_TYPE_JACK, .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, - .init = sof_sdw_rt711_sdca_init, - .exit = sof_sdw_rt711_sdca_exit, + .init = sof_sdw_rt_sdca_jack_init, + .exit = sof_sdw_rt_sdca_jack_exit, }, }, .dai_num = 1,
sound/soc/intel/boards/sof_sdw_common.h +6 -6
@@ -123,12 +123,12 @@ int sof_sdw_rt711_init(struct snd_soc_card *card,int sof_sdw_rt711_exit (struct snd_soc_card *card,struct snd_soc_dai_link *dai_link);/* RT711-SDCA support */ -int sof_sdw_rt711_sdca_init (struct snd_soc_card *card, -const struct snd_soc_acpi_link_adr *link, -struct snd_soc_dai_link *dai_links, -struct sof_sdw_codec_info *info, -bool playback); -int sof_sdw_rt711_sdca_exit (struct snd_soc_card *card,struct snd_soc_dai_link *dai_link); +int sof_sdw_rt_sdca_jack_init (struct snd_soc_card *card, +const struct snd_soc_acpi_link_adr *link, +struct snd_soc_dai_link *dai_links, +struct sof_sdw_codec_info *info, +bool playback); +int sof_sdw_rt_sdca_jack_exit (struct snd_soc_card *card,struct snd_soc_dai_link *dai_link);/* RT700 support */ int sof_sdw_rt700_init(struct snd_soc_card *card,
sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c renamed from sound/soc/intel/boards/sof_sdw_rt711_sdca.c +31 -26
134 lines not on this page · raw message
Signature · 1 line
2.37.2
PATCH 10/28 ASoC: Intel: sof_sdw: add rt712 support
In reply to Pierre-Louis BossartFrom: Bard Liao <[email protected]>
Rt712 is a multi function codec which shpports headset, amp, and dmic functions. Rt712 has two sdw interfaces and codec drivers, one for jack and amp, the other for dmic. part id 0x712 is for jack and amp, and 0x1712 is for dmic.
--- sound/soc/intel/boards/Kconfig | 2 + sound/soc/intel/boards/Makefile | 5 +- sound/soc/intel/boards/sof_sdw.c | 36 +++++++ sound/soc/intel/boards/sof_sdw_common.h | 18 ++++ sound/soc/intel/boards/sof_sdw_rt712_sdca.c | 102 ++++++++++++++++++ .../boards/sof_sdw_rt_sdca_jack_common.c | 9 +- 6 files changed, 169 insertions(+), 3 deletions(-) create mode 100644 sound/soc/intel/boards/sof_sdw_rt712_sdca.c
sound/soc/intel/boards/Kconfig +2 -0
@@ -667,6 +667,8 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH select SND_SOC_RT700_SDW select SND_SOC_RT711_SDW select SND_SOC_RT711_SDCA_SDW + select SND_SOC_RT712_SDCA_SDW + select SND_SOC_RT712_SDCA_DMIC_SDW select SND_SOC_RT1308_SDW select SND_SOC_RT1308 select SND_SOC_RT1316_SDW
sound/soc/intel/boards/Makefile +3 -2
@@ -40,8 +40,9 @@ snd-soc-sof-sdw-objs += sof_sdw.o \ sof_sdw_max98373.o sof_sdw_rt_amp.o \ sof_sdw_rt5682.o sof_sdw_rt700.o \ sof_sdw_rt711.o sof_sdw_rt_sdca_jack_common.o \ - sof_sdw_rt715.o sof_sdw_rt715_sdca.o \ - sof_sdw_dmic.o sof_sdw_hdmi.o + sof_sdw_rt712_sdca.o sof_sdw_rt715.o \ + sof_sdw_rt715_sdca.o sof_sdw_dmic.o \ + sof_sdw_hdmi.o obj-$(CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH) += snd-soc-sof_rt5682.o obj-$(CONFIG_SND_SOC_INTEL_SOF_CS42L42_MACH) += snd-soc-sof_cs42l42.o obj-$(CONFIG_SND_SOC_INTEL_SOF_ES8336_MACH) += snd-soc-sof_es8336.o
sound/soc/intel/boards/sof_sdw.c +36 -0
@@ -604,6 +604,42 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, .dai_num = 1, }, + { + .part_id = 0x712, + .version_id = 3, + .dais = { + { + .direction = {true, true}, + .dai_name = "rt712-sdca-aif1", + .dai_type = SOF_SDW_DAI_TYPE_JACK, + .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, + .init = sof_sdw_rt_sdca_jack_init, + .exit = sof_sdw_rt_sdca_jack_exit, + }, + { + .direction = {true, false}, + .dai_name = "rt712-sdca-aif2", + .dai_type = SOF_SDW_DAI_TYPE_AMP, + .dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID}, + .init = sof_sdw_rt712_spk_init, + }, + }, + .dai_num = 2, + }, + { + .part_id = 0x1712, + .version_id = 3, + .dais = { + { + .direction = {false, true}, + .dai_name = "rt712-sdca-dmic-aif1", + .dai_type = SOF_SDW_DAI_TYPE_MIC, + .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, + .init = sof_sdw_rt712_sdca_dmic_init, + }, + }, + .dai_num = 1, + }, { .part_id = 0x1308, .acpi_id = "10EC1308",
sound/soc/intel/boards/sof_sdw_common.h +18 -0
@@ -130,6 +130,24 @@ int sof_sdw_rt_sdca_jack_init(struct snd_soc_card *card, bool playback);int sof_sdw_rt_sdca_jack_exit (struct snd_soc_card *card,struct snd_soc_dai_link *dai_link); +/* RT712-SDCA support */ +int sof_sdw_rt712_sdca_init (struct snd_soc_card *card, +const struct snd_soc_acpi_link_adr *link, +struct snd_soc_dai_link *dai_links, +struct sof_sdw_codec_info *info, +bool playback); +int sof_sdw_rt712_sdca_exit (struct snd_soc_card *card,struct snd_soc_dai_link *dai_link); +int sof_sdw_rt712_spk_init (struct snd_soc_card *card, +const struct snd_soc_acpi_link_adr *link, +struct snd_soc_dai_link *dai_links, +struct sof_sdw_codec_info *info, +bool playback); +int sof_sdw_rt712_sdca_dmic_init (struct snd_soc_card *card, +const struct snd_soc_acpi_link_adr *link, +struct snd_soc_dai_link *dai_links, +struct sof_sdw_codec_info *info, +bool playback); +/* RT700 support */ int sof_sdw_rt700_init(struct snd_soc_card *card, const struct snd_soc_acpi_link_adr *link,
sound/soc/intel/boards/sof_sdw_rt712_sdca.c new file +102 -0
102 lines not on this page · raw message
sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c +8 -1
@@ -49,11 +49,15 @@ static const struct snd_soc_dapm_widget rt_sdca_jack_widgets[] = { };static const struct snd_soc_dapm_route rt711_sdca_map[] = { -/* Headphones */ {"Headphone" ,NULL ,"rt711 HP" }, {"rt711 MIC2" ,NULL ,"Headset Mic" }, }; +static const struct snd_soc_dapm_route rt712_sdca_map[] = { + {"Headphone" ,NULL ,"rt712 HP" }, + {"rt712 MIC2" ,NULL ,"Headset Mic" }, +}; +static const struct snd_kcontrol_new rt_sdca_jack_controls[] = {SOC_DAPM_PIN_SWITCH ("Headphone" ),SOC_DAPM_PIN_SWITCH ("Headset Mic" ),
@@ -102,6 +106,9 @@ static int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd)if (strstr (component->name_prefix,"rt711" )) { ret =snd_soc_dapm_add_routes (&card->dapm, rt711_sdca_map,ARRAY_SIZE (rt711_sdca_map)); + }else if (strstr (component->name_prefix,"rt712" )) { + ret =snd_soc_dapm_add_routes (&card->dapm, rt712_sdca_map, +ARRAY_SIZE (rt712_sdca_map)); }else {dev_err (card->dev,"%s is not supported\n" , component->name_prefix);return -EINVAL ;
Signature · 1 line
2.37.2
PATCH 11/28 ASoC: Intel: soc-acpi-intel-tgl-match: add rt712 ID
In reply to Pierre-Louis BossartFrom: Bard Liao <[email protected]>
Add rt712 ID for TGL.
--- .../intel/common/soc-acpi-intel-tgl-match.c | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+)
sound/soc/intel/common/soc-acpi-intel-tgl-match.c +53 -0
@@ -41,6 +41,21 @@ static const struct snd_soc_acpi_endpoint spk_r_endpoint = { .group_id = 1, }; +static const struct snd_soc_acpi_endpoint rt712_endpoints[] = { + { + .num =0 , + .aggregated =0 , + .group_position =0 , + .group_id =0 , + }, + { + .num =1 , + .aggregated =0 , + .group_position =0 , + .group_id =0 , + }, +}; +static const struct snd_soc_acpi_adr_device rt711_0_adr[] = { { .adr =0x000020025D071100ull ,
@@ -170,6 +185,24 @@ static const struct snd_soc_acpi_adr_device rt1316_1_single_adr[] = { } }; +static const struct snd_soc_acpi_adr_device rt712_0_single_adr[] = { + { + .adr =0x000030025D071201ull , + .num_endpoints =ARRAY_SIZE (rt712_endpoints), + .endpoints = rt712_endpoints, + .name_prefix ="rt712" + } +}; + +static const struct snd_soc_acpi_adr_device rt1712_1_single_adr[] = { + { + .adr =0x000130025D171201ull , + .num_endpoints =1 , + .endpoints = &single_endpoint, + .name_prefix ="rt712-dmic" + } +}; +static const struct snd_soc_acpi_adr_device rt1316_1_group1_adr[] = { { .adr =0x000131025D131601ull ,/* unique ID is set for some reason */
@@ -353,6 +386,20 @@ static const struct snd_soc_acpi_link_adr tgl_3_in_1_sdca_mono[] = { {} }; +static const struct snd_soc_acpi_link_adr tgl_712_only[] = { + { + .mask =BIT (0 ), + .num_adr =ARRAY_SIZE (rt712_0_single_adr), + .adr_d = rt712_0_single_adr, + }, + { + .mask =BIT (1 ), + .num_adr =ARRAY_SIZE (rt1712_1_single_adr), + .adr_d = rt1712_1_single_adr, + }, + {} +}; +static const struct snd_soc_acpi_codecs tgl_max98373_amp = { .num_codecs =1 , .codecs = {"MX98373" }
@@ -435,6 +482,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_sdw_machines[] = { .drv_name = "sof_sdw", .sof_tplg_filename = "sof-tgl-rt715-rt711-rt1308-mono.tplg", }, + { + .link_mask = 0xF, /* 4 active links required */ + .links = tgl_712_only, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-tgl-rt712.tplg", + }, { .link_mask = 0x7, .links = tgl_sdw_rt711_link1_rt1308_link2_rt715_link0,
Signature · 1 line
2.37.2
PATCH 12/28 ASoC: Intel: soc-acpi-intel-mtl-match: add rt712 ID
In reply to Pierre-Louis BossartFrom: Bard Liao <[email protected]>
Add rt712 ID for MTL.
--- .../intel/common/soc-acpi-intel-mtl-match.c | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+)
sound/soc/intel/common/soc-acpi-intel-mtl-match.c +53 -0
@@ -65,6 +65,21 @@ static const struct snd_soc_acpi_endpoint spk_r_endpoint = { .group_id = 1, }; +static const struct snd_soc_acpi_endpoint rt712_endpoints[] = { + { + .num =0 , + .aggregated =0 , + .group_position =0 , + .group_id =0 , + }, + { + .num =1 , + .aggregated =0 , + .group_position =0 , + .group_id =0 , + }, +}; +static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = { { .adr =0x000030025D071101ull ,
@@ -74,6 +89,24 @@ static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = { } }; +static const struct snd_soc_acpi_adr_device rt712_0_single_adr[] = { + { + .adr =0x000030025D071201ull , + .num_endpoints =ARRAY_SIZE (rt712_endpoints), + .endpoints = rt712_endpoints, + .name_prefix ="rt712" + } +}; + +static const struct snd_soc_acpi_adr_device rt1712_3_single_adr[] = { + { + .adr =0x000330025D171201ull , + .num_endpoints =1 , + .endpoints = &single_endpoint, + .name_prefix ="rt712-dmic" + } +}; +static const struct snd_soc_acpi_adr_device mx8373_0_adr[] = { { .adr =0x000023019F837300ull ,
@@ -125,6 +158,20 @@ static const struct snd_soc_acpi_adr_device rt714_1_adr[] = { } }; +static const struct snd_soc_acpi_link_adr mtl_712_only[] = { + { + .mask =BIT (0 ), + .num_adr =ARRAY_SIZE (rt712_0_single_adr), + .adr_d = rt712_0_single_adr, + }, + { + .mask =BIT (3 ), + .num_adr =ARRAY_SIZE (rt1712_3_single_adr), + .adr_d = rt1712_3_single_adr, + }, + {} +}; +static const struct snd_soc_acpi_link_adr rt5682_link2_max98373_link0[] = {/* Expected order: jack -> amp */ {
@@ -194,6 +241,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_sdw_machines[] = { .drv_name = "sof_sdw", .sof_tplg_filename = "sof-mtl-rt715-rt711-rt1308-mono.tplg", }, + { + .link_mask = BIT(3) | BIT(0), + .links = mtl_712_only, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-mtl-rt712-l0-rt1712-l3.tplg", + }, { .link_mask = GENMASK(3, 0), .links = mtl_3_in_1_sdca,
Signature · 1 line
2.37.2
PATCH 13/28 ASoC: Intel: sof_sdw: add rt713 support
In reply to Pierre-Louis BossartFrom: Bard Liao <[email protected]>
rt713 is rt712 but without amp.
--- sound/soc/intel/boards/sof_sdw.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
sound/soc/intel/boards/sof_sdw.c +29 -0
@@ -640,6 +640,35 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, .dai_num = 1, }, + { + .part_id = 0x713, + .version_id = 3, + .dais = { + { + .direction = {true, true}, + .dai_name = "rt712-sdca-aif1", + .dai_type = SOF_SDW_DAI_TYPE_JACK, + .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, + .init = sof_sdw_rt_sdca_jack_init, + .exit = sof_sdw_rt_sdca_jack_exit, + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x1713, + .version_id = 3, + .dais = { + { + .direction = {false, true}, + .dai_name = "rt712-sdca-dmic-aif1", + .dai_type = SOF_SDW_DAI_TYPE_MIC, + .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, + .init = sof_sdw_rt712_sdca_dmic_init, + }, + }, + .dai_num = 1, + }, { .part_id = 0x1308, .acpi_id = "10EC1308",
Signature · 1 line
2.37.2
PATCH 14/28 ASoC: Intel: sof_sdw: increase sdw pin index for each sdw link
In reply to Pierre-Louis BossartFrom: Bard Liao <[email protected]>
To support multiple codecs per SoundWire link, we have to assign multiple CPU DAIs to different DAI links sharing the same physical link. This is not possible with the existing code since we assume that only 'Pin2' is used for playback and 'Pin3' used for capture - additional DAIs cannot be handled.
This patch enables more CPU DAIs to be used, e.g. "SDW0 Pin2", "SDW0 Pin3", and "SDW0 Pin4" for SDW0-Playback-SimpleJack, SDW0-Capture-SimpleJack, and SDW0-Playback-SmartAmp DAI links on physical link #0.
--- sound/soc/intel/boards/sof_sdw.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
sound/soc/intel/boards/sof_sdw.c +10 -3
@@ -22,6 +22,11 @@ MODULE_PARM_DESC(quirk, "Board-specific quirk override");#define INC_ID (BE ,CPU ,LINK ) do { (BE)++; (CPU)++; (LINK)++; } while (0) +#define SDW_MAX_LINKS 4 + +/* To store SDW Pin index for each SoundWire link */ +static unsigned int sdw_pin_index[SDW_MAX_LINKS ]; +static void log_quirks (struct device *dev) {if (SOF_JACK_JDSRC (sof_sdw_quirk))
@@ -1247,10 +1252,10 @@ static int create_sdw_dailink(struct snd_soc_card *card,int cpu_dai_num, cpu_dai_index;unsigned int group_id;int codec_idx =0 ; -int i =0 , j =0 ;int codec_index;int codec_num;int stream; +int i =0 ;int ret;int k;
@@ -1336,7 +1341,7 @@ static int create_sdw_dailink(struct snd_soc_card *card,for (k =0 ; k < cpu_dai_num; k++) { cpu_name =devm_kasprintf (dev,GFP_KERNEL ,"SDW%d Pin%d" , cpu_dai_id[k], - j +SDW_INTEL_BIDIR_PDI_BASE ); + sdw_pin_index[cpu_dai_id[k]]++);if (!cpu_name)return -ENOMEM ;
@@ -1385,7 +1390,6 @@ static int create_sdw_dailink(struct snd_soc_card *card, } *cpu_id += cpu_dai_num; - j++; }return 0 ;
@@ -1538,6 +1542,9 @@ static int sof_card_dai_links_create(struct device *dev,for (i =0 ; i <SDW_MAX_GROUPS ; i++) group_generated[i] = false; +for (i =0 ; i <SDW_MAX_LINKS ; i++) + sdw_pin_index[i] =SDW_INTEL_BIDIR_PDI_BASE ; +for (; adr_link->num_adr; adr_link++) {/* * If there are two or more different devices on the same sdw link, we have to
Signature · 1 line
2.37.2
PATCH 15/28 ASoC: Intel: soc-acpi: add table for RPL Dell SKU 0BDA
In reply to Pierre-Louis BossartThis is a standard configuration we've seen before for TGL.
--- .../intel/common/soc-acpi-intel-rpl-match.c | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+)
sound/soc/intel/common/soc-acpi-intel-rpl-match.c +30 -0
@@ -179,6 +179,30 @@ static const struct snd_soc_acpi_link_adr rpl_sdca_3_in_1[] = { {} }; +static const struct snd_soc_acpi_link_adr rpl_sdw_rt711_link0_rt1316_link12_rt714_link3[] = { + { + .mask =BIT (0 ), + .num_adr =ARRAY_SIZE (rt711_sdca_0_adr), + .adr_d = rt711_sdca_0_adr, + }, + { + .mask =BIT (1 ), + .num_adr =ARRAY_SIZE (rt1316_1_group1_adr), + .adr_d = rt1316_1_group1_adr, + }, + { + .mask =BIT (2 ), + .num_adr =ARRAY_SIZE (rt1316_2_group1_adr), + .adr_d = rt1316_2_group1_adr, + }, + { + .mask =BIT (3 ), + .num_adr =ARRAY_SIZE (rt714_3_adr), + .adr_d = rt714_3_adr, + }, + {} +}; +static const struct snd_soc_acpi_link_adr rpl_sdw_rt711_link2_rt1316_link01_rt714_link3[] = { { .mask =BIT (2 ),
@@ -341,6 +365,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_sdw_machines[] = { .drv_name = "sof_sdw", .sof_tplg_filename = "sof-rpl-rt711-l2-rt1316-l01-rt714-l3.tplg", }, + { + .link_mask = 0xF, /* 4 active links required */ + .links = rpl_sdw_rt711_link0_rt1316_link12_rt714_link3, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-rpl-rt711-l0-rt1316-l12-rt714-l3.tplg", + }, { .link_mask = 0xF, /* 4 active links required */ .links = rpl_sdw_rt711_link0_rt1318_link12_rt714_link3,
Signature · 1 line
2.37.2
PATCH 16/28 ASoC: Intel: sof_sdw: add quick for Dell SKU 0BDA
In reply to Pierre-Louis BossartThe SKU numbering isn't quite consistent with the existing RaptorLake SKUs but the PCI ID is definitively RaptorLake.
--- sound/soc/intel/boards/sof_sdw.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
sound/soc/intel/boards/sof_sdw.c +10 -0
@@ -386,6 +386,16 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { RT711_JD2), },/* RaptorLake devices */ + { + .callback = sof_sdw_quirk_cb, + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc" ), +DMI_EXACT_MATCH (DMI_PRODUCT_SKU ,"0BDA" ) + }, + .driver_data = (void *)(SOF_SDW_TGL_HDMI | +RT711_JD2 | + SOF_SDW_FOUR_SPK), + }, { .callback = sof_sdw_quirk_cb, .matches = {
Signature · 1 line
2.37.2
PATCH 17/28 ASoC: Intel: soc-acpi: add tables for Dell SKU 0B34
In reply to Pierre-Louis BossartYet another permutation of devices.
--- .../intel/common/soc-acpi-intel-adl-match.c | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+)
sound/soc/intel/common/soc-acpi-intel-adl-match.c +29 -0
@@ -133,6 +133,15 @@ static const struct snd_soc_acpi_adr_device rt1316_1_group2_adr[] = { } }; +static const struct snd_soc_acpi_adr_device rt1316_1_single_adr[] = { + { + .adr =0x000130025D131601ull , + .num_endpoints =1 , + .endpoints = &single_endpoint, + .name_prefix ="rt1316-1" + } +}; +static const struct snd_soc_acpi_adr_device rt1316_2_single_adr[] = { { .adr =0x000230025D131601ull ,
@@ -312,6 +321,20 @@ static const struct snd_soc_acpi_link_adr adl_sdw_rt1316_link12_rt714_link0[] = {} }; +static const struct snd_soc_acpi_link_adr adl_sdw_rt1316_link1_rt714_link0[] = { + { + .mask =BIT (1 ), + .num_adr =ARRAY_SIZE (rt1316_1_single_adr), + .adr_d = rt1316_1_single_adr, + }, + { + .mask =BIT (0 ), + .num_adr =ARRAY_SIZE (rt714_0_adr), + .adr_d = rt714_0_adr, + }, + {} +}; +static const struct snd_soc_acpi_link_adr adl_sdw_rt1316_link2_rt714_link3[] = { { .mask =BIT (2 ),
@@ -620,6 +643,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_sdw_machines[] = { .drv_name = "sof_sdw", .sof_tplg_filename = "sof-adl-rt1316-l2-mono-rt714-l3.tplg", }, + { + .link_mask = 0x3, /* rt1316 on link1 & rt714 on link0 */ + .links = adl_sdw_rt1316_link1_rt714_link0, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-adl-rt1316-l1-mono-rt714-l0.tplg", + }, { .link_mask = 0x7, /* rt714 on link0 & two rt1316s on link1 and link2 */ .links = adl_sdw_rt1316_link12_rt714_link0,
Signature · 1 line
2.37.2
PATCH 18/28 ASoC: Intel: sof-sdw: add Dell SKU 0B34
In reply to Pierre-Louis BossartThis device has no 3.5mm jack, only a single amplifier and mic codec.
--- sound/soc/intel/boards/sof_sdw.c | 9 +++++++++ 1 file changed, 9 insertions(+)
sound/soc/intel/boards/sof_sdw.c +9 -0
@@ -376,6 +376,15 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {RT711_JD2 | SOF_SDW_FOUR_SPK), }, + { + .callback = sof_sdw_quirk_cb, + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc" ), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B34"), + }, +/* No Jack */ + .driver_data = (void *)SOF_SDW_TGL_HDMI, + }, { .callback = sof_sdw_quirk_cb, .matches = {
Signature · 1 line
2.37.2
PATCH 19/28 ASoC: Intel: ADL: Enable HDMI-In capture feature support for non-I2S codec boards.
In reply to Pierre-Louis BossartFrom: Balamurugan C <[email protected]>
Adding HDMI-In capture support for the products doesn't have onboard I2S codec.but need to support HDMI-In capture via I2S and audio playback through HDMI/DP monitor.
--- sound/soc/intel/boards/sof_ssp_amp.c | 9 +++++++++ sound/soc/intel/common/soc-acpi-intel-adl-match.c | 5 +++++ 2 files changed, 14 insertions(+)
sound/soc/intel/boards/sof_ssp_amp.c +9 -0
@@ -463,6 +463,15 @@ static const struct platform_device_id board_ids[] = {SOF_SSP_BT_OFFLOAD_PRESENT | SOF_CS35L41_SPEAKER_AMP_PRESENT), }, + { + .name = "adl_lt6911_hdmi_ssp", + .driver_data = (kernel_ulong_t)(SOF_NO_OF_HDMI_CAPTURE_SSP (2 ) | +SOF_HDMI_CAPTURE_1_SSP (0 ) | +SOF_HDMI_CAPTURE_2_SSP (2 ) | +SOF_SSP_HDMI_CAPTURE_PRESENT | +SOF_NO_OF_HDMI_PLAYBACK (3 ) | + SOF_HDMI_PLAYBACK_PRESENT), + }, { } };MODULE_DEVICE_TABLE (platform, board_ids);
sound/soc/intel/common/soc-acpi-intel-adl-match.c +5 -0
@@ -601,6 +601,11 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {SND_SOC_ACPI_TPLG_INTEL_SSP_MSB | SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER, }, + { + .id = "INTC10B0", + .drv_name = "adl_lt6911_hdmi_ssp", + .sof_tplg_filename ="sof-adl-nocodec-hdmi-ssp02.tplg" + }, {}, };EXPORT_SYMBOL_GPL (snd_soc_acpi_intel_adl_machines);
Signature · 1 line
2.37.2
PATCH 20/28 ASoC: Intel: ADL: Moving amp only boards into end of the table.
In reply to Pierre-Louis BossartFrom: Balamurugan C <[email protected]>
Moving amp only boards into end of the match table to have better order and maintenance.
--- sound/soc/intel/common/soc-acpi-intel-adl-match.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
sound/soc/intel/common/soc-acpi-intel-adl-match.c +6 -6
@@ -580,12 +580,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = { .quirk_data = &adl_max98360a_amp, .sof_tplg_filename = "sof-adl-max98360a-cs42l42.tplg", }, -/* place amp-only boards in the end of table */ - { - .id = "CSC3541", - .drv_name = "adl_cs35l41", - .sof_tplg_filename = "sof-adl-cs35l41.tplg", - }, { .comp_ids = &essx_83x6, .drv_name = "adl_es83x6_c1_h02",
@@ -601,6 +595,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = { SND_SOC_ACPI_TPLG_INTEL_SSP_MSB | SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER, }, +/* place amp-only boards in the end of table */ + { + .id = "CSC3541", + .drv_name = "adl_cs35l41", + .sof_tplg_filename = "sof-adl-cs35l41.tplg", + }, { .id = "INTC10B0", .drv_name = "adl_lt6911_hdmi_ssp",
Signature · 1 line
2.37.2
PATCH 21/28 ASoC: Intel: Sof_ssp_amp: Correcting author name.
In reply to Pierre-Louis BossartFrom: Balamurugan C <[email protected]>
Corrected the author name camel case and initial.
--- sound/soc/intel/boards/sof_ssp_amp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/boards/sof_ssp_amp.c +1 -1
@@ -487,7 +487,7 @@ static struct platform_driver sof_ssp_amp_driver = {module_platform_driver (sof_ssp_amp_driver);MODULE_DESCRIPTION ("ASoC Intel(R) SOF Amplifier Machine driver" ); -MODULE_AUTHOR ("balamurugan.c <[email protected]>" ); +MODULE_AUTHOR ("Balamurugan C <[email protected]>" );MODULE_AUTHOR ("Brent Lu <[email protected]>" );MODULE_LICENSE ("GPL" );MODULE_IMPORT_NS (SND_SOC_INTEL_HDA_DSP_COMMON );
Signature · 1 line
2.37.2
PATCH 22/28 ASoC: Intel: Add rpl_rt1019_rt5682 driver
In reply to Pierre-Louis BossartFrom: Terry Cheong <[email protected]>
Boards were using this in older kernels before adl and rpl ids were split. Add this back to maintain support.
--- sound/soc/intel/boards/sof_rt5682.c | 11 +++++++++++ sound/soc/intel/common/soc-acpi-intel-rpl-match.c | 12 ++++++++++++ 2 files changed, 23 insertions(+)
sound/soc/intel/boards/sof_rt5682.c +11 -0
@@ -1119,6 +1119,17 @@ static const struct platform_device_id board_ids[] = {SOF_BT_OFFLOAD_SSP (2 ) | SOF_SSP_BT_OFFLOAD_PRESENT), }, + { + .name = "rpl_rt1019_rt5682", + .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | +SOF_RT5682_SSP_CODEC (0 ) | +SOF_SPEAKER_AMP_PRESENT | +SOF_RT1019_SPEAKER_AMP_PRESENT | +SOF_RT5682_SSP_AMP (1 ) | +SOF_RT5682_NUM_HDMIDEV (4 ) | +SOF_BT_OFFLOAD_SSP (2 ) | + SOF_SSP_BT_OFFLOAD_PRESENT), + }, { .name = "mtl_mx98357_rt5682", .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN |
sound/soc/intel/common/soc-acpi-intel-rpl-match.c +12 -0
@@ -332,6 +332,11 @@ static const struct snd_soc_acpi_codecs rpl_max98373_amp = { .codecs = {"MX98373"} }; +static const struct snd_soc_acpi_codecs rpl_rt1019p_amp = { + .num_codecs =1 , + .codecs = {"RTL1019" } +}; +struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_machines[] = { { .comp_ids = &rpl_rt5682_hp,
@@ -347,6 +352,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_machines[] = { .quirk_data = &rpl_max98373_amp, .sof_tplg_filename = "sof-rpl-max98373-nau8825.tplg", }, + { + .comp_ids = &rpl_rt5682_hp, + .drv_name = "rpl_rt1019_rt5682", + .machine_quirk = snd_soc_acpi_codec_list, + .quirk_data = &rpl_rt1019p_amp, + .sof_tplg_filename = "sof-rpl-rt1019-rt5682.tplg", + }, {}, };EXPORT_SYMBOL_GPL (snd_soc_acpi_intel_rpl_machines);
Signature · 1 line
2.37.2
PATCH 23/28 ASoC: Intel: sof_sdw: Add helper function for cs42l42 codec
In reply to Pierre-Louis BossartFrom: Uday M Bhat <[email protected]>
Helper functions added to support CS42l42 soundwire codec. Build configuration is updated to include this codec.
--- sound/soc/intel/boards/Kconfig | 1 + sound/soc/intel/boards/Makefile | 1 + sound/soc/intel/boards/sof_sdw.c | 13 +++ sound/soc/intel/boards/sof_sdw_common.h | 7 ++ sound/soc/intel/boards/sof_sdw_cs42l42.c | 131 +++++++++++++++++++++++ 5 files changed, 153 insertions(+) create mode 100644 sound/soc/intel/boards/sof_sdw_cs42l42.c
sound/soc/intel/boards/Kconfig +1 -0
@@ -676,6 +676,7 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH select SND_SOC_RT715_SDW select SND_SOC_RT715_SDCA_SDW select SND_SOC_RT5682_SDW + select SND_SOC_CS42L42_SDW select SND_SOC_DMIC select SND_SOC_INTEL_HDA_DSP_COMMON select SND_SOC_INTEL_SOF_MAXIM_COMMON
sound/soc/intel/boards/Makefile +1 -0
@@ -42,6 +42,7 @@ snd-soc-sof-sdw-objs += sof_sdw.o \ sof_sdw_rt711.o sof_sdw_rt_sdca_jack_common.o \ sof_sdw_rt712_sdca.o sof_sdw_rt715.o \ sof_sdw_rt715_sdca.o sof_sdw_dmic.o \ + sof_sdw_cs42l42.o \ sof_sdw_hdmi.o obj-$(CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH) += snd-soc-sof_rt5682.o obj-$(CONFIG_SND_SOC_INTEL_SOF_CS42L42_MACH) += snd-soc-sof_cs42l42.o
sound/soc/intel/boards/sof_sdw.c +13 -0
@@ -823,6 +823,19 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, .dai_num = 1, }, + { + .part_id = 0x4242, + .dais = { + { + .direction = {true, true}, + .dai_name = "cs42l42-sdw", + .dai_type = SOF_SDW_DAI_TYPE_JACK, + .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, + .init = sof_sdw_cs42l42_init, + }, + }, + .dai_num = 1, + }, { .part_id = 0xaaaa, /* generic codec mockup */ .version_id = 0,
sound/soc/intel/boards/sof_sdw_common.h +7 -0
@@ -196,4 +196,11 @@ int sof_sdw_rt5682_init(struct snd_soc_card *card,struct sof_sdw_codec_info *info, bool playback); +/* CS42L42 support */ +int sof_sdw_cs42l42_init (struct snd_soc_card *card, +const struct snd_soc_acpi_link_adr *link, +struct snd_soc_dai_link *dai_links, +struct sof_sdw_codec_info *info, +bool playback); +#endif
sound/soc/intel/boards/sof_sdw_cs42l42.c new file +131 -0
131 lines not on this page · raw message
Signature · 1 line
2.37.2
PATCH 24/28 ASoC: Intel: sof_sdw: Rename sof_sdw_max98373.c file to sof_sdw_maxim.c
In reply to Pierre-Louis BossartFrom: Uday M Bhat <[email protected]>
This is needed to use the common implementation for other maxim soundwire codecs
---
sound/soc/intel/boards/Makefile | 2 +-
sound/soc/intel/boards/{sof_sdw_max98373.c => sof_sdw_maxim.c} | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename sound/soc/intel/boards/{sof_sdw_max98373.c => sof_sdw_maxim.c} (100%)sound/soc/intel/boards/Makefile +1 -1
@@ -37,7 +37,7 @@ snd-soc-sof_da7219_max98373-objs := sof_da7219_max98373.o snd-soc-ehl-rt5660-objs := ehl_rt5660.o snd-soc-sof-ssp-amp-objs := sof_ssp_amp.o snd-soc-sof-sdw-objs += sof_sdw.o \ - sof_sdw_max98373.o sof_sdw_rt_amp.o \ + sof_sdw_maxim.o sof_sdw_rt_amp.o \ sof_sdw_rt5682.o sof_sdw_rt700.o \ sof_sdw_rt711.o sof_sdw_rt_sdca_jack_common.o \ sof_sdw_rt712_sdca.o sof_sdw_rt715.o \
sound/soc/intel/boards/sof_sdw_maxim.c renamed from sound/soc/intel/boards/sof_sdw_max98373.c +0 -0
Signature · 1 line
2.37.2
PATCH 25/28 ASoC: Intel: sof_sdw: Modify maxim helper functions and structure names
In reply to Pierre-Louis BossartFrom: Uday M Bhat <[email protected]>
Init function and structure names are modified to use maxim instead of max98373. Card components and speaker names are updated based on part id.
--- sound/soc/intel/boards/sof_sdw.c | 2 +- sound/soc/intel/boards/sof_sdw_common.h | 12 +++--- sound/soc/intel/boards/sof_sdw_maxim.c | 52 +++++++++++++++---------- 3 files changed, 39 insertions(+), 27 deletions(-)
sound/soc/intel/boards/sof_sdw.c +1 -1
@@ -805,7 +805,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_name = "max98373-aif1", .dai_type = SOF_SDW_DAI_TYPE_AMP, .dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID}, - .init = sof_sdw_mx8373_init, + .init = sof_sdw_maxim_init, }, }, .dai_num = 1,
sound/soc/intel/boards/sof_sdw_common.h +6 -6
@@ -182,12 +182,12 @@ int sof_sdw_rt715_sdca_init(struct snd_soc_card *card,struct sof_sdw_codec_info *info, bool playback); -/* MAX98373 support */ -int sof_sdw_mx8373_init (struct snd_soc_card *card, -const struct snd_soc_acpi_link_adr *link, -struct snd_soc_dai_link *dai_links, -struct sof_sdw_codec_info *info, -bool playback); +/* MAXIM codec support */ +int sof_sdw_maxim_init (struct snd_soc_card *card, +const struct snd_soc_acpi_link_adr *link, +struct snd_soc_dai_link *dai_links, +struct sof_sdw_codec_info *info, +bool playback);/* RT5682 support */ int sof_sdw_rt5682_init(struct snd_soc_card *card,
sound/soc/intel/boards/sof_sdw_maxim.c +32 -20
92 lines not on this page · raw message
Signature · 1 line
2.37.2
PATCH 26/28 ASoC: Intel: sof_sdw: Add support for MAX98363 codec
In reply to Pierre-Louis BossartFrom: Uday M Bhat <[email protected]>
Add support for MAX98363 soundwire codec. Update build configuration to include this codec.
--- sound/soc/intel/boards/Kconfig | 1 + sound/soc/intel/boards/sof_sdw.c | 13 +++++++++++++ sound/soc/intel/boards/sof_sdw_maxim.c | 6 ++++++ 3 files changed, 20 insertions(+)
sound/soc/intel/boards/Kconfig +1 -0
@@ -662,6 +662,7 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH depends on MFD_INTEL_LPSS || COMPILE_TEST depends on SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES || COMPILE_TEST depends on SOUNDWIRE + select SND_SOC_MAX98363 select SND_SOC_MAX98373_I2C select SND_SOC_MAX98373_SDW select SND_SOC_RT700_SDW
sound/soc/intel/boards/sof_sdw.c +13 -0
@@ -810,6 +810,19 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, .dai_num = 1, }, + { + .part_id = 0x8363, + .dais = { + { + .direction = {true, false}, + .dai_name = "max98363-aif1", + .dai_type = SOF_SDW_DAI_TYPE_AMP, + .dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID}, + .init = sof_sdw_maxim_init, + }, + }, + .dai_num = 1, + }, { .part_id = 0x5682, .dais = {
sound/soc/intel/boards/sof_sdw_maxim.c +6 -0
@@ -14,6 +14,7 @@#include "sof_maxim_common.h" static int maxim_part_id; +#define SOF_SDW_PART_ID_MAX98363 0x8363#define SOF_SDW_PART_ID_MAX98373 0x8373static const struct snd_soc_dapm_widget maxim_widgets[] = {
@@ -148,6 +149,11 @@ int sof_sdw_maxim_init(struct snd_soc_card *card, maxim_part_id = info->part_id;switch (maxim_part_id) { +case SOF_SDW_PART_ID_MAX98363 : +/* Default ops are set in function init_dai_link. +* called as part of function create_sdw_dailink +*/ +break ;case SOF_SDW_PART_ID_MAX98373 : info->codec_card_late_probe = mx8373_sdw_late_probe; dai_links->ops = &max_98373_sdw_ops;
Signature · 1 line
2.37.2
PATCH 27/28 ASoC: Intel: sof_sdw: Add support for Rex soundwire
In reply to Pierre-Louis BossartFrom: Uday M Bhat <[email protected]>
Add rex entry in the soundwire quirk table
--- sound/soc/intel/boards/sof_sdw.c | 8 ++++++++ 1 file changed, 8 insertions(+)
sound/soc/intel/boards/sof_sdw.c +8 -0
@@ -461,6 +461,14 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { }, .driver_data = (void *)(RT711_JD2_100K), }, + { + .callback = sof_sdw_quirk_cb, + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Google" ), + DMI_MATCH(DMI_PRODUCT_NAME, "Rex"), + }, + .driver_data = (void *)(SOF_SDW_PCH_DMIC), + }, /* LunarLake devices */ { .callback = sof_sdw_quirk_cb,
Signature · 1 line
2.37.2
PATCH 28/28 ASoC: Intel: soc-acpi: add Rex CS42l42 and MAX98363 SoundWire entries
In reply to Pierre-Louis BossartFrom: Uday M Bhat <[email protected]>
Add support to the following daughter card for rex:
SDW0: CS42l42 Headset
SDW2: MX98363 Speaker
--- .../intel/common/soc-acpi-intel-mtl-match.c | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+)
sound/soc/intel/common/soc-acpi-intel-mtl-match.c +45 -0
@@ -220,6 +220,45 @@ static const struct snd_soc_acpi_link_adr mtl_3_in_1_sdca[] = { {} }; +static const struct snd_soc_acpi_adr_device mx8363_2_adr[] = { + { + .adr =0x000230019F836300ull , + .num_endpoints =1 , + .endpoints = &spk_l_endpoint, + .name_prefix ="Left" + }, + { + .adr =0x000231019F836300ull , + .num_endpoints =1 , + .endpoints = &spk_r_endpoint, + .name_prefix ="Right" + } +}; + +static const struct snd_soc_acpi_adr_device cs42l42_0_adr[] = { + { + .adr =0x00001001FA424200ull , + .num_endpoints =1 , + .endpoints = &single_endpoint, + .name_prefix ="cs42l42" + } +}; + +static const struct snd_soc_acpi_link_adr cs42l42_link0_max98363_link2[] = { +/* Expected order: jack -> amp */ + { + .mask =BIT (0 ), + .num_adr =ARRAY_SIZE (cs42l42_0_adr), + .adr_d = cs42l42_0_adr, + }, + { + .mask =BIT (2 ), + .num_adr =ARRAY_SIZE (mx8363_2_adr), + .adr_d = mx8363_2_adr, + }, + {} +}; +/* this table is used when there is no I2S codec present */ struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_sdw_machines[] = {/* mockup tests need to be first */
@@ -265,6 +304,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_sdw_machines[] = { .drv_name = "sof_sdw", .sof_tplg_filename = "sof-mtl-sdw-rt5682-l2-max98373-l0.tplg", }, + { + .link_mask = BIT(0) | BIT(2), + .links = cs42l42_link0_max98363_link2, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-mtl-sdw-cs42l42-l0-max98363-l2.tplg", + }, {}, };EXPORT_SYMBOL_GPL (snd_soc_acpi_intel_mtl_sdw_machines);
Signature · 1 line
2.37.2
Mark Brown
maintainerQuoted 10 lines · Pierre-Louis Bossart
An unusually large set of patches to deal with new SoundWire-based platforms.
The bulk of the patches addresses support for MTL using RT712, RT713, MAX98363, CS42L42 jack codec and amplifiers. The
sof_sdwmachine driver had to be updated to remove limitations on number of codecs per links, dai types, dai naming, etc. We also moved parts of the Realtek and Maxim support in common code to avoid duplication.[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[01/28] ASoC: Intel: sof_sdw: add missing exit callback
commit: ba032909bb2d15fd3014c829fdc7a2a74a8b88ad
[02/28] ASoC: Intel: sof_sdw: add dai info
commit: 07140abbbf9e3dc412a34ed4a60c4b0d58fbe192
[03/28] ASoC: Intel: sof_sdw: use predefine dailink id
commit: b274586533f516b35519f409a4d089341a9c2690
[04/28] ASoC: Intel: sof_sdw: add codec_info pointer
commit: cededa5a6486821402c5e9bb7fd3cfd71d7999bc
[05/28] ASoC: Intel: sdw_sof: append dai_type and remove codec_type
commit: 5714aabdf9713297947615fd2325719a6f9db316
[06/28] ASoC: Intel: sof_sdw: add multi dailink support for a codec
commit: d3fc5c4da599482a3ada60b26b22fa7de9c6da42
[07/28] ASoC: Intel: sof_sdw_rt_sdca_jack_common: test SOF_JACK_JDSRC in _exit
commit: 526a1876fc48e2d0c0ea8ad63b58bdb2cc13047f
[08/28] ASoC: Intel: sof_sdw: rename SOF_RT711_JDSRC to SOF_JACK_JDSRC
commit: 752d4de4c614d639fdb636e4a1ce102328696453
[09/28] ASoC: Intel: sof_sdw: make rt711_sdca be generic
commit: 43f8012c3a6e2b33003ba7ec8c23fbb5bed2ca30
[10/28] ASoC: Intel: sof_sdw: add rt712 support
commit: 5360c67046385f90406ec17e367ba9aeb42d5459
[11/28] ASoC: Intel: soc-acpi-intel-tgl-match: add rt712 ID
commit: a2f4d70921f218db768cf3e879fe87dea0a354a5
[12/28] ASoC: Intel: soc-acpi-intel-mtl-match: add rt712 ID
commit: 9efa6f46bc8b606df4226630c668af0e9d25ba7f
[13/28] ASoC: Intel: sof_sdw: add rt713 support
commit: fbaaf80d8cf6f5da4397108efceca99abfaebbc8
[14/28] ASoC: Intel: sof_sdw: increase sdw pin index for each sdw link
commit: 35d28ccd185cfbf5748d4d25dd013e41286a4bf2
[15/28] ASoC: Intel: soc-acpi: add table for RPL Dell SKU 0BDA
commit: eeb9f9f7e59d75c97909c3bd51574191d205765a
[16/28] ASoC: Intel: sof_sdw: add quick for Dell SKU 0BDA
commit: 3daf02819ac3fd8d7605804a00213cf123ac880d
[17/28] ASoC: Intel: soc-acpi: add tables for Dell SKU 0B34
commit: b62a1a839b48f55046727089c3ba7a8ebbf97f0e
[18/28] ASoC: Intel: sof-sdw: add Dell SKU 0B34
commit: 332f618756e61bee564e0919f97faef788c6a6e6
[19/28] ASoC: Intel: ADL: Enable HDMI-In capture feature support for non-I2S codec boards.
commit: 5376d37b2a8bf7382cd627504e27c5e42cdc820f
[20/28] ASoC: Intel: ADL: Moving amp only boards into end of the table.
commit: c3a3c06e05c244374fb773c80e4055a5e8aa45f7
[21/28] ASoC: Intel: Sof_ssp_amp: Correcting author name.
commit: 1529d344dd49059c114c200dbe1c1a55d45ea120
[22/28] ASoC: Intel: Add rpl_rt1019_rt5682 driver
commit: 5dc51e50457a1ddafad47fcd668910a5bd91106f
[23/28] ASoC: Intel: sof_sdw: Add helper function for cs42l42 codec
commit: 43cdea08a4acc8f61daf0050f713314f0bfbedf7
[24/28] ASoC: Intel: sof_sdw: Rename sof_sdw_max98373.c file to sof_sdw_maxim.c
commit: 85565f8047668b6727127df539f7a6ecc0f9b9c0
[25/28] ASoC: Intel: sof_sdw: Modify maxim helper functions and structure names
commit: fcb3f0fb4c7255b7617d3d0e98414ab36ddcbee3
[26/28] ASoC: Intel: sof_sdw: Add support for MAX98363 codec
commit: dea4138d7794f3041f6969bff637b7e5ed89ae90
[27/28] ASoC: Intel: sof_sdw: Add support for Rex soundwire
commit: 164e5dc17525181c05563f0a06796f1a363801d5
[28/28] ASoC: Intel: soc-acpi: add Rex CS42l42 and MAX98363 SoundWire entries
commit: a0503817c0be5ea15164f64e06350e3363466021All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark