Skip to content

Commit 35deb2f

Browse files
naveen-manoharranj063
authored andcommitted
ASoC: Intel: soc-acpi-intel-ptl-match: Sort ACPI link/machine tables
Check subset of link mask when matching the machine driver, rule is superset match should be ordered before subset matches. Priority: mockup > most links > most bit link-mask > alphabetical Reorder acpi_link_adr & sdw_machine tables per defined criteria: 1.Mock Test 1st 2.Most links 1st 3.link_mask with more bit first 4.link_number number order 5.Alphabetical order Signed-off-by: Naveen Manohar <naveen.m@intel.com>
1 parent b64c933 commit 35deb2f

1 file changed

Lines changed: 44 additions & 41 deletions

File tree

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

Lines changed: 44 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
*
55
* Copyright (c) 2024, Intel Corporation.
66
*
7+
* Order of entries in snd_soc_acpi_intel_ptl_sdw_machines[] matters.
8+
* Check subset of link mask when matching the machine driver, rule is
9+
* superset match should be ordered before subset matches.
710
*/
811

912
#include <sound/soc-acpi.h>
@@ -539,7 +542,7 @@ static const struct snd_soc_acpi_link_adr ptl_sdw_rt712_vb_l3_rt1320_l2[] = {
539542

540543
/* this table is used when there is no I2S codec present */
541544
struct snd_soc_acpi_mach snd_soc_acpi_intel_ptl_sdw_machines[] = {
542-
/* mockup tests need to be first */
545+
/* Order Priority: mockup > most links > most bit link-mask > alphabetical */
543546
{
544547
.link_mask = GENMASK(3, 0),
545548
.links = sdw_mockup_headset_2amps_mic,
@@ -558,89 +561,89 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_ptl_sdw_machines[] = {
558561
.drv_name = "sof_sdw",
559562
.sof_tplg_filename = "sof-ptl-rt715-rt711-rt1308-mono.tplg",
560563
},
561-
{
562-
.link_mask = BIT(1) | BIT(2) | BIT(3),
563-
.links = ptl_cs42l43_l2_cs35l56x6_l13,
564-
.drv_name = "sof_sdw",
565-
.sof_tplg_filename = "sof-ptl-cs42l43-l2-cs35l56x6-l13.tplg",
566-
},
567564
{
568565
.link_mask = BIT(0),
569566
.links = sdw_mockup_multi_func,
570567
.drv_name = "sof_sdw",
571568
.sof_tplg_filename = "sof-ptl-rt722.tplg", /* Reuse the existing tplg file */
572569
},
573570
{
574-
.link_mask = BIT(0),
575-
.links = ptl_rvp,
571+
.link_mask = BIT(1) | BIT(2) | BIT(3),
572+
.links = ptl_sdw_rt713_vb_l2_rt1320_l13,
576573
.drv_name = "sof_sdw",
577-
.sof_tplg_filename = "sof-ptl-rt711.tplg",
574+
.machine_check = snd_soc_acpi_intel_sdca_is_device_rt712_vb,
575+
.sof_tplg_filename = "sof-ptl-rt713-l2-rt1320-l13.tplg",
576+
.get_function_tplg_files = sof_sdw_get_tplg_files,
578577
},
579578
{
580-
.link_mask = BIT(3),
581-
.links = ptl_cs42l43_l3,
579+
.link_mask = BIT(1) | BIT(2) | BIT(3),
580+
.links = ptl_sdw_rt713_vb_l3_rt1320_l12,
582581
.drv_name = "sof_sdw",
583-
.sof_tplg_filename = "sof-ptl-cs42l43-l3.tplg",
582+
.machine_check = snd_soc_acpi_intel_sdca_is_device_rt712_vb,
583+
.sof_tplg_filename = "sof-ptl-rt713-l3-rt1320-l12.tplg",
584584
.get_function_tplg_files = sof_sdw_get_tplg_files,
585+
},
586+
{
587+
.link_mask = BIT(1) | BIT(2) | BIT(3),
588+
.links = ptl_cs42l43_l2_cs35l56x6_l13,
589+
.drv_name = "sof_sdw",
590+
.sof_tplg_filename = "sof-ptl-cs42l43-l2-cs35l56x6-l13.tplg",
585591
},
586592
{
587-
.link_mask = BIT(3),
588-
.links = ptl_rt721_l3,
593+
.link_mask = BIT(1) | BIT(2),
594+
.links = ptl_sdw_rt712_vb_l2_rt1320_l1,
589595
.drv_name = "sof_sdw",
590-
.sof_tplg_filename = "sof-ptl-rt721.tplg",
596+
.machine_check = snd_soc_acpi_intel_sdca_is_device_rt712_vb,
597+
.sof_tplg_filename = "sof-ptl-rt712-l2-rt1320-l1.tplg",
591598
.get_function_tplg_files = sof_sdw_get_tplg_files,
592599
},
593600
{
594-
.link_mask = BIT(0),
595-
.links = ptl_rt722_only,
601+
.link_mask = BIT(2) | BIT(3),
602+
.links = ptl_sdw_rt712_vb_l3_rt1320_l2,
596603
.drv_name = "sof_sdw",
597-
.sof_tplg_filename = "sof-ptl-rt722.tplg",
604+
.machine_check = snd_soc_acpi_intel_sdca_is_device_rt712_vb,
605+
.sof_tplg_filename = "sof-ptl-rt712-l3-rt1320-l2.tplg",
598606
.get_function_tplg_files = sof_sdw_get_tplg_files,
599607
},
600608
{
601-
.link_mask = BIT(1),
602-
.links = ptl_rt722_l1,
609+
.link_mask = BIT(0),
610+
.links = ptl_rvp,
603611
.drv_name = "sof_sdw",
604-
.sof_tplg_filename = "sof-ptl-rt722.tplg",
605-
.get_function_tplg_files = sof_sdw_get_tplg_files,
612+
.sof_tplg_filename = "sof-ptl-rt711.tplg",
606613
},
607614
{
608-
.link_mask = BIT(3),
609-
.links = ptl_rt722_l3,
615+
.link_mask = BIT(0),
616+
.links = ptl_rt722_only,
610617
.drv_name = "sof_sdw",
611618
.sof_tplg_filename = "sof-ptl-rt722.tplg",
612619
.get_function_tplg_files = sof_sdw_get_tplg_files,
613620
},
614621
{
615-
.link_mask = BIT(1) | BIT(2),
616-
.links = ptl_sdw_rt712_vb_l2_rt1320_l1,
622+
.link_mask = BIT(1),
623+
.links = ptl_rt722_l1,
617624
.drv_name = "sof_sdw",
618-
.machine_check = snd_soc_acpi_intel_sdca_is_device_rt712_vb,
619-
.sof_tplg_filename = "sof-ptl-rt712-l2-rt1320-l1.tplg",
625+
.sof_tplg_filename = "sof-ptl-rt722.tplg",
620626
.get_function_tplg_files = sof_sdw_get_tplg_files,
621627
},
622628
{
623-
.link_mask = BIT(2) | BIT(3),
624-
.links = ptl_sdw_rt712_vb_l3_rt1320_l2,
629+
.link_mask = BIT(3),
630+
.links = ptl_cs42l43_l3,
625631
.drv_name = "sof_sdw",
626-
.machine_check = snd_soc_acpi_intel_sdca_is_device_rt712_vb,
627-
.sof_tplg_filename = "sof-ptl-rt712-l3-rt1320-l2.tplg",
632+
.sof_tplg_filename = "sof-ptl-cs42l43-l3.tplg",
628633
.get_function_tplg_files = sof_sdw_get_tplg_files,
629634
},
630635
{
631-
.link_mask = BIT(1) | BIT(2) | BIT(3),
632-
.links = ptl_sdw_rt713_vb_l2_rt1320_l13,
636+
.link_mask = BIT(3),
637+
.links = ptl_rt721_l3,
633638
.drv_name = "sof_sdw",
634-
.machine_check = snd_soc_acpi_intel_sdca_is_device_rt712_vb,
635-
.sof_tplg_filename = "sof-ptl-rt713-l2-rt1320-l13.tplg",
639+
.sof_tplg_filename = "sof-ptl-rt721.tplg",
636640
.get_function_tplg_files = sof_sdw_get_tplg_files,
637641
},
638642
{
639-
.link_mask = BIT(1) | BIT(2) | BIT(3),
640-
.links = ptl_sdw_rt713_vb_l3_rt1320_l12,
643+
.link_mask = BIT(3),
644+
.links = ptl_rt722_l3,
641645
.drv_name = "sof_sdw",
642-
.machine_check = snd_soc_acpi_intel_sdca_is_device_rt712_vb,
643-
.sof_tplg_filename = "sof-ptl-rt713-l3-rt1320-l12.tplg",
646+
.sof_tplg_filename = "sof-ptl-rt722.tplg",
644647
.get_function_tplg_files = sof_sdw_get_tplg_files,
645648
},
646649
{},

0 commit comments

Comments
 (0)