sound/i2c/other/ak4113.c
Source file repositories/reference/linux-study-clean/sound/i2c/other/ak4113.c
File Facts
- System
- Linux kernel
- Corpus path
sound/i2c/other/ak4113.c- Extension
.c- Size
- 17648 bytes
- Lines
- 637
- Domain
- Driver Families
- Bucket
- sound/i2c
- 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.
- 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/slab.hlinux/delay.hlinux/module.hsound/core.hsound/control.hsound/pcm.hsound/ak4113.hsound/asoundef.hsound/info.h
Detected Declarations
function reg_writefunction reg_readfunction snd_ak4113_freefunction snd_ak4113_dev_freefunction snd_ak4113_createfunction snd_ak4113_reg_writefunction ak4113_init_regsfunction snd_ak4113_reinitfunction external_ratefunction snd_ak4113_in_error_infofunction snd_ak4113_in_error_getfunction snd_ak4113_in_bit_getfunction snd_ak4113_rx_infofunction snd_ak4113_rx_getfunction snd_ak4113_rx_putfunction snd_ak4113_rate_infofunction snd_ak4113_rate_getfunction snd_ak4113_spdif_infofunction snd_ak4113_spdif_getfunction snd_ak4113_spdif_mask_infofunction snd_ak4113_spdif_mask_getfunction snd_ak4113_spdif_pinfofunction snd_ak4113_spdif_pgetfunction snd_ak4113_spdif_qinfofunction snd_ak4113_spdif_qgetfunction snd_ak4113_proc_regs_readfunction snd_ak4113_proc_initfunction snd_ak4113_buildfunction snd_ak4113_external_ratefunction snd_ak4113_check_rate_and_errorsfunction ak4113_statsfunction snd_ak4113_suspendfunction snd_ak4113_resumeexport snd_ak4113_createexport snd_ak4113_reg_writeexport snd_ak4113_reinitexport snd_ak4113_buildexport snd_ak4113_external_rateexport snd_ak4113_check_rate_and_errorsexport snd_ak4113_suspendexport snd_ak4113_resume
Annotated Snippet
if (snd_pcm_running(ak4113->substream)) {
snd_pcm_stop(ak4113->substream,
SNDRV_PCM_STATE_DRAINING);
wake_up(&runtime->sleep);
res = 1;
}
snd_pcm_stream_unlock_irqrestore(ak4113->substream, _flags);
}
return res;
}
EXPORT_SYMBOL_GPL(snd_ak4113_check_rate_and_errors);
static void ak4113_stats(struct work_struct *work)
{
struct ak4113 *chip = container_of(work, struct ak4113, work.work);
if (atomic_inc_return(&chip->wq_processing) == 1)
snd_ak4113_check_rate_and_errors(chip, chip->check_flags);
if (atomic_dec_and_test(&chip->wq_processing))
schedule_delayed_work(&chip->work, HZ / 10);
}
#ifdef CONFIG_PM
void snd_ak4113_suspend(struct ak4113 *chip)
{
atomic_inc(&chip->wq_processing); /* don't schedule new work */
cancel_delayed_work_sync(&chip->work);
}
EXPORT_SYMBOL(snd_ak4113_suspend);
void snd_ak4113_resume(struct ak4113 *chip)
{
atomic_dec(&chip->wq_processing);
snd_ak4113_reinit(chip);
}
EXPORT_SYMBOL(snd_ak4113_resume);
#endif
Annotation
- Immediate include surface: `linux/slab.h`, `linux/delay.h`, `linux/module.h`, `sound/core.h`, `sound/control.h`, `sound/pcm.h`, `sound/ak4113.h`, `sound/asoundef.h`.
- Detected declarations: `function reg_write`, `function reg_read`, `function snd_ak4113_free`, `function snd_ak4113_dev_free`, `function snd_ak4113_create`, `function snd_ak4113_reg_write`, `function ak4113_init_regs`, `function snd_ak4113_reinit`, `function external_rate`, `function snd_ak4113_in_error_info`.
- Atlas domain: Driver Families / sound/i2c.
- Implementation status: integration 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.