Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * soc-acpi-intel-cht-match.c - tables and support for CHT ACPI enumeration.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Copyright (c) 2017, Intel Corporation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <linux/dmi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <sound/soc-acpi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <sound/soc-acpi-intel-match.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) static unsigned long cht_machine_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #define CHT_SURFACE_MACH 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) static int cht_surface_quirk_cb(const struct dmi_system_id *id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 	cht_machine_id = CHT_SURFACE_MACH;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 	return 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) static const struct dmi_system_id cht_table[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 		.callback = cht_surface_quirk_cb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 		.matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 			DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 			DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	{ }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) static struct snd_soc_acpi_mach cht_surface_mach = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	.id = "10EC5640",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	.drv_name = "cht-bsw-rt5645",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	.fw_filename = "intel/fw_sst_22a8.bin",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	.board = "cht-bsw",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	.sof_fw_filename = "sof-cht.ri",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	.sof_tplg_filename = "sof-cht-rt5645.tplg",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) static struct snd_soc_acpi_mach *cht_quirk(void *arg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	struct snd_soc_acpi_mach *mach = arg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	dmi_check_system(cht_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	if (cht_machine_id == CHT_SURFACE_MACH)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 		return &cht_surface_mach;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 		return mach;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) /* Cherryview-based platforms: CherryTrail and Braswell */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) struct snd_soc_acpi_mach  snd_soc_acpi_intel_cherrytrail_machines[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 		.id = "10EC5670",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 		.drv_name = "cht-bsw-rt5672",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 		.fw_filename = "intel/fw_sst_22a8.bin",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 		.board = "cht-bsw",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 		.sof_fw_filename = "sof-cht.ri",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 		.sof_tplg_filename = "sof-cht-rt5670.tplg",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 		.id = "10EC5672",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 		.drv_name = "cht-bsw-rt5672",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 		.fw_filename = "intel/fw_sst_22a8.bin",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 		.board = "cht-bsw",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 		.sof_fw_filename = "sof-cht.ri",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 		.sof_tplg_filename = "sof-cht-rt5670.tplg",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 		.id = "10EC5645",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 		.drv_name = "cht-bsw-rt5645",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 		.fw_filename = "intel/fw_sst_22a8.bin",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 		.board = "cht-bsw",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 		.sof_fw_filename = "sof-cht.ri",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 		.sof_tplg_filename = "sof-cht-rt5645.tplg",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 		.id = "10EC5650",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 		.drv_name = "cht-bsw-rt5645",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 		.fw_filename = "intel/fw_sst_22a8.bin",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 		.board = "cht-bsw",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 		.sof_fw_filename = "sof-cht.ri",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 		.sof_tplg_filename = "sof-cht-rt5645.tplg",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 		.id = "10EC3270",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 		.drv_name = "cht-bsw-rt5645",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 		.fw_filename = "intel/fw_sst_22a8.bin",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 		.board = "cht-bsw",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 		.sof_fw_filename = "sof-cht.ri",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 		.sof_tplg_filename = "sof-cht-rt5645.tplg",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 		.id = "193C9890",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 		.drv_name = "cht-bsw-max98090",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 		.fw_filename = "intel/fw_sst_22a8.bin",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 		.board = "cht-bsw",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 		.sof_fw_filename = "sof-cht.ri",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 		.sof_tplg_filename = "sof-cht-max98090.tplg",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 		.id = "10508824",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 		.drv_name = "cht-bsw-nau8824",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 		.fw_filename = "intel/fw_sst_22a8.bin",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 		.board = "cht-bsw",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 		.sof_fw_filename = "sof-cht.ri",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 		.sof_tplg_filename = "sof-cht-nau8824.tplg",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 		.id = "DLGS7212",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 		.drv_name = "bytcht_da7213",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 		.fw_filename = "intel/fw_sst_22a8.bin",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 		.board = "bytcht_da7213",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 		.sof_fw_filename = "sof-cht.ri",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 		.sof_tplg_filename = "sof-cht-da7213.tplg",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 		.id = "DLGS7213",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 		.drv_name = "bytcht_da7213",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 		.fw_filename = "intel/fw_sst_22a8.bin",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 		.board = "bytcht_da7213",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 		.sof_fw_filename = "sof-cht.ri",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 		.sof_tplg_filename = "sof-cht-da7213.tplg",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 		.id = "ESSX8316",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 		.drv_name = "bytcht_es8316",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 		.fw_filename = "intel/fw_sst_22a8.bin",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 		.board = "bytcht_es8316",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 		.sof_fw_filename = "sof-cht.ri",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 		.sof_tplg_filename = "sof-cht-es8316.tplg",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	/* some CHT-T platforms rely on RT5640, use Baytrail machine driver */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 		.id = "10EC5640",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 		.drv_name = "bytcr_rt5640",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 		.fw_filename = "intel/fw_sst_22a8.bin",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 		.board = "bytcr_rt5640",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 		.machine_quirk = cht_quirk,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 		.sof_fw_filename = "sof-cht.ri",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 		.sof_tplg_filename = "sof-cht-rt5640.tplg",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 		.id = "10EC3276",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 		.drv_name = "bytcr_rt5640",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 		.fw_filename = "intel/fw_sst_22a8.bin",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 		.board = "bytcr_rt5640",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 		.sof_fw_filename = "sof-cht.ri",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 		.sof_tplg_filename = "sof-cht-rt5640.tplg",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 		.id = "10EC5682",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 		.drv_name = "sof_rt5682",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 		.sof_fw_filename = "sof-cht.ri",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 		.sof_tplg_filename = "sof-cht-rt5682.tplg",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	/* some CHT-T platforms rely on RT5651, use Baytrail machine driver */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 		.id = "10EC5651",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 		.drv_name = "bytcr_rt5651",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 		.fw_filename = "intel/fw_sst_22a8.bin",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 		.board = "bytcr_rt5651",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 		.sof_fw_filename = "sof-cht.ri",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 		.sof_tplg_filename = "sof-cht-rt5651.tplg",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 		.id = "14F10720",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 		.drv_name = "bytcht_cx2072x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 		.fw_filename = "intel/fw_sst_22a8.bin",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 		.board = "bytcht_cx2072x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 		.sof_fw_filename = "sof-cht.ri",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 		.sof_tplg_filename = "sof-cht-cx2072x.tplg",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 		.id = "104C5122",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 		.drv_name = "sof_pcm512x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 		.sof_fw_filename = "sof-cht.ri",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 		.sof_tplg_filename = "sof-cht-src-50khz-pcm512x.tplg",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) #if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	 * This is always last in the table so that it is selected only when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	 * enabled explicitly and there is no codec-related information in SSDT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 		.id = "808622A8",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 		.drv_name = "bytcht_nocodec",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 		.fw_filename = "intel/fw_sst_22a8.bin",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 		.board = "bytcht_nocodec",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	{},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cherrytrail_machines);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) MODULE_LICENSE("GPL v2");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) MODULE_DESCRIPTION("Intel Common ACPI Match module");