sound/soc/intel/common/soc-acpi-intel-cht-match.c
Source file repositories/reference/linux-study-clean/sound/soc/intel/common/soc-acpi-intel-cht-match.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/common/soc-acpi-intel-cht-match.c- Extension
.c- Size
- 5999 bytes
- Lines
- 236
- Domain
- Driver Families
- Bucket
- sound/soc
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/dmi.hsound/soc-acpi.hsound/soc-acpi-intel-match.h
Detected Declarations
function cht_surface_quirk_cbexport snd_soc_acpi_intel_cherrytrail_machines
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* soc-acpi-intel-cht-match.c - tables and support for CHT ACPI enumeration.
*
* Copyright (c) 2017, Intel Corporation.
*/
#include <linux/dmi.h>
#include <sound/soc-acpi.h>
#include <sound/soc-acpi-intel-match.h>
static unsigned long cht_machine_id;
#define CHT_SURFACE_MACH 1
static int cht_surface_quirk_cb(const struct dmi_system_id *id)
{
cht_machine_id = CHT_SURFACE_MACH;
return 1;
}
static const struct dmi_system_id cht_table[] = {
{
.callback = cht_surface_quirk_cb,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"),
},
},
{ }
};
static struct snd_soc_acpi_mach cht_surface_mach = {
.id = "10EC5640",
.drv_name = "cht-bsw-rt5645",
.fw_filename = "intel/fw_sst_22a8.bin",
.board = "cht-bsw",
.sof_tplg_filename = "sof-cht-rt5645.tplg",
};
static struct snd_soc_acpi_mach *cht_quirk(void *arg)
{
struct snd_soc_acpi_mach *mach = arg;
dmi_check_system(cht_table);
if (cht_machine_id == CHT_SURFACE_MACH)
return &cht_surface_mach;
else
return mach;
}
/*
* Some tablets with Android factory OS have buggy DSDTs with an ESSX8316 device
* in the ACPI tables. While they are not using an ESS8316 codec. These DSDTs
* also have an ACPI device for the correct codec, ignore the ESSX8316.
*/
static const struct dmi_system_id cht_ess8316_not_present_table[] = {
{
/* Nextbook Ares 8A */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
DMI_MATCH(DMI_PRODUCT_NAME, "CherryTrail"),
DMI_MATCH(DMI_BIOS_VERSION, "M882"),
},
},
{ }
};
static struct snd_soc_acpi_mach *cht_ess8316_quirk(void *arg)
{
if (dmi_check_system(cht_ess8316_not_present_table))
return NULL;
return arg;
}
/*
* The Lenovo Yoga Tab 3 Pro YT3-X90, with Android factory OS has a buggy DSDT
* with the coded not being listed at all.
*/
static const struct dmi_system_id lenovo_yoga_tab3_x90[] = {
{
/* Lenovo Yoga Tab 3 Pro YT3-X90, codec missing from DSDT */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"),
},
},
{ }
Annotation
- Immediate include surface: `linux/dmi.h`, `sound/soc-acpi.h`, `sound/soc-acpi-intel-match.h`.
- Detected declarations: `function cht_surface_quirk_cb`, `export snd_soc_acpi_intel_cherrytrail_machines`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.