treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / sound / soc / intel / common / soc-acpi-intel-cml-match.c
blobf55634c4c2e8eb46834a5c8b733b483c3019bd21
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * soc-acpi-intel-cml-match.c - tables and support for CML ACPI enumeration.
5 * Copyright (c) 2019, Intel Corporation.
7 */
9 #include <sound/soc-acpi.h>
10 #include <sound/soc-acpi-intel-match.h>
12 static struct snd_soc_acpi_codecs rt1011_spk_codecs = {
13 .num_codecs = 1,
14 .codecs = {"10EC1011"}
17 static struct snd_soc_acpi_codecs max98357a_spk_codecs = {
18 .num_codecs = 1,
19 .codecs = {"MX98357A"}
23 * The order of the three entries with .id = "10EC5682" matters
24 * here, because DSDT tables expose an ACPI HID for the MAX98357A
25 * speaker amplifier which is not populated on the board.
27 struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_machines[] = {
29 .id = "10EC5682",
30 .drv_name = "cml_rt1011_rt5682",
31 .machine_quirk = snd_soc_acpi_codec_list,
32 .quirk_data = &rt1011_spk_codecs,
33 .sof_fw_filename = "sof-cml.ri",
34 .sof_tplg_filename = "sof-cml-rt1011-rt5682.tplg",
37 .id = "10EC5682",
38 .drv_name = "sof_rt5682",
39 .machine_quirk = snd_soc_acpi_codec_list,
40 .quirk_data = &max98357a_spk_codecs,
41 .sof_fw_filename = "sof-cml.ri",
42 .sof_tplg_filename = "sof-cml-rt5682-max98357a.tplg",
45 .id = "10EC5682",
46 .drv_name = "sof_rt5682",
47 .sof_fw_filename = "sof-cml.ri",
48 .sof_tplg_filename = "sof-cml-rt5682.tplg",
51 .id = "DLGS7219",
52 .drv_name = "cml_da7219_max98357a",
53 .machine_quirk = snd_soc_acpi_codec_list,
54 .quirk_data = &max98357a_spk_codecs,
55 .sof_fw_filename = "sof-cml.ri",
56 .sof_tplg_filename = "sof-cml-da7219-max98357a.tplg",
58 {},
60 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cml_machines);
62 static const u64 rt711_0_adr[] = {
63 0x000010025D071100
66 static const u64 rt1308_1_adr[] = {
67 0x000110025D130800
70 static const u64 rt1308_2_adr[] = {
71 0x000210025D130800
74 static const u64 rt715_3_adr[] = {
75 0x000310025D071500
78 static const struct snd_soc_acpi_link_adr cml_3_in_1_default[] = {
80 .mask = BIT(0),
81 .num_adr = ARRAY_SIZE(rt711_0_adr),
82 .adr = rt711_0_adr,
85 .mask = BIT(1),
86 .num_adr = ARRAY_SIZE(rt1308_1_adr),
87 .adr = rt1308_1_adr,
90 .mask = BIT(2),
91 .num_adr = ARRAY_SIZE(rt1308_2_adr),
92 .adr = rt1308_2_adr,
95 .mask = BIT(3),
96 .num_adr = ARRAY_SIZE(rt715_3_adr),
97 .adr = rt715_3_adr,
102 static const struct snd_soc_acpi_link_adr cml_3_in_1_mono_amp[] = {
104 .mask = BIT(0),
105 .num_adr = ARRAY_SIZE(rt711_0_adr),
106 .adr = rt711_0_adr,
109 .mask = BIT(1),
110 .num_adr = ARRAY_SIZE(rt1308_1_adr),
111 .adr = rt1308_1_adr,
114 .mask = BIT(3),
115 .num_adr = ARRAY_SIZE(rt715_3_adr),
116 .adr = rt715_3_adr,
121 struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_sdw_machines[] = {
123 .link_mask = 0xF, /* 4 active links required */
124 .links = cml_3_in_1_default,
125 .drv_name = "sdw_rt711_rt1308_rt715",
126 .sof_fw_filename = "sof-cml.ri",
127 .sof_tplg_filename = "sof-cml-rt711-rt1308-rt715.tplg",
131 * link_mask should be 0xB, but all links are enabled by BIOS.
132 * This entry will be selected if there is no rt1308 exposed
133 * on link2 since it will fail to match the above entry.
135 .link_mask = 0xF,
136 .links = cml_3_in_1_mono_amp,
137 .drv_name = "sdw_rt711_rt1308_rt715",
138 .sof_fw_filename = "sof-cml.ri",
139 .sof_tplg_filename = "sof-cml-rt711-rt1308-mono-rt715.tplg",
142 .link_mask = 0x2, /* RT700 connected on Link1 */
143 .drv_name = "sdw_rt700",
144 .sof_fw_filename = "sof-cml.ri",
145 .sof_tplg_filename = "sof-cml-rt700.tplg",
149 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cml_sdw_machines);
151 MODULE_LICENSE("GPL v2");
152 MODULE_DESCRIPTION("Intel Common ACPI Match module");