sound/soc/intel/boards/sof_ssp_amp.c
Source file repositories/reference/linux-study-clean/sound/soc/intel/boards/sof_ssp_amp.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/boards/sof_ssp_amp.c- Extension
.c- Size
- 6303 bytes
- Lines
- 246
- Domain
- Driver Families
- Bucket
- sound/soc
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/delay.hlinux/dmi.hlinux/module.hlinux/platform_device.hsound/core.hsound/jack.hsound/pcm.hsound/pcm_params.hsound/sof.hsof_board_helpers.hsof_realtek_common.hsof_cirrus_common.h
Detected Declarations
function sof_card_late_probefunction sof_card_dai_links_createfunction sof_ssp_amp_probe
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
//
// Copyright(c) 2022 Intel Corporation
/*
* sof_ssp_amp.c - ASoc Machine driver for Intel platforms
* with RT1308/CS35L41 codec.
*/
#include <linux/acpi.h>
#include <linux/delay.h>
#include <linux/dmi.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <sound/core.h>
#include <sound/jack.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/sof.h>
#include "sof_board_helpers.h"
#include "sof_realtek_common.h"
#include "sof_cirrus_common.h"
/* Driver-specific board quirks: from bit 0 to 7 */
#define SOF_HDMI_PLAYBACK_PRESENT BIT(0)
/* Default: SSP2 */
static unsigned long sof_ssp_amp_quirk = SOF_SSP_PORT_AMP(2);
static const struct dmi_system_id chromebook_platforms[] = {
{
.ident = "Google Chromebooks",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Google"),
}
},
{},
};
static int sof_card_late_probe(struct snd_soc_card *card)
{
return sof_intel_board_card_late_probe(card);
}
static struct snd_soc_card sof_ssp_amp_card = {
.name = "ssp_amp",
.owner = THIS_MODULE,
.fully_routed = true,
.late_probe = sof_card_late_probe,
};
/* BE ID defined in sof-tgl-rt1308-hdmi-ssp.m4 */
#define HDMI_IN_BE_ID 0
#define SPK_BE_ID 2
#define DMIC01_BE_ID 3
#define INTEL_HDMI_BE_ID 5
/* extra BE links to support no-hdmi-in boards */
#define DMIC16K_BE_ID 4
#define BT_OFFLOAD_BE_ID 8
#define SSP_AMP_LINK_ORDER SOF_LINK_ORDER(SOF_LINK_HDMI_IN, \
SOF_LINK_AMP, \
SOF_LINK_DMIC01, \
SOF_LINK_DMIC16K, \
SOF_LINK_IDISP_HDMI, \
SOF_LINK_BT_OFFLOAD, \
SOF_LINK_NONE)
#define SSP_AMP_LINK_IDS SOF_LINK_ORDER(HDMI_IN_BE_ID, \
SPK_BE_ID, \
DMIC01_BE_ID, \
DMIC16K_BE_ID, \
INTEL_HDMI_BE_ID, \
BT_OFFLOAD_BE_ID, \
0)
static int
sof_card_dai_links_create(struct device *dev, struct snd_soc_card *card,
struct sof_card_private *ctx)
{
int ret;
ret = sof_intel_board_set_dai_link(dev, card, ctx);
if (ret)
return ret;
if (ctx->amp_type == CODEC_NONE)
return 0;
if (!ctx->amp_link) {
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/delay.h`, `linux/dmi.h`, `linux/module.h`, `linux/platform_device.h`, `sound/core.h`, `sound/jack.h`, `sound/pcm.h`.
- Detected declarations: `function sof_card_late_probe`, `function sof_card_dai_links_create`, `function sof_ssp_amp_probe`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source 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.