Path: blob/master/sound/soc/intel/common/soc-acpi-intel-cml-match.c
26493 views
// SPDX-License-Identifier: GPL-2.0-only1/*2* soc-acpi-intel-cml-match.c - tables and support for CML ACPI enumeration.3*4* Copyright (c) 2019, Intel Corporation.5*6*/78#include <sound/soc-acpi.h>9#include <sound/soc-acpi-intel-match.h>1011static const struct snd_soc_acpi_codecs essx_83x6 = {12.num_codecs = 3,13.codecs = { "ESSX8316", "ESSX8326", "ESSX8336"},14};1516static const struct snd_soc_acpi_codecs rt1011_spk_codecs = {17.num_codecs = 1,18.codecs = {"10EC1011"}19};2021static const struct snd_soc_acpi_codecs rt1015_spk_codecs = {22.num_codecs = 1,23.codecs = {"10EC1015"}24};2526static const struct snd_soc_acpi_codecs max98357a_spk_codecs = {27.num_codecs = 1,28.codecs = {"MX98357A"}29};3031static const struct snd_soc_acpi_codecs max98390_spk_codecs = {32.num_codecs = 1,33.codecs = {"MX98390"}34};3536/*37* The order of the three entries with .id = "10EC5682" matters38* here, because DSDT tables expose an ACPI HID for the MAX98357A39* speaker amplifier which is not populated on the board.40*/41struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_machines[] = {42{43.id = "10EC5682",44.drv_name = "cml_rt5682_def",45.machine_quirk = snd_soc_acpi_codec_list,46.quirk_data = &rt1011_spk_codecs,47.sof_tplg_filename = "sof-cml-rt1011-rt5682.tplg",48},49{50.id = "10EC5682",51.drv_name = "cml_rt5682_def",52.machine_quirk = snd_soc_acpi_codec_list,53.quirk_data = &rt1015_spk_codecs,54.sof_tplg_filename = "sof-cml-rt1011-rt5682.tplg",55},56{57.id = "10EC5682",58.drv_name = "cml_rt5682_def",59.machine_quirk = snd_soc_acpi_codec_list,60.quirk_data = &max98357a_spk_codecs,61.sof_tplg_filename = "sof-cml-rt5682-max98357a.tplg",62},63{64.id = "10EC5682",65.drv_name = "cml_rt5682_def",66.sof_tplg_filename = "sof-cml-rt5682.tplg",67},68{69.id = "DLGS7219",70.drv_name = "cml_da7219_def",71.machine_quirk = snd_soc_acpi_codec_list,72.quirk_data = &max98357a_spk_codecs,73.sof_tplg_filename = "sof-cml-da7219-max98357a.tplg",74},75{76.id = "DLGS7219",77.drv_name = "cml_da7219_def",78.machine_quirk = snd_soc_acpi_codec_list,79.quirk_data = &max98390_spk_codecs,80.sof_tplg_filename = "sof-cml-da7219-max98390.tplg",81},82{83.comp_ids = &essx_83x6,84.drv_name = "sof-essx8336",85.sof_tplg_filename = "sof-cml-es8336", /* the tplg suffix is added at run time */86.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER |87SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |88SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,89},90{},91};92EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cml_machines);9394static const struct snd_soc_acpi_endpoint single_endpoint = {95.num = 0,96.aggregated = 0,97.group_position = 0,98.group_id = 0,99};100101static const struct snd_soc_acpi_endpoint spk_l_endpoint = {102.num = 0,103.aggregated = 1,104.group_position = 0,105.group_id = 1,106};107108static const struct snd_soc_acpi_endpoint spk_r_endpoint = {109.num = 0,110.aggregated = 1,111.group_position = 1,112.group_id = 1,113};114115static const struct snd_soc_acpi_adr_device rt700_1_adr[] = {116{117.adr = 0x000110025D070000ull,118.num_endpoints = 1,119.endpoints = &single_endpoint,120.name_prefix = "rt700"121}122};123124static const struct snd_soc_acpi_link_adr cml_rvp[] = {125{126.mask = BIT(1),127.num_adr = ARRAY_SIZE(rt700_1_adr),128.adr_d = rt700_1_adr,129},130{}131};132133static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {134{135.adr = 0x000020025D071100ull,136.num_endpoints = 1,137.endpoints = &single_endpoint,138.name_prefix = "rt711"139}140};141142static const struct snd_soc_acpi_adr_device rt1308_1_single_adr[] = {143{144.adr = 0x000120025D130800ull,145.num_endpoints = 1,146.endpoints = &single_endpoint,147.name_prefix = "rt1308-1"148}149};150151static const struct snd_soc_acpi_adr_device rt1308_1_group1_adr[] = {152{153.adr = 0x000120025D130800ull,154.num_endpoints = 1,155.endpoints = &spk_l_endpoint,156.name_prefix = "rt1308-1"157}158};159160static const struct snd_soc_acpi_adr_device rt1308_2_group1_adr[] = {161{162.adr = 0x000220025D130800ull,163.num_endpoints = 1,164.endpoints = &spk_r_endpoint,165.name_prefix = "rt1308-2"166}167};168169static const struct snd_soc_acpi_adr_device rt715_3_adr[] = {170{171.adr = 0x000320025D071500ull,172.num_endpoints = 1,173.endpoints = &single_endpoint,174.name_prefix = "rt715"175}176};177178static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {179{180.adr = 0x000030025D071101ull,181.num_endpoints = 1,182.endpoints = &single_endpoint,183.name_prefix = "rt711"184}185};186187static const struct snd_soc_acpi_adr_device rt1316_1_group1_adr[] = {188{189.adr = 0x000131025D131601ull, /* unique ID is set for some reason */190.num_endpoints = 1,191.endpoints = &spk_l_endpoint,192.name_prefix = "rt1316-1"193}194};195196static const struct snd_soc_acpi_adr_device rt1316_2_group1_adr[] = {197{198.adr = 0x000230025D131601ull,199.num_endpoints = 1,200.endpoints = &spk_r_endpoint,201.name_prefix = "rt1316-2"202}203};204205static const struct snd_soc_acpi_adr_device rt714_3_adr[] = {206{207.adr = 0x000330025D071401ull,208.num_endpoints = 1,209.endpoints = &single_endpoint,210.name_prefix = "rt714"211}212};213214static const struct snd_soc_acpi_link_adr cml_3_in_1_default[] = {215{216.mask = BIT(0),217.num_adr = ARRAY_SIZE(rt711_0_adr),218.adr_d = rt711_0_adr,219},220{221.mask = BIT(1),222.num_adr = ARRAY_SIZE(rt1308_1_group1_adr),223.adr_d = rt1308_1_group1_adr,224},225{226.mask = BIT(2),227.num_adr = ARRAY_SIZE(rt1308_2_group1_adr),228.adr_d = rt1308_2_group1_adr,229},230{231.mask = BIT(3),232.num_adr = ARRAY_SIZE(rt715_3_adr),233.adr_d = rt715_3_adr,234},235{}236};237238static const struct snd_soc_acpi_link_adr cml_3_in_1_mono_amp[] = {239{240.mask = BIT(0),241.num_adr = ARRAY_SIZE(rt711_0_adr),242.adr_d = rt711_0_adr,243},244{245.mask = BIT(1),246.num_adr = ARRAY_SIZE(rt1308_1_single_adr),247.adr_d = rt1308_1_single_adr,248},249{250.mask = BIT(3),251.num_adr = ARRAY_SIZE(rt715_3_adr),252.adr_d = rt715_3_adr,253},254{}255};256257static const struct snd_soc_acpi_link_adr cml_3_in_1_sdca[] = {258{259.mask = BIT(0),260.num_adr = ARRAY_SIZE(rt711_sdca_0_adr),261.adr_d = rt711_sdca_0_adr,262},263{264.mask = BIT(1),265.num_adr = ARRAY_SIZE(rt1316_1_group1_adr),266.adr_d = rt1316_1_group1_adr,267},268{269.mask = BIT(2),270.num_adr = ARRAY_SIZE(rt1316_2_group1_adr),271.adr_d = rt1316_2_group1_adr,272},273{274.mask = BIT(3),275.num_adr = ARRAY_SIZE(rt714_3_adr),276.adr_d = rt714_3_adr,277},278{}279};280281struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_sdw_machines[] = {282{283.link_mask = 0xF, /* 4 active links required */284.links = cml_3_in_1_default,285.drv_name = "sof_sdw",286.sof_tplg_filename = "sof-cml-rt711-rt1308-rt715.tplg",287},288{289.link_mask = 0xF, /* 4 active links required */290.links = cml_3_in_1_sdca,291.drv_name = "sof_sdw",292.sof_tplg_filename = "sof-cml-rt711-rt1316-rt714.tplg",293},294{295/*296* link_mask should be 0xB, but all links are enabled by BIOS.297* This entry will be selected if there is no rt1308 exposed298* on link2 since it will fail to match the above entry.299*/300.link_mask = 0xF,301.links = cml_3_in_1_mono_amp,302.drv_name = "sof_sdw",303.sof_tplg_filename = "sof-cml-rt711-rt1308-mono-rt715.tplg",304},305{306.link_mask = 0x2, /* RT700 connected on Link1 */307.links = cml_rvp,308.drv_name = "sof_sdw",309.sof_tplg_filename = "sof-cml-rt700.tplg",310},311{}312};313EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cml_sdw_machines);314315316