sound/soc/codecs/sigmadsp-regmap.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/sigmadsp-regmap.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/sigmadsp-regmap.c- Extension
.c- Size
- 1573 bytes
- Lines
- 60
- 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/regmap.hlinux/export.hlinux/module.hsigmadsp.h
Detected Declarations
function sigmadsp_write_regmapfunction sigmadsp_read_regmapfunction devm_sigmadsp_init_regmapexport devm_sigmadsp_init_regmap
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Load Analog Devices SigmaStudio firmware files
*
* Copyright 2009-2011 Analog Devices Inc.
*/
#include <linux/regmap.h>
#include <linux/export.h>
#include <linux/module.h>
#include "sigmadsp.h"
static int sigmadsp_write_regmap(void *control_data,
unsigned int addr, const uint8_t data[], size_t len)
{
return regmap_raw_write(control_data, addr,
data, len);
}
static int sigmadsp_read_regmap(void *control_data,
unsigned int addr, uint8_t data[], size_t len)
{
return regmap_raw_read(control_data, addr,
data, len);
}
/**
* devm_sigmadsp_init_regmap() - Initialize SigmaDSP instance
* @dev: The parent device
* @regmap: Regmap instance to use
* @ops: The sigmadsp_ops to use for this instance
* @firmware_name: Name of the firmware file to load
*
* Allocates a SigmaDSP instance and loads the specified firmware file.
*
* Returns a pointer to a struct sigmadsp on success, or a PTR_ERR() on error.
*/
struct sigmadsp *devm_sigmadsp_init_regmap(struct device *dev,
struct regmap *regmap, const struct sigmadsp_ops *ops,
const char *firmware_name)
{
struct sigmadsp *sigmadsp;
sigmadsp = devm_sigmadsp_init(dev, ops, firmware_name);
if (IS_ERR(sigmadsp))
return sigmadsp;
sigmadsp->control_data = regmap;
sigmadsp->write = sigmadsp_write_regmap;
sigmadsp->read = sigmadsp_read_regmap;
return sigmadsp;
}
EXPORT_SYMBOL_GPL(devm_sigmadsp_init_regmap);
MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
MODULE_DESCRIPTION("SigmaDSP regmap firmware loader");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/regmap.h`, `linux/export.h`, `linux/module.h`, `sigmadsp.h`.
- Detected declarations: `function sigmadsp_write_regmap`, `function sigmadsp_read_regmap`, `function devm_sigmadsp_init_regmap`, `export devm_sigmadsp_init_regmap`.
- 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.