Path: blob/master/sound/soc/intel/common/soc-acpi-intel-arl-match.c
26493 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};4647/*48* RT722 is a multi-function codec, three endpoints are created for49* its headset, amp and dmic functions.50*/51static const struct snd_soc_acpi_endpoint rt722_endpoints[] = {52{53.num = 0,54.aggregated = 0,55.group_position = 0,56.group_id = 0,57},58{59.num = 1,60.aggregated = 0,61.group_position = 0,62.group_id = 0,63},64{65.num = 2,66.aggregated = 0,67.group_position = 0,68.group_id = 0,69},70};7172static const struct snd_soc_acpi_adr_device cs35l56_2_lr_adr[] = {73{74.adr = 0x00023001FA355601ull,75.num_endpoints = 1,76.endpoints = &spk_l_endpoint,77.name_prefix = "AMP1"78},79{80.adr = 0x00023101FA355601ull,81.num_endpoints = 1,82.endpoints = &spk_r_endpoint,83.name_prefix = "AMP2"84}85};8687static const struct snd_soc_acpi_adr_device cs35l56_3_lr_adr[] = {88{89.adr = 0x00033001FA355601ull,90.num_endpoints = 1,91.endpoints = &spk_l_endpoint,92.name_prefix = "AMP1"93},94{95.adr = 0x00033401FA355601ull,96.num_endpoints = 1,97.endpoints = &spk_r_endpoint,98.name_prefix = "AMP2"99}100};101102static const struct snd_soc_acpi_adr_device cs35l56_2_r_adr[] = {103{104.adr = 0x00023201FA355601ull,105.num_endpoints = 1,106.endpoints = &spk_r_endpoint,107.name_prefix = "AMP3"108},109{110.adr = 0x00023301FA355601ull,111.num_endpoints = 1,112.endpoints = &spk_3_endpoint,113.name_prefix = "AMP4"114}115};116117static const struct snd_soc_acpi_adr_device cs35l56_3_l_adr[] = {118{119.adr = 0x00033001fa355601ull,120.num_endpoints = 1,121.endpoints = &spk_l_endpoint,122.name_prefix = "AMP1"123},124{125.adr = 0x00033101fa355601ull,126.num_endpoints = 1,127.endpoints = &spk_2_endpoint,128.name_prefix = "AMP2"129}130};131132static const struct snd_soc_acpi_adr_device cs35l56_2_r1_adr[] = {133{134.adr = 0x00023101FA355601ull,135.num_endpoints = 1,136.endpoints = &spk_r_endpoint,137.name_prefix = "AMP2"138},139};140141static const struct snd_soc_acpi_adr_device cs35l56_3_l3_adr[] = {142{143.adr = 0x00033301fa355601ull,144.num_endpoints = 1,145.endpoints = &spk_l_endpoint,146.name_prefix = "AMP1"147},148};149150static const struct snd_soc_acpi_adr_device cs35l56_2_r3_adr[] = {151{152.adr = 0x00023301fa355601ull,153.num_endpoints = 1,154.endpoints = &spk_r_endpoint,155.name_prefix = "AMP2"156},157};158159static const struct snd_soc_acpi_adr_device cs35l56_3_l1_adr[] = {160{161.adr = 0x00033101fa355601ull,162.num_endpoints = 1,163.endpoints = &spk_l_endpoint,164.name_prefix = "AMP1"165},166};167168static const struct snd_soc_acpi_endpoint cs42l43_endpoints[] = {169{ /* Jack Playback Endpoint */170.num = 0,171.aggregated = 0,172.group_position = 0,173.group_id = 0,174},175{ /* DMIC Capture Endpoint */176.num = 1,177.aggregated = 0,178.group_position = 0,179.group_id = 0,180},181{ /* Jack Capture Endpoint */182.num = 2,183.aggregated = 0,184.group_position = 0,185.group_id = 0,186},187{ /* Speaker Playback Endpoint */188.num = 3,189.aggregated = 0,190.group_position = 0,191.group_id = 0,192},193};194195static const struct snd_soc_acpi_adr_device cs42l43_0_adr[] = {196{197.adr = 0x00003001FA424301ull,198.num_endpoints = ARRAY_SIZE(cs42l43_endpoints),199.endpoints = cs42l43_endpoints,200.name_prefix = "cs42l43"201}202};203204static const struct snd_soc_acpi_adr_device cs42l43_2_adr[] = {205{206.adr = 0x00023001FA424301ull,207.num_endpoints = ARRAY_SIZE(cs42l43_endpoints),208.endpoints = cs42l43_endpoints,209.name_prefix = "cs42l43"210}211};212213static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {214{215.adr = 0x000020025D071100ull,216.num_endpoints = 1,217.endpoints = &single_endpoint,218.name_prefix = "rt711"219}220};221222static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {223{224.adr = 0x000030025D071101ull,225.num_endpoints = 1,226.endpoints = &single_endpoint,227.name_prefix = "rt711"228}229};230231static const struct snd_soc_acpi_adr_device rt722_0_single_adr[] = {232{233.adr = 0x000030025D072201ull,234.num_endpoints = ARRAY_SIZE(rt722_endpoints),235.endpoints = rt722_endpoints,236.name_prefix = "rt722"237}238};239240static const struct snd_soc_acpi_adr_device rt1316_3_single_adr[] = {241{242.adr = 0x000330025D131601ull,243.num_endpoints = 1,244.endpoints = &single_endpoint,245.name_prefix = "rt1316-1"246}247};248249static const struct snd_soc_acpi_adr_device rt1320_2_single_adr[] = {250{251.adr = 0x000230025D132001ull,252.num_endpoints = 1,253.endpoints = &single_endpoint,254.name_prefix = "rt1320-1"255}256};257258static const struct snd_soc_acpi_link_adr arl_cs42l43_l0[] = {259{260.mask = BIT(0),261.num_adr = ARRAY_SIZE(cs42l43_0_adr),262.adr_d = cs42l43_0_adr,263},264{}265};266267static const struct snd_soc_acpi_link_adr arl_cs42l43_l2[] = {268{269.mask = BIT(2),270.num_adr = ARRAY_SIZE(cs42l43_2_adr),271.adr_d = cs42l43_2_adr,272},273{}274};275276static const struct snd_soc_acpi_link_adr arl_cs42l43_l2_cs35l56_l3[] = {277{278.mask = BIT(2),279.num_adr = ARRAY_SIZE(cs42l43_2_adr),280.adr_d = cs42l43_2_adr,281},282{283.mask = BIT(3),284.num_adr = ARRAY_SIZE(cs35l56_3_lr_adr),285.adr_d = cs35l56_3_lr_adr,286},287{}288};289290static const struct snd_soc_acpi_link_adr arl_cs42l43_l0_cs35l56_l2[] = {291{292.mask = BIT(0),293.num_adr = ARRAY_SIZE(cs42l43_0_adr),294.adr_d = cs42l43_0_adr,295},296{297.mask = BIT(2),298.num_adr = ARRAY_SIZE(cs35l56_2_lr_adr),299.adr_d = cs35l56_2_lr_adr,300},301{}302};303304static const struct snd_soc_acpi_link_adr arl_cs42l43_l0_cs35l56_l23[] = {305{306.mask = BIT(0),307.num_adr = ARRAY_SIZE(cs42l43_0_adr),308.adr_d = cs42l43_0_adr,309},310{311.mask = BIT(2),312.num_adr = ARRAY_SIZE(cs35l56_2_r_adr),313.adr_d = cs35l56_2_r_adr,314},315{316.mask = BIT(3),317.num_adr = ARRAY_SIZE(cs35l56_3_l_adr),318.adr_d = cs35l56_3_l_adr,319},320{}321};322323static const struct snd_soc_acpi_link_adr arl_cs42l43_l0_cs35l56_2_l23[] = {324{325.mask = BIT(0),326.num_adr = ARRAY_SIZE(cs42l43_0_adr),327.adr_d = cs42l43_0_adr,328},329{330.mask = BIT(2),331.num_adr = ARRAY_SIZE(cs35l56_2_r1_adr),332.adr_d = cs35l56_2_r1_adr,333},334{335.mask = BIT(3),336.num_adr = ARRAY_SIZE(cs35l56_3_l3_adr),337.adr_d = cs35l56_3_l3_adr,338},339{}340};341342static const struct snd_soc_acpi_link_adr arl_cs42l43_l0_cs35l56_3_l23[] = {343{344.mask = BIT(0),345.num_adr = ARRAY_SIZE(cs42l43_0_adr),346.adr_d = cs42l43_0_adr,347},348{349.mask = BIT(2),350.num_adr = ARRAY_SIZE(cs35l56_2_r3_adr),351.adr_d = cs35l56_2_r3_adr,352},353{354.mask = BIT(3),355.num_adr = ARRAY_SIZE(cs35l56_3_l1_adr),356.adr_d = cs35l56_3_l1_adr,357},358{}359};360361static const struct snd_soc_acpi_link_adr arl_rvp[] = {362{363.mask = BIT(0),364.num_adr = ARRAY_SIZE(rt711_0_adr),365.adr_d = rt711_0_adr,366},367{}368};369370static const struct snd_soc_acpi_link_adr arl_sdca_rvp[] = {371{372.mask = BIT(0),373.num_adr = ARRAY_SIZE(rt711_sdca_0_adr),374.adr_d = rt711_sdca_0_adr,375},376{}377};378379static const struct snd_soc_acpi_link_adr arl_rt711_l0_rt1316_l3[] = {380{381.mask = BIT(0),382.num_adr = ARRAY_SIZE(rt711_sdca_0_adr),383.adr_d = rt711_sdca_0_adr,384},385{386.mask = BIT(3),387.num_adr = ARRAY_SIZE(rt1316_3_single_adr),388.adr_d = rt1316_3_single_adr,389},390{}391};392393static const struct snd_soc_acpi_link_adr arl_rt722_l0_rt1320_l2[] = {394{395.mask = BIT(0),396.num_adr = ARRAY_SIZE(rt722_0_single_adr),397.adr_d = rt722_0_single_adr,398},399{400.mask = BIT(2),401.num_adr = ARRAY_SIZE(rt1320_2_single_adr),402.adr_d = rt1320_2_single_adr,403},404{}405};406407static const struct snd_soc_acpi_codecs arl_essx_83x6 = {408.num_codecs = 3,409.codecs = { "ESSX8316", "ESSX8326", "ESSX8336"},410};411412static const struct snd_soc_acpi_codecs arl_rt5682_hp = {413.num_codecs = 2,414.codecs = {RT5682_ACPI_HID, RT5682S_ACPI_HID},415};416417static const struct snd_soc_acpi_codecs arl_lt6911_hdmi = {418.num_codecs = 1,419.codecs = {"INTC10B0"}420};421422struct snd_soc_acpi_mach snd_soc_acpi_intel_arl_machines[] = {423{424.comp_ids = &arl_essx_83x6,425.drv_name = "arl_es83x6_c1_h02",426.machine_quirk = snd_soc_acpi_codec_list,427.quirk_data = &arl_lt6911_hdmi,428.sof_tplg_filename = "sof-arl-es83x6-ssp1-hdmi-ssp02.tplg",429},430{431.comp_ids = &arl_essx_83x6,432.drv_name = "sof-essx8336",433.sof_tplg_filename = "sof-arl-es8336", /* the tplg suffix is added at run time */434.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER |435SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |436SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,437},438{439.comp_ids = &arl_rt5682_hp,440.drv_name = "arl_rt5682_c1_h02",441.machine_quirk = snd_soc_acpi_codec_list,442.quirk_data = &arl_lt6911_hdmi,443.sof_tplg_filename = "sof-arl-rt5682-ssp1-hdmi-ssp02.tplg",444},445/* place amp-only boards in the end of table */446{447.id = "INTC10B0",448.drv_name = "arl_lt6911_hdmi_ssp",449.sof_tplg_filename = "sof-arl-hdmi-ssp02.tplg",450},451{},452};453EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_arl_machines);454455/* this table is used when there is no I2S codec present */456struct snd_soc_acpi_mach snd_soc_acpi_intel_arl_sdw_machines[] = {457{458.link_mask = BIT(0) | BIT(2) | BIT(3),459.links = arl_cs42l43_l0_cs35l56_l23,460.drv_name = "sof_sdw",461.sof_tplg_filename = "sof-arl-cs42l43-l0-cs35l56-l23.tplg",462.get_function_tplg_files = sof_sdw_get_tplg_files,463},464{465.link_mask = BIT(0) | BIT(2) | BIT(3),466.links = arl_cs42l43_l0_cs35l56_2_l23,467.drv_name = "sof_sdw",468.sof_tplg_filename = "sof-arl-cs42l43-l0-cs35l56-l23.tplg",469.get_function_tplg_files = sof_sdw_get_tplg_files,470},471{472.link_mask = BIT(0) | BIT(2) | BIT(3),473.links = arl_cs42l43_l0_cs35l56_3_l23,474.drv_name = "sof_sdw",475.sof_tplg_filename = "sof-arl-cs42l43-l0-cs35l56-l23.tplg",476.get_function_tplg_files = sof_sdw_get_tplg_files,477},478{479.link_mask = BIT(0) | BIT(2),480.links = arl_cs42l43_l0_cs35l56_l2,481.drv_name = "sof_sdw",482.sof_tplg_filename = "sof-arl-cs42l43-l0-cs35l56-l2.tplg",483.get_function_tplg_files = sof_sdw_get_tplg_files,484},485{486.link_mask = BIT(0),487.links = arl_cs42l43_l0,488.drv_name = "sof_sdw",489.sof_tplg_filename = "sof-arl-cs42l43-l0.tplg",490.get_function_tplg_files = sof_sdw_get_tplg_files,491},492{493.link_mask = BIT(2) | BIT(3),494.links = arl_cs42l43_l2_cs35l56_l3,495.drv_name = "sof_sdw",496.sof_tplg_filename = "sof-arl-cs42l43-l2-cs35l56-l3.tplg",497.get_function_tplg_files = sof_sdw_get_tplg_files,498},499{500.link_mask = BIT(2),501.links = arl_cs42l43_l2,502.drv_name = "sof_sdw",503.sof_tplg_filename = "sof-arl-cs42l43-l2.tplg",504.get_function_tplg_files = sof_sdw_get_tplg_files,505},506{507.link_mask = BIT(0) | BIT(3),508.links = arl_rt711_l0_rt1316_l3,509.drv_name = "sof_sdw",510.sof_tplg_filename = "sof-arl-rt711-l0-rt1316-l3.tplg",511},512{513.link_mask = 0x1, /* link0 required */514.links = arl_rvp,515.drv_name = "sof_sdw",516.sof_tplg_filename = "sof-arl-rt711.tplg",517},518{519.link_mask = 0x1, /* link0 required */520.links = arl_sdca_rvp,521.drv_name = "sof_sdw",522.sof_tplg_filename = "sof-arl-rt711-l0.tplg",523},524{525.link_mask = BIT(0) | BIT(2),526.links = arl_rt722_l0_rt1320_l2,527.drv_name = "sof_sdw",528.sof_tplg_filename = "sof-arl-rt722-l0_rt1320-l2.tplg",529.get_function_tplg_files = sof_sdw_get_tplg_files,530},531{},532};533EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_arl_sdw_machines);534535536