Skip to content

Commit b101a00

Browse files
rfvirgilranj063
authored andcommitted
ASoC: cs35l56: Split SoundWire DAI into separate playback and capture
This patch splits the SoundWire capture DP into a separate DAI so that it can be independently routed and/or aggregated. It also makes corresponding changes to the SOF SoundWire machine driver. The playback and capture over SoundWire are separate DPs so don't have to route to the same place. They could also be aggregated differently - for example the playback DP could be aggregated with a playback-only DAI on a codec. No production device currently uses the capture path and their topologies do not connect it. So there is no need to change the machine driver match table entries for these. They will simply drop the unused capture DAI. There is one hookup used for a non-production development board that was added by commit 05fe628 ("ASoC: Intel: soc-acpi-intel-mtl-match: add acpi match table for cdb35l56-eight-c") This is the only hookup using a topology that connects the SoundWire DP for capture, so this hookup has been changed to include an aggregated endpoint for the capture DAI. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
1 parent cd3d030 commit b101a00

3 files changed

Lines changed: 84 additions & 12 deletions

File tree

sound/soc/codecs/cs35l56.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,12 @@ static struct snd_soc_dai_driver cs35l56_dai[] = {
646646
.rates = CS35L56_RATES,
647647
.formats = CS35L56_RX_FORMATS,
648648
},
649+
.symmetric_rate = 1,
650+
.ops = &cs35l56_sdw_dai_ops,
651+
},
652+
{
653+
.name = "cs35l56-sdw1c",
654+
.id = 2,
649655
.capture = {
650656
.stream_name = "SDW1 Capture",
651657
.channels_min = 1,
@@ -655,7 +661,7 @@ static struct snd_soc_dai_driver cs35l56_dai[] = {
655661
},
656662
.symmetric_rate = 1,
657663
.ops = &cs35l56_sdw_dai_ops,
658-
}
664+
},
659665
};
660666

661667
static int cs35l56_write_cal(struct cs35l56_private *cs35l56)

sound/soc/intel/common/soc-acpi-intel-mtl-match.c

Lines changed: 68 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,66 @@ static const struct snd_soc_acpi_adr_device cs42l43_0_adr[] = {
441441
}
442442
};
443443

444+
static const struct snd_soc_acpi_endpoint cs35l56_l_fb_endpoints[] = {
445+
{ /* Speaker Playback Endpoint */
446+
.num = 0,
447+
.aggregated = 1,
448+
.group_position = 0,
449+
.group_id = 1,
450+
},
451+
{ /* Feedback Capture Endpoint */
452+
.num = 1,
453+
.aggregated = 1,
454+
.group_position = 0,
455+
.group_id = 2,
456+
},
457+
};
458+
459+
static const struct snd_soc_acpi_endpoint cs35l56_r_fb_endpoints[] = {
460+
{ /* Speaker Playback Endpoint */
461+
.num = 0,
462+
.aggregated = 1,
463+
.group_position = 1,
464+
.group_id = 1,
465+
},
466+
{ /* Feedback Capture Endpoint */
467+
.num = 1,
468+
.aggregated = 1,
469+
.group_position = 1,
470+
.group_id = 2,
471+
},
472+
};
473+
474+
static const struct snd_soc_acpi_endpoint cs35l56_2_fb_endpoints[] = {
475+
{ /* Speaker Playback Endpoint */
476+
.num = 0,
477+
.aggregated = 1,
478+
.group_position = 2,
479+
.group_id = 1,
480+
},
481+
{ /* Feedback Capture Endpoint */
482+
.num = 1,
483+
.aggregated = 1,
484+
.group_position = 2,
485+
.group_id = 2,
486+
},
487+
};
488+
489+
static const struct snd_soc_acpi_endpoint cs35l56_3_fb_endpoints[] = {
490+
{ /* Speaker Playback Endpoint */
491+
.num = 0,
492+
.aggregated = 1,
493+
.group_position = 3,
494+
.group_id = 1,
495+
},
496+
{ /* Feedback Capture Endpoint */
497+
.num = 1,
498+
.aggregated = 1,
499+
.group_position = 3,
500+
.group_id = 2,
501+
},
502+
};
503+
444504
static const struct snd_soc_acpi_adr_device cs35l56_1_adr[] = {
445505
{
446506
.adr = 0x00013701FA355601ull,
@@ -474,14 +534,14 @@ static const struct snd_soc_acpi_adr_device cs35l56_2_adr[] = {
474534
static const struct snd_soc_acpi_adr_device cs35l56_2_r_adr[] = {
475535
{
476536
.adr = 0x00023201FA355601ull,
477-
.num_endpoints = 1,
478-
.endpoints = &spk_r_endpoint,
537+
.num_endpoints = ARRAY_SIZE(cs35l56_r_fb_endpoints),
538+
.endpoints = cs35l56_r_fb_endpoints,
479539
.name_prefix = "AMP3"
480540
},
481541
{
482542
.adr = 0x00023301FA355601ull,
483-
.num_endpoints = 1,
484-
.endpoints = &spk_3_endpoint,
543+
.num_endpoints = ARRAY_SIZE(cs35l56_3_fb_endpoints),
544+
.endpoints = cs35l56_3_fb_endpoints,
485545
.name_prefix = "AMP4"
486546
}
487547

@@ -490,14 +550,14 @@ static const struct snd_soc_acpi_adr_device cs35l56_2_r_adr[] = {
490550
static const struct snd_soc_acpi_adr_device cs35l56_3_l_adr[] = {
491551
{
492552
.adr = 0x00033001fa355601ull,
493-
.num_endpoints = 1,
494-
.endpoints = &spk_l_endpoint,
553+
.num_endpoints = ARRAY_SIZE(cs35l56_l_fb_endpoints),
554+
.endpoints = cs35l56_l_fb_endpoints,
495555
.name_prefix = "AMP1"
496556
},
497557
{
498558
.adr = 0x00033101fa355601ull,
499-
.num_endpoints = 1,
500-
.endpoints = &spk_2_endpoint,
559+
.num_endpoints = ARRAY_SIZE(cs35l56_2_fb_endpoints),
560+
.endpoints = cs35l56_2_fb_endpoints,
501561
.name_prefix = "AMP2"
502562
}
503563
};

sound/soc/sdw_utils/soc_sdw_utils.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,19 +488,25 @@ struct asoc_sdw_codec_info codec_info_list[] = {
488488
.part_id = 0x3556,
489489
.dais = {
490490
{
491-
.direction = {true, true},
491+
.direction = {true, false},
492492
.dai_name = "cs35l56-sdw1",
493493
.dai_type = SOC_SDW_DAI_TYPE_AMP,
494-
.dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID},
494+
.dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID},
495495
.init = asoc_sdw_cs_amp_init,
496496
.rtd_init = asoc_sdw_cs_spk_rtd_init,
497497
.controls = generic_spk_controls,
498498
.num_controls = ARRAY_SIZE(generic_spk_controls),
499499
.widgets = generic_spk_widgets,
500500
.num_widgets = ARRAY_SIZE(generic_spk_widgets),
501501
},
502+
{
503+
.direction = {false, true},
504+
.dai_name = "cs35l56-sdw1c",
505+
.dai_type = SOC_SDW_DAI_TYPE_AMP,
506+
.dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_AMP_IN_DAI_ID},
507+
},
502508
},
503-
.dai_num = 1,
509+
.dai_num = 2,
504510
},
505511
{
506512
.part_id = 0x4242,

0 commit comments

Comments
 (0)