sound/soc/codecs/pcm3060-spi.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/pcm3060-spi.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/pcm3060-spi.c- Extension
.c- Size
- 1303 bytes
- Lines
- 60
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/spi/spi.hsound/soc.hpcm3060.h
Detected Declarations
function pcm3060_spi_probe
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
//
// PCM3060 SPI driver
//
// Copyright (C) 2018 Kirill Marinushkin <k.marinushkin@gmail.com>
#include <linux/module.h>
#include <linux/spi/spi.h>
#include <sound/soc.h>
#include "pcm3060.h"
static int pcm3060_spi_probe(struct spi_device *spi)
{
struct pcm3060_priv *priv;
priv = devm_kzalloc(&spi->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
spi_set_drvdata(spi, priv);
priv->regmap = devm_regmap_init_spi(spi, &pcm3060_regmap);
if (IS_ERR(priv->regmap))
return PTR_ERR(priv->regmap);
return pcm3060_probe(&spi->dev);
}
static const struct spi_device_id pcm3060_spi_id[] = {
{ .name = "pcm3060" },
{ },
};
MODULE_DEVICE_TABLE(spi, pcm3060_spi_id);
#ifdef CONFIG_OF
static const struct of_device_id pcm3060_of_match[] = {
{ .compatible = "ti,pcm3060" },
{ },
};
MODULE_DEVICE_TABLE(of, pcm3060_of_match);
#endif /* CONFIG_OF */
static struct spi_driver pcm3060_spi_driver = {
.driver = {
.name = "pcm3060",
#ifdef CONFIG_OF
.of_match_table = pcm3060_of_match,
#endif /* CONFIG_OF */
},
.id_table = pcm3060_spi_id,
.probe = pcm3060_spi_probe,
};
module_spi_driver(pcm3060_spi_driver);
MODULE_DESCRIPTION("PCM3060 SPI driver");
MODULE_AUTHOR("Kirill Marinushkin <k.marinushkin@gmail.com>");
MODULE_LICENSE("GPL v2");
Annotation
- Immediate include surface: `linux/module.h`, `linux/spi/spi.h`, `sound/soc.h`, `pcm3060.h`.
- Detected declarations: `function pcm3060_spi_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.