sound/soc/sdca/sdca_class_function.c
Source file repositories/reference/linux-study-clean/sound/soc/sdca/sdca_class_function.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/sdca/sdca_class_function.c- Extension
.c- Size
- 15169 bytes
- Lines
- 574
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/auxiliary_bus.hlinux/cleanup.hlinux/minmax.hlinux/module.hlinux/pm.hlinux/pm_runtime.hlinux/soundwire/sdw.hlinux/soundwire/sdw_registers.hsound/pcm.hsound/sdca_asoc.hsound/sdca_fdl.hsound/sdca_function.hsound/sdca_interrupts.hsound/sdca_jack.hsound/sdca_regmap.hsound/sdw.hsound/soc-component.hsound/soc-dai.hsound/soc.hsdca_class.hsdca_function_device.h
Detected Declarations
struct class_function_drvfunction class_function_regmap_lockfunction class_function_regmap_unlockfunction class_function_regmap_writeablefunction class_function_regmap_readablefunction class_function_regmap_volatilefunction class_function_regmap_mbq_sizefunction class_function_regmap_deferrablefunction class_function_startupfunction class_function_sdw_add_peripheralfunction class_function_sdw_remove_peripheralfunction class_function_sdw_set_streamfunction class_function_component_probefunction class_function_component_removefunction class_function_set_jackfunction class_function_init_devicefunction class_function_bootfunction class_function_probefunction class_function_removefunction class_function_runtime_suspendfunction class_function_runtime_resumefunction class_function_suspendfunction class_function_resume
Annotated Snippet
struct class_function_drv {
struct device *dev;
struct regmap *regmap;
struct sdca_class_drv *core;
struct sdca_function_data *function;
bool suspended;
};
static void class_function_regmap_lock(void *data)
{
struct mutex *lock = data;
mutex_lock(lock);
}
static void class_function_regmap_unlock(void *data)
{
struct mutex *lock = data;
mutex_unlock(lock);
}
static bool class_function_regmap_writeable(struct device *dev, unsigned int reg)
{
struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
struct class_function_drv *drv = auxiliary_get_drvdata(auxdev);
return sdca_regmap_writeable(drv->function, reg);
}
static bool class_function_regmap_readable(struct device *dev, unsigned int reg)
{
struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
struct class_function_drv *drv = auxiliary_get_drvdata(auxdev);
return sdca_regmap_readable(drv->function, reg);
}
static bool class_function_regmap_volatile(struct device *dev, unsigned int reg)
{
struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
struct class_function_drv *drv = auxiliary_get_drvdata(auxdev);
return sdca_regmap_volatile(drv->function, reg);
}
static const struct regmap_config class_function_regmap_config = {
.name = "sdca",
.reg_bits = 32,
.val_bits = 32,
.reg_format_endian = REGMAP_ENDIAN_LITTLE,
.val_format_endian = REGMAP_ENDIAN_LITTLE,
.max_register = SDW_SDCA_MAX_REGISTER,
.readable_reg = class_function_regmap_readable,
.writeable_reg = class_function_regmap_writeable,
.volatile_reg = class_function_regmap_volatile,
.cache_type = REGCACHE_MAPLE,
.lock = class_function_regmap_lock,
.unlock = class_function_regmap_unlock,
};
static int class_function_regmap_mbq_size(struct device *dev, unsigned int reg)
{
struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
struct class_function_drv *drv = auxiliary_get_drvdata(auxdev);
return sdca_regmap_mbq_size(drv->function, reg);
}
static bool class_function_regmap_deferrable(struct device *dev, unsigned int reg)
{
struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
struct class_function_drv *drv = auxiliary_get_drvdata(auxdev);
return sdca_regmap_deferrable(drv->function, reg);
}
static const struct regmap_sdw_mbq_cfg class_function_mbq_config = {
.mbq_size = class_function_regmap_mbq_size,
.deferrable = class_function_regmap_deferrable,
.retry_us = 1000,
.timeout_us = 10000,
};
static int class_function_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
Annotation
- Immediate include surface: `linux/auxiliary_bus.h`, `linux/cleanup.h`, `linux/minmax.h`, `linux/module.h`, `linux/pm.h`, `linux/pm_runtime.h`, `linux/soundwire/sdw.h`, `linux/soundwire/sdw_registers.h`.
- Detected declarations: `struct class_function_drv`, `function class_function_regmap_lock`, `function class_function_regmap_unlock`, `function class_function_regmap_writeable`, `function class_function_regmap_readable`, `function class_function_regmap_volatile`, `function class_function_regmap_mbq_size`, `function class_function_regmap_deferrable`, `function class_function_startup`, `function class_function_sdw_add_peripheral`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.