sound/soc/ux500/mop500.c
Source file repositories/reference/linux-study-clean/sound/soc/ux500/mop500.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/ux500/mop500.c- Extension
.c- Size
- 4286 bytes
- Lines
- 168
- 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
asm/mach-types.hlinux/module.hlinux/io.hlinux/spi/spi.hlinux/of.hsound/soc.hsound/initval.hux500_pcm.hux500_msp_dai.hmop500_ab8500.h
Detected Declarations
function mop500_of_node_putfunction mop500_of_probefunction mop500_probefunction mop500_remove
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) ST-Ericsson SA 2012
*
* Author: Ola Lilja (ola.o.lilja@stericsson.com)
* for ST-Ericsson.
*/
#include <asm/mach-types.h>
#include <linux/module.h>
#include <linux/io.h>
#include <linux/spi/spi.h>
#include <linux/of.h>
#include <sound/soc.h>
#include <sound/initval.h>
#include "ux500_pcm.h"
#include "ux500_msp_dai.h"
#include "mop500_ab8500.h"
/* Define the whole MOP500 soundcard, linking platform to the codec-drivers */
SND_SOC_DAILINK_DEFS(link1,
DAILINK_COMP_ARRAY(COMP_CPU("ux500-msp-i2s.1")),
DAILINK_COMP_ARRAY(COMP_CODEC("ab8500-codec.0", "ab8500-codec-dai.0")),
DAILINK_COMP_ARRAY(COMP_PLATFORM("ux500-msp-i2s.1")));
SND_SOC_DAILINK_DEFS(link2,
DAILINK_COMP_ARRAY(COMP_CPU("ux500-msp-i2s.3")),
DAILINK_COMP_ARRAY(COMP_CODEC("ab8500-codec.0", "ab8500-codec-dai.1")),
DAILINK_COMP_ARRAY(COMP_PLATFORM("ux500-msp-i2s.3")));
static struct snd_soc_dai_link mop500_dai_links[] = {
{
.name = "ab8500_0",
.stream_name = "ab8500_0",
.init = mop500_ab8500_machine_init,
.ops = mop500_ab8500_ops,
SND_SOC_DAILINK_REG(link1),
},
{
.name = "ab8500_1",
.stream_name = "ab8500_1",
.init = NULL,
.ops = mop500_ab8500_ops,
SND_SOC_DAILINK_REG(link2),
},
};
static struct snd_soc_card mop500_card = {
.name = "MOP500-card",
.owner = THIS_MODULE,
.probe = NULL,
.dai_link = mop500_dai_links,
.num_links = ARRAY_SIZE(mop500_dai_links),
};
static void mop500_of_node_put(void)
{
int i;
for (i = 0; i < 2; i++)
of_node_put(mop500_dai_links[i].cpus->of_node);
/* Both links use the same codec, which is refcounted only once */
of_node_put(mop500_dai_links[0].codecs->of_node);
}
static int mop500_of_probe(struct platform_device *pdev,
struct device_node *np)
{
struct device_node *codec_np, *msp_np[2];
int i;
msp_np[0] = of_parse_phandle(np, "stericsson,cpu-dai", 0);
msp_np[1] = of_parse_phandle(np, "stericsson,cpu-dai", 1);
codec_np = of_parse_phandle(np, "stericsson,audio-codec", 0);
if (!(msp_np[0] && msp_np[1] && codec_np)) {
dev_err(&pdev->dev, "Phandle missing or invalid\n");
for (i = 0; i < 2; i++)
of_node_put(msp_np[i]);
of_node_put(codec_np);
return -EINVAL;
}
for (i = 0; i < 2; i++) {
mop500_dai_links[i].cpus->of_node = msp_np[i];
Annotation
- Immediate include surface: `asm/mach-types.h`, `linux/module.h`, `linux/io.h`, `linux/spi/spi.h`, `linux/of.h`, `sound/soc.h`, `sound/initval.h`, `ux500_pcm.h`.
- Detected declarations: `function mop500_of_node_put`, `function mop500_of_probe`, `function mop500_probe`, `function mop500_remove`.
- 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.