Path: blob/master/sound/soc/intel/common/soc-acpi-intel-arl-match.c
53302 views
// SPDX-License-Identifier: GPL-2.0-only1/*2* soc-apci-intel-arl-match.c - tables and support for ARL ACPI enumeration.3*4* Copyright (c) 2023 Intel Corporation.5*/67#include <sound/soc-acpi.h>8#include <sound/soc-acpi-intel-match.h>9#include <sound/soc-acpi-intel-ssp-common.h>10#include "sof-function-topology-lib.h"1112static const struct snd_soc_acpi_endpoint single_endpoint = {13.num = 0,14.aggregated = 0,15.group_position = 0,16.group_id = 0,17};1819static const struct snd_soc_acpi_endpoint spk_l_endpoint = {20.num = 0,21.aggregated = 1,22.group_position = 0,23.group_id = 1,24};2526static const struct snd_soc_acpi_endpoint spk_r_endpoint = {27.num = 0,28.aggregated = 1,29.group_position = 1,30.group_id = 1,31};3233static const struct snd_soc_acpi_endpoint spk_2_endpoint = {34.num = 0,35.aggregated = 1,36.group_position = 2,37.group_id = 1,38};3940static const struct snd_soc_acpi_endpoint spk_3_endpoint = {41.num = 0,42.aggregated = 1,43.group_position = 3,44.group_id = 1,45};4647static const struct snd_soc_acpi_endpoint jack_amp_g1_dmic_endpoints[] = {48/* Jack Endpoint */49{50.num = 0,51.aggregated = 0,52.group_position = 0,53.group_id = 0,54},55/* Amp Endpoint, work as spk_l_endpoint */56{57.num = 1,58.aggregated = 1,59.group_position = 0,60.group_id = 1,61},62/* DMIC Endpoint */63{64.num = 2,65.aggregated = 0,66.group_position = 0,67.group_id = 0,68},69};7071static const struct snd_soc_acpi_adr_device cs35l56_2_lr_adr[] = {72{73.adr = 0x00023001FA355601ull,74.num_endpoints = 1,75.endpoints = &spk_l_endpoint,76.name_prefix = "AMP1"77},78{79.adr = 0x00023101FA355601ull,80.num_endpoints = 1,81.endpoints = &spk_r_endpoint,82.name_prefix = "AMP2"83}84};8586static const struct snd_soc_acpi_adr_device cs35l56_3_lr_adr[] = {87{88.adr = 0x00033001FA355601ull,89.num_endpoints = 1,90.endpoints = &spk_l_endpoint,91.name_prefix = "AMP1"92},93{94.adr = 0x00033401FA355601ull,95.num_endpoints = 1,96.endpoints = &spk_r_endpoint,97.name_prefix = "AMP2"98}99};100101static const struct snd_soc_acpi_adr_device cs35l56_2_r_adr[] = {102{103.adr = 0x00023201FA355601ull,104.num_endpoints = 1,105.endpoints = &spk_r_endpoint,106.name_prefix = "AMP3"107},108{109.adr = 0x00023301FA355601ull,110.num_endpoints = 1,111.endpoints = &spk_3_endpoint,112.name_prefix = "AMP4"113}114};115116static const struct snd_soc_acpi_adr_device cs35l56_3_l_adr[] = {117{118.adr = 0x00033001fa355601ull,119.num_endpoints = 1,120.endpoints = &spk_l_endpoint,121.name_prefix = "AMP1"122},123{124.adr = 0x00033101fa355601ull,125.num_endpoints = 1,126.endpoints = &spk_2_endpoint,127.name_prefix = "AMP2"128}129};130131static const struct snd_soc_acpi_adr_device cs35l56_2_r1_adr[] = {132{133.adr = 0x00023101FA355601ull,134.num_endpoints = 1,135.endpoints = &spk_r_endpoint,136.name_prefix = "AMP2"137},138};139140static const struct snd_soc_acpi_adr_device cs35l56_3_l3_adr[] = {141{142.adr = 0x00033301fa355601ull,143.num_endpoints = 1,144.endpoints = &spk_l_endpoint,145.name_prefix = "AMP1"146},147};148149static const struct snd_soc_acpi_adr_device cs35l56_2_r3_adr[] = {150{151.adr = 0x00023301fa355601ull,152.num_endpoints = 1,153.endpoints = &spk_r_endpoint,154.name_prefix = "AMP2"155},156};157158static const struct snd_soc_acpi_adr_device cs35l56_3_l1_adr[] = {159{160.adr = 0x00033101fa355601ull,161.num_endpoints = 1,162.endpoints = &spk_l_endpoint,163.name_prefix = "AMP1"164},165};166167static const struct snd_soc_acpi_endpoint cs42l43_endpoints[] = {168{ /* Jack Playback Endpoint */169.num = 0,170.aggregated = 0,171.group_position = 0,172.group_id = 0,173},174{ /* DMIC Capture Endpoint */175.num = 1,176.aggregated = 0,177.group_position = 0,178.group_id = 0,179},180{ /* Jack Capture Endpoint */181.num = 2,182.aggregated = 0,183.group_position = 0,184.group_id = 0,185},186{ /* Speaker Playback Endpoint */187.num = 3,188.aggregated = 0,189.group_position = 0,190.group_id = 0,191},192};193194static const struct snd_soc_acpi_adr_device cs42l43_0_adr[] = {195{196.adr = 0x00003001FA424301ull,197.num_endpoints = ARRAY_SIZE(cs42l43_endpoints),198.endpoints = cs42l43_endpoints,199.name_prefix = "cs42l43"200}201};202203static const struct snd_soc_acpi_adr_device cs42l43_2_adr[] = {204{205.adr = 0x00023001FA424301ull,206.num_endpoints = ARRAY_SIZE(cs42l43_endpoints),207.endpoints = cs42l43_endpoints,208.name_prefix = "cs42l43"209}210};211212static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {213{214.adr = 0x000020025D071100ull,215.num_endpoints = 1,216.endpoints = &single_endpoint,217.name_prefix = "rt711"218}219};220221static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {222{223.adr = 0x000030025D071101ull,224.num_endpoints = 1,225.endpoints = &single_endpoint,226.name_prefix = "rt711"227}228};229230static const struct snd_soc_acpi_adr_device rt722_0_agg_adr[] = {231{232.adr = 0x000030025D072201ull,233.num_endpoints = ARRAY_SIZE(jack_amp_g1_dmic_endpoints),234.endpoints = jack_amp_g1_dmic_endpoints,235.name_prefix = "rt722"236}237};238239static const struct snd_soc_acpi_adr_device rt1316_3_single_adr[] = {240{241.adr = 0x000330025D131601ull,242.num_endpoints = 1,243.endpoints = &single_endpoint,244.name_prefix = "rt1316-1"245}246};247248static const struct snd_soc_acpi_adr_device rt1320_2_single_adr[] = {249{250.adr = 0x000230025D132001ull,251.num_endpoints = 1,252.endpoints = &single_endpoint,253.name_prefix = "rt1320-1"254}255};256257static const struct snd_soc_acpi_link_adr arl_cs42l43_l0[] = {258{259.mask = BIT(0),260.num_adr = ARRAY_SIZE(cs42l43_0_adr),261.adr_d = cs42l43_0_adr,262},263{}264};265266static const struct snd_soc_acpi_link_adr arl_cs42l43_l2[] = {267{268.mask = BIT(2),269.num_adr = ARRAY_SIZE(cs42l43_2_adr),270.adr_d = cs42l43_2_adr,271},272{}273};274275static const struct snd_soc_acpi_link_adr arl_cs42l43_l2_cs35l56_l3[] = {276{277.mask = BIT(2),278.num_adr = ARRAY_SIZE(cs42l43_2_adr),279.adr_d = cs42l43_2_adr,280},281{282.mask = BIT(3),283.num_adr = ARRAY_SIZE(cs35l56_3_lr_adr),284.adr_d = cs35l56_3_lr_adr,285},286{}287};288289static const struct snd_soc_acpi_link_adr arl_cs42l43_l0_cs35l56_l2[] = {290{291.mask = BIT(0),292.num_adr = ARRAY_SIZE(cs42l43_0_adr),293.adr_d = cs42l43_0_adr,294},295{296.mask = BIT(2),297.num_adr = ARRAY_SIZE(cs35l56_2_lr_adr),298.adr_d = cs35l56_2_lr_adr,299},300{}301};302303static const struct snd_soc_acpi_link_adr arl_cs42l43_l0_cs35l56_l23[] = {304{305.mask = BIT(0),306.num_adr = ARRAY_SIZE(cs42l43_0_adr),307.adr_d = cs42l43_0_adr,308},309{310.mask = BIT(2),311.num_adr = ARRAY_SIZE(cs35l56_2_r_adr),312.adr_d = cs35l56_2_r_adr,313},314{315.mask = BIT(3),316.num_adr = ARRAY_SIZE(cs35l56_3_l_adr),317.adr_d = cs35l56_3_l_adr,318},319{}320};321322static const struct snd_soc_acpi_link_adr arl_cs42l43_l0_cs35l56_2_l23[] = {323{324.mask = BIT(0),325.num_adr = ARRAY_SIZE(cs42l43_0_adr),326.adr_d = cs42l43_0_adr,327},328{329.mask = BIT(2),330.num_adr = ARRAY_SIZE(cs35l56_2_r1_adr),331.adr_d = cs35l56_2_r1_adr,332},333{334.mask = BIT(3),335.num_adr = ARRAY_SIZE(cs35l56_3_l3_adr),336.adr_d = cs35l56_3_l3_adr,337},338{}339};340341static const struct snd_soc_acpi_link_adr arl_cs42l43_l0_cs35l56_3_l23[] = {342{343.mask = BIT(0),344.num_adr = ARRAY_SIZE(cs42l43_0_adr),345.adr_d = cs42l43_0_adr,346},347{348.mask = BIT(2),349.num_adr = ARRAY_SIZE(cs35l56_2_r3_adr),350.adr_d = cs35l56_2_r3_adr,351},352{353.mask = BIT(3),354.num_adr = ARRAY_SIZE(cs35l56_3_l1_adr),355.adr_d = cs35l56_3_l1_adr,356},357{}358};359360static const struct snd_soc_acpi_link_adr arl_rvp[] = {361{362.mask = BIT(0),363.num_adr = ARRAY_SIZE(rt711_0_adr),364.adr_d = rt711_0_adr,365},366{}367};368369static const struct snd_soc_acpi_link_adr arl_sdca_rvp[] = {370{371.mask = BIT(0),372.num_adr = ARRAY_SIZE(rt711_sdca_0_adr),373.adr_d = rt711_sdca_0_adr,374},375{}376};377378static const struct snd_soc_acpi_link_adr arl_rt711_l0_rt1316_l3[] = {379{380.mask = BIT(0),381.num_adr = ARRAY_SIZE(rt711_sdca_0_adr),382.adr_d = rt711_sdca_0_adr,383},384{385.mask = BIT(3),386.num_adr = ARRAY_SIZE(rt1316_3_single_adr),387.adr_d = rt1316_3_single_adr,388},389{}390};391392static const struct snd_soc_acpi_link_adr arl_rt722_l0_rt1320_l2[] = {393{394.mask = BIT(0),395.num_adr = ARRAY_SIZE(rt722_0_agg_adr),396.adr_d = rt722_0_agg_adr,397},398{399.mask = BIT(2),400.num_adr = ARRAY_SIZE(rt1320_2_single_adr),401.adr_d = rt1320_2_single_adr,402},403{}404};405406static const struct snd_soc_acpi_codecs arl_essx_83x6 = {407.num_codecs = 3,408.codecs = { "ESSX8316", "ESSX8326", "ESSX8336"},409};410411static const struct snd_soc_acpi_codecs arl_rt5682_hp = {412.num_codecs = 2,413.codecs = {RT5682_ACPI_HID, RT5682S_ACPI_HID},414};415416static const struct snd_soc_acpi_codecs arl_lt6911_hdmi = {417.num_codecs = 1,418.codecs = {"INTC10B0"}419};420421struct snd_soc_acpi_mach snd_soc_acpi_intel_arl_machines[] = {422{423.comp_ids = &arl_essx_83x6,424.drv_name = "arl_es83x6_c1_h02",425.machine_quirk = snd_soc_acpi_codec_list,426.quirk_data = &arl_lt6911_hdmi,427.sof_tplg_filename = "sof-arl-es83x6-ssp1-hdmi-ssp02.tplg",428},429{430.comp_ids = &arl_essx_83x6,431.drv_name = "sof-essx8336",432.sof_tplg_filename = "sof-arl-es8336", /* the tplg suffix is added at run time */433.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER |434SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |435SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,436},437{438.comp_ids = &arl_rt5682_hp,439.drv_name = "arl_rt5682_c1_h02",440.machine_quirk = snd_soc_acpi_codec_list,441.quirk_data = &arl_lt6911_hdmi,442.sof_tplg_filename = "sof-arl-rt5682-ssp1-hdmi-ssp02.tplg",443},444/* place amp-only boards in the end of table */445{446.id = "INTC10B0",447.drv_name = "arl_lt6911_hdmi_ssp",448.sof_tplg_filename = "sof-arl-hdmi-ssp02.tplg",449},450{},451};452EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_arl_machines);453454/* this table is used when there is no I2S codec present */455struct snd_soc_acpi_mach snd_soc_acpi_intel_arl_sdw_machines[] = {456{457.link_mask = BIT(0) | BIT(2) | BIT(3),458.links = arl_cs42l43_l0_cs35l56_l23,459.drv_name = "sof_sdw",460.sof_tplg_filename = "sof-arl-cs42l43-l0-cs35l56-l23.tplg",461.get_function_tplg_files = sof_sdw_get_tplg_files,462},463{464.link_mask = BIT(0) | BIT(2) | BIT(3),465.links = arl_cs42l43_l0_cs35l56_2_l23,466.drv_name = "sof_sdw",467.sof_tplg_filename = "sof-arl-cs42l43-l0-cs35l56-l23.tplg",468.get_function_tplg_files = sof_sdw_get_tplg_files,469},470{471.link_mask = BIT(0) | BIT(2) | BIT(3),472.links = arl_cs42l43_l0_cs35l56_3_l23,473.drv_name = "sof_sdw",474.sof_tplg_filename = "sof-arl-cs42l43-l0-cs35l56-l23.tplg",475.get_function_tplg_files = sof_sdw_get_tplg_files,476},477{478.link_mask = BIT(0) | BIT(2),479.links = arl_cs42l43_l0_cs35l56_l2,480.drv_name = "sof_sdw",481.sof_tplg_filename = "sof-arl-cs42l43-l0-cs35l56-l2.tplg",482.get_function_tplg_files = sof_sdw_get_tplg_files,483},484{485.link_mask = BIT(0),486.links = arl_cs42l43_l0,487.drv_name = "sof_sdw",488.sof_tplg_filename = "sof-arl-cs42l43-l0.tplg",489.get_function_tplg_files = sof_sdw_get_tplg_files,490},491{492.link_mask = BIT(2) | BIT(3),493.links = arl_cs42l43_l2_cs35l56_l3,494.drv_name = "sof_sdw",495.sof_tplg_filename = "sof-arl-cs42l43-l2-cs35l56-l3.tplg",496.get_function_tplg_files = sof_sdw_get_tplg_files,497},498{499.link_mask = BIT(2),500.links = arl_cs42l43_l2,501.drv_name = "sof_sdw",502.sof_tplg_filename = "sof-arl-cs42l43-l2.tplg",503.get_function_tplg_files = sof_sdw_get_tplg_files,504},505{506.link_mask = BIT(0) | BIT(3),507.links = arl_rt711_l0_rt1316_l3,508.drv_name = "sof_sdw",509.sof_tplg_filename = "sof-arl-rt711-l0-rt1316-l3.tplg",510},511{512.link_mask = 0x1, /* link0 required */513.links = arl_rvp,514.drv_name = "sof_sdw",515.sof_tplg_filename = "sof-arl-rt711.tplg",516},517{518.link_mask = 0x1, /* link0 required */519.links = arl_sdca_rvp,520.drv_name = "sof_sdw",521.sof_tplg_filename = "sof-arl-rt711-l0.tplg",522},523{524.link_mask = BIT(0) | BIT(2),525.links = arl_rt722_l0_rt1320_l2,526.drv_name = "sof_sdw",527.sof_tplg_filename = "sof-arl-rt722-l0_rt1320-l2.tplg",528.get_function_tplg_files = sof_sdw_get_tplg_files,529},530{},531};532EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_arl_sdw_machines);533534535