Linux Audio

Check our new training course

Loading...
v5.9
  1// SPDX-License-Identifier: GPL-2.0-only
  2/*
  3 * soc-acpi-intel-byt-match.c - tables and support for BYT ACPI enumeration.
  4 *
  5 * Copyright (c) 2017, Intel Corporation.
 
 
 
 
 
 
 
 
 
 
  6 */
  7
  8#include <linux/dmi.h>
  9#include <sound/soc-acpi.h>
 10#include <sound/soc-acpi-intel-match.h>
 11
 12static unsigned long byt_machine_id;
 13
 14#define BYT_THINKPAD_10  1
 15#define BYT_POV_P1006W   2
 16#define BYT_AEGEX_10     3
 17
 18static int byt_thinkpad10_quirk_cb(const struct dmi_system_id *id)
 19{
 20	byt_machine_id = BYT_THINKPAD_10;
 21	return 1;
 22}
 23
 24static int byt_pov_p1006w_quirk_cb(const struct dmi_system_id *id)
 25{
 26	byt_machine_id = BYT_POV_P1006W;
 27	return 1;
 28}
 29
 30static int byt_aegex10_quirk_cb(const struct dmi_system_id *id)
 31{
 32	byt_machine_id = BYT_AEGEX_10;
 33	return 1;
 34}
 35
 36static const struct dmi_system_id byt_table[] = {
 37	{
 38		.callback = byt_thinkpad10_quirk_cb,
 39		.matches = {
 40			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
 41			DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad 8"),
 42		},
 43	},
 44	{
 45		.callback = byt_thinkpad10_quirk_cb,
 46		.matches = {
 47			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
 48			DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad 10"),
 49		},
 50	},
 51	{
 52		.callback = byt_thinkpad10_quirk_cb,
 53		.matches = {
 54			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
 55			DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad Tablet B"),
 56		},
 57	},
 58	{
 59		.callback = byt_thinkpad10_quirk_cb,
 60		.matches = {
 61			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
 62			DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Miix 2 10"),
 63		},
 64	},
 65	{
 66		/* Point of View mobii wintab p1006w (v1.0) */
 67		.callback = byt_pov_p1006w_quirk_cb,
 68		.matches = {
 69			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Insyde"),
 70			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "BayTrail"),
 71			/* Note 105b is Foxcon's USB/PCI vendor id */
 72			DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "105B"),
 73			DMI_EXACT_MATCH(DMI_BOARD_NAME, "0E57"),
 74		},
 75	},
 76	{
 77		/* Aegex 10 tablet (RU2) */
 78		.callback = byt_aegex10_quirk_cb,
 79		.matches = {
 80			DMI_MATCH(DMI_SYS_VENDOR, "AEGEX"),
 81			DMI_MATCH(DMI_PRODUCT_VERSION, "RU2"),
 82		},
 83	},
 84	{ }
 85};
 86
 87/* The Thinkapd 10 and Aegex 10 tablets have the same ID problem */
 88static struct snd_soc_acpi_mach byt_thinkpad_10 = {
 89	.id = "10EC5640",
 90	.drv_name = "cht-bsw-rt5672",
 91	.fw_filename = "intel/fw_sst_0f28.bin",
 92	.board = "cht-bsw",
 93	.sof_fw_filename = "sof-byt.ri",
 94	.sof_tplg_filename = "sof-byt-rt5670.tplg",
 95};
 96
 97static struct snd_soc_acpi_mach byt_pov_p1006w = {
 98	.id = "10EC5640",
 99	.drv_name = "bytcr_rt5651",
100	.fw_filename = "intel/fw_sst_0f28.bin",
101	.board = "bytcr_rt5651",
102	.sof_fw_filename = "sof-byt.ri",
103	.sof_tplg_filename = "sof-byt-rt5651.tplg",
104};
105
106static struct snd_soc_acpi_mach *byt_quirk(void *arg)
107{
108	struct snd_soc_acpi_mach *mach = arg;
109
110	dmi_check_system(byt_table);
111
112	switch (byt_machine_id) {
113	case BYT_THINKPAD_10:
114	case BYT_AEGEX_10:
115		return &byt_thinkpad_10;
116	case BYT_POV_P1006W:
117		return &byt_pov_p1006w;
118	default:
119		return mach;
120	}
121}
122
123struct snd_soc_acpi_mach snd_soc_acpi_intel_baytrail_legacy_machines[] = {
124	{
125		.id = "10EC5640",
126		.drv_name = "byt-rt5640",
127		.fw_filename = "intel/fw_sst_0f28.bin-48kHz_i2s_master",
128	},
129	{
130		.id = "193C9890",
131		.drv_name = "byt-max98090",
132		.fw_filename = "intel/fw_sst_0f28.bin-48kHz_i2s_master",
133	},
134	{}
135};
136EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_baytrail_legacy_machines);
137
138struct snd_soc_acpi_mach  snd_soc_acpi_intel_baytrail_machines[] = {
139	{
140		.id = "10EC5640",
141		.drv_name = "bytcr_rt5640",
142		.fw_filename = "intel/fw_sst_0f28.bin",
143		.board = "bytcr_rt5640",
144		.machine_quirk = byt_quirk,
145		.sof_fw_filename = "sof-byt.ri",
146		.sof_tplg_filename = "sof-byt-rt5640.tplg",
 
147	},
148	{
149		.id = "10EC5642",
150		.drv_name = "bytcr_rt5640",
151		.fw_filename = "intel/fw_sst_0f28.bin",
152		.board = "bytcr_rt5640",
153		.sof_fw_filename = "sof-byt.ri",
154		.sof_tplg_filename = "sof-byt-rt5640.tplg",
 
155	},
156	{
157		.id = "INTCCFFD",
158		.drv_name = "bytcr_rt5640",
159		.fw_filename = "intel/fw_sst_0f28.bin",
160		.board = "bytcr_rt5640",
161		.sof_fw_filename = "sof-byt.ri",
162		.sof_tplg_filename = "sof-byt-rt5640.tplg",
 
163	},
164	{
165		.id = "10EC5651",
166		.drv_name = "bytcr_rt5651",
167		.fw_filename = "intel/fw_sst_0f28.bin",
168		.board = "bytcr_rt5651",
169		.sof_fw_filename = "sof-byt.ri",
170		.sof_tplg_filename = "sof-byt-rt5651.tplg",
 
171	},
172	{
173		.id = "DLGS7212",
174		.drv_name = "bytcht_da7213",
175		.fw_filename = "intel/fw_sst_0f28.bin",
176		.board = "bytcht_da7213",
177		.sof_fw_filename = "sof-byt.ri",
178		.sof_tplg_filename = "sof-byt-da7213.tplg",
 
179	},
180	{
181		.id = "DLGS7213",
182		.drv_name = "bytcht_da7213",
183		.fw_filename = "intel/fw_sst_0f28.bin",
184		.board = "bytcht_da7213",
185		.sof_fw_filename = "sof-byt.ri",
186		.sof_tplg_filename = "sof-byt-da7213.tplg",
187	},
188	{
189		.id = "ESSX8316",
190		.drv_name = "bytcht_es8316",
191		.fw_filename = "intel/fw_sst_0f28.bin",
192		.board = "bytcht_es8316",
193		.sof_fw_filename = "sof-byt.ri",
194		.sof_tplg_filename = "sof-byt-es8316.tplg",
195	},
196	{
197		.id = "10EC5682",
198		.drv_name = "sof_rt5682",
199		.sof_fw_filename = "sof-byt.ri",
200		.sof_tplg_filename = "sof-byt-rt5682.tplg",
201	},
202	/* some Baytrail platforms rely on RT5645, use CHT machine driver */
203	{
204		.id = "10EC5645",
205		.drv_name = "cht-bsw-rt5645",
206		.fw_filename = "intel/fw_sst_0f28.bin",
207		.board = "cht-bsw",
208		.sof_fw_filename = "sof-byt.ri",
209		.sof_tplg_filename = "sof-byt-rt5645.tplg",
 
210	},
211	{
212		.id = "10EC5648",
213		.drv_name = "cht-bsw-rt5645",
214		.fw_filename = "intel/fw_sst_0f28.bin",
215		.board = "cht-bsw",
216		.sof_fw_filename = "sof-byt.ri",
217		.sof_tplg_filename = "sof-byt-rt5645.tplg",
 
218	},
219	/* use CHT driver to Baytrail Chromebooks */
220	{
221		.id = "193C9890",
222		.drv_name = "cht-bsw-max98090",
223		.fw_filename = "intel/fw_sst_0f28.bin",
224		.board = "cht-bsw",
225		.sof_fw_filename = "sof-byt.ri",
226		.sof_tplg_filename = "sof-byt-max98090.tplg",
227	},
228	{
229		.id = "14F10720",
230		.drv_name = "bytcht_cx2072x",
231		.fw_filename = "intel/fw_sst_0f28.bin",
232		.board = "bytcht_cx2072x",
233		.sof_fw_filename = "sof-byt.ri",
234		.sof_tplg_filename = "sof-byt-cx2072x.tplg",
235	},
236#if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH)
237	/*
238	 * This is always last in the table so that it is selected only when
239	 * enabled explicitly and there is no codec-related information in SSDT
240	 */
241	{
242		.id = "80860F28",
243		.drv_name = "bytcht_nocodec",
244		.fw_filename = "intel/fw_sst_0f28.bin",
245		.board = "bytcht_nocodec",
246	},
247#endif
248	{},
249};
250EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_baytrail_machines);
251
252MODULE_LICENSE("GPL v2");
253MODULE_DESCRIPTION("Intel Common ACPI Match module");
v4.17
 
  1/*
  2 * soc-apci-intel-byt-match.c - tables and support for BYT ACPI enumeration.
  3 *
  4 * Copyright (c) 2017, Intel Corporation.
  5 *
  6 *
  7 * This program is free software; you can redistribute it and/or modify it
  8 * under the terms and conditions of the GNU General Public License,
  9 * version 2, as published by the Free Software Foundation.
 10 *
 11 * This program is distributed in the hope it will be useful, but WITHOUT
 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 13 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 14 * more details.
 15 */
 16
 17#include <linux/dmi.h>
 18#include <sound/soc-acpi.h>
 19#include <sound/soc-acpi-intel-match.h>
 20
 21static unsigned long byt_machine_id;
 22
 23#define BYT_THINKPAD_10  1
 
 
 24
 25static int byt_thinkpad10_quirk_cb(const struct dmi_system_id *id)
 26{
 27	byt_machine_id = BYT_THINKPAD_10;
 28	return 1;
 29}
 30
 
 
 
 
 
 
 
 
 
 
 
 31
 32static const struct dmi_system_id byt_table[] = {
 33	{
 34		.callback = byt_thinkpad10_quirk_cb,
 35		.matches = {
 36			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
 
 
 
 
 
 
 
 37			DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad 10"),
 38		},
 39	},
 40	{
 41		.callback = byt_thinkpad10_quirk_cb,
 42		.matches = {
 43			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
 44			DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad Tablet B"),
 45		},
 46	},
 47	{
 48		.callback = byt_thinkpad10_quirk_cb,
 49		.matches = {
 50			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
 51			DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Miix 2 10"),
 52		},
 53	},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 54	{ }
 55};
 56
 
 57static struct snd_soc_acpi_mach byt_thinkpad_10 = {
 58	.id = "10EC5640",
 59	.drv_name = "cht-bsw-rt5672",
 60	.fw_filename = "intel/fw_sst_0f28.bin",
 61	.board = "cht-bsw",
 62	.sof_fw_filename = "intel/reef-byt.ri",
 63	.sof_tplg_filename = "intel/reef-byt-rt5670.tplg",
 64	.asoc_plat_name = "sst-mfld-platform",
 
 
 
 
 
 
 
 
 65};
 66
 67static struct snd_soc_acpi_mach *byt_quirk(void *arg)
 68{
 69	struct snd_soc_acpi_mach *mach = arg;
 70
 71	dmi_check_system(byt_table);
 72
 73	if (byt_machine_id == BYT_THINKPAD_10)
 
 
 74		return &byt_thinkpad_10;
 75	else
 
 
 76		return mach;
 
 77}
 78
 79struct snd_soc_acpi_mach snd_soc_acpi_intel_baytrail_legacy_machines[] = {
 80	{
 81		.id = "10EC5640",
 82		.drv_name = "byt-rt5640",
 83		.fw_filename = "intel/fw_sst_0f28.bin-48kHz_i2s_master",
 84	},
 85	{
 86		.id = "193C9890",
 87		.drv_name = "byt-max98090",
 88		.fw_filename = "intel/fw_sst_0f28.bin-48kHz_i2s_master",
 89	},
 90	{}
 91};
 92EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_baytrail_legacy_machines);
 93
 94struct snd_soc_acpi_mach  snd_soc_acpi_intel_baytrail_machines[] = {
 95	{
 96		.id = "10EC5640",
 97		.drv_name = "bytcr_rt5640",
 98		.fw_filename = "intel/fw_sst_0f28.bin",
 99		.board = "bytcr_rt5640",
100		.machine_quirk = byt_quirk,
101		.sof_fw_filename = "intel/reef-byt.ri",
102		.sof_tplg_filename = "intel/reef-byt-rt5640.tplg",
103		.asoc_plat_name = "sst-mfld-platform",
104	},
105	{
106		.id = "10EC5642",
107		.drv_name = "bytcr_rt5640",
108		.fw_filename = "intel/fw_sst_0f28.bin",
109		.board = "bytcr_rt5640",
110		.sof_fw_filename = "intel/reef-byt.ri",
111		.sof_tplg_filename = "intel/reef-byt-rt5640.tplg",
112		.asoc_plat_name = "sst-mfld-platform",
113	},
114	{
115		.id = "INTCCFFD",
116		.drv_name = "bytcr_rt5640",
117		.fw_filename = "intel/fw_sst_0f28.bin",
118		.board = "bytcr_rt5640",
119		.sof_fw_filename = "intel/reef-byt.ri",
120		.sof_tplg_filename = "intel/reef-byt-rt5640.tplg",
121		.asoc_plat_name = "sst-mfld-platform",
122	},
123	{
124		.id = "10EC5651",
125		.drv_name = "bytcr_rt5651",
126		.fw_filename = "intel/fw_sst_0f28.bin",
127		.board = "bytcr_rt5651",
128		.sof_fw_filename = "intel/reef-byt.ri",
129		.sof_tplg_filename = "intel/reef-byt-rt5651.tplg",
130		.asoc_plat_name = "sst-mfld-platform",
131	},
132	{
133		.id = "DLGS7212",
134		.drv_name = "bytcht_da7213",
135		.fw_filename = "intel/fw_sst_0f28.bin",
136		.board = "bytcht_da7213",
137		.sof_fw_filename = "intel/reef-byt.ri",
138		.sof_tplg_filename = "intel/reef-byt-da7213.tplg",
139		.asoc_plat_name = "sst-mfld-platform",
140	},
141	{
142		.id = "DLGS7213",
143		.drv_name = "bytcht_da7213",
144		.fw_filename = "intel/fw_sst_0f28.bin",
145		.board = "bytcht_da7213",
146		.sof_fw_filename = "intel/reef-byt.ri",
147		.sof_tplg_filename = "intel/reef-byt-da7213.tplg",
148		.asoc_plat_name = "sst-mfld-platform",
 
 
 
 
 
 
 
 
 
 
 
 
 
149	},
150	/* some Baytrail platforms rely on RT5645, use CHT machine driver */
151	{
152		.id = "10EC5645",
153		.drv_name = "cht-bsw-rt5645",
154		.fw_filename = "intel/fw_sst_0f28.bin",
155		.board = "cht-bsw",
156		.sof_fw_filename = "intel/reef-byt.ri",
157		.sof_tplg_filename = "intel/reef-byt-rt5645.tplg",
158		.asoc_plat_name = "sst-mfld-platform",
159	},
160	{
161		.id = "10EC5648",
162		.drv_name = "cht-bsw-rt5645",
163		.fw_filename = "intel/fw_sst_0f28.bin",
164		.board = "cht-bsw",
165		.sof_fw_filename = "intel/reef-byt.ri",
166		.sof_tplg_filename = "intel/reef-byt-rt5645.tplg",
167		.asoc_plat_name = "sst-mfld-platform",
168	},
169	/* use CHT driver to Baytrail Chromebooks */
170	{
171		.id = "193C9890",
172		.drv_name = "cht-bsw-max98090",
173		.fw_filename = "intel/fw_sst_0f28.bin",
174		.board = "cht-bsw",
175		.sof_fw_filename = "intel/reef-byt.ri",
176		.sof_tplg_filename = "intel/reef-byt-max98090.tplg",
177		.asoc_plat_name = "sst-mfld-platform",
 
 
 
 
 
 
 
178	},
179#if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH)
180	/*
181	 * This is always last in the table so that it is selected only when
182	 * enabled explicitly and there is no codec-related information in SSDT
183	 */
184	{
185		.id = "80860F28",
186		.drv_name = "bytcht_nocodec",
187		.fw_filename = "intel/fw_sst_0f28.bin",
188		.board = "bytcht_nocodec",
189	},
190#endif
191	{},
192};
193EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_baytrail_machines);
194
195MODULE_LICENSE("GPL v2");
196MODULE_DESCRIPTION("Intel Common ACPI Match module");