sound/soc/codecs/rt5682-sdw.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/rt5682-sdw.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/rt5682-sdw.c- Extension
.c- Size
- 20970 bytes
- Lines
- 802
- 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/module.hlinux/moduleparam.hlinux/init.hlinux/delay.hlinux/pm.hlinux/acpi.hlinux/pm_runtime.hlinux/regulator/consumer.hlinux/mutex.hlinux/soundwire/sdw.hlinux/soundwire/sdw_type.hlinux/soundwire/sdw_registers.hsound/core.hsound/pcm.hsound/pcm_params.hsound/jack.hsound/sdw.hsound/soc.hsound/soc-dapm.hsound/initval.hsound/tlv.hrt5682.h
Detected Declarations
function rt5682_sdw_readfunction rt5682_sdw_writefunction rt5682_set_sdw_streamfunction rt5682_sdw_shutdownfunction rt5682_sdw_hw_paramsfunction rt5682_sdw_hw_freefunction rt5682_sdw_initfunction rt5682_io_initfunction rt5682_sdw_readable_registerfunction rt5682_update_statusfunction rt5682_read_propfunction rt5682_clock_configfunction rt5682_bus_configfunction rt5682_interrupt_callbackfunction rt5682_sdw_probefunction rt5682_sdw_removefunction rt5682_dev_suspendfunction rt5682_dev_system_suspendfunction rt5682_dev_resume
Annotated Snippet
if (rt5682->disable_irq == true) {
sdw_write_no_pm(slave, SDW_SCP_INTMASK1, SDW_SCP_INT1_IMPL_DEF);
rt5682->disable_irq = false;
}
mutex_unlock(&rt5682->disable_irq_lock);
}
ret = sdw_slave_wait_for_init(slave, RT5682_PROBE_TIMEOUT);
if (ret)
return ret;
regcache_cache_only(rt5682->sdw_regmap, false);
regcache_cache_only(rt5682->regmap, false);
regcache_sync(rt5682->regmap);
return 0;
}
static const struct dev_pm_ops rt5682_pm = {
SYSTEM_SLEEP_PM_OPS(rt5682_dev_system_suspend, rt5682_dev_resume)
RUNTIME_PM_OPS(rt5682_dev_suspend, rt5682_dev_resume, NULL)
};
static struct sdw_driver rt5682_sdw_driver = {
.driver = {
.name = "rt5682",
.pm = pm_ptr(&rt5682_pm),
},
.probe = rt5682_sdw_probe,
.remove = rt5682_sdw_remove,
.ops = &rt5682_slave_ops,
.id_table = rt5682_id,
};
module_sdw_driver(rt5682_sdw_driver);
MODULE_DESCRIPTION("ASoC RT5682 driver SDW");
MODULE_AUTHOR("Oder Chiou <oder_chiou@realtek.com>");
MODULE_LICENSE("GPL v2");
Annotation
- Immediate include surface: `linux/module.h`, `linux/moduleparam.h`, `linux/init.h`, `linux/delay.h`, `linux/pm.h`, `linux/acpi.h`, `linux/pm_runtime.h`, `linux/regulator/consumer.h`.
- Detected declarations: `function rt5682_sdw_read`, `function rt5682_sdw_write`, `function rt5682_set_sdw_stream`, `function rt5682_sdw_shutdown`, `function rt5682_sdw_hw_params`, `function rt5682_sdw_hw_free`, `function rt5682_sdw_init`, `function rt5682_io_init`, `function rt5682_sdw_readable_register`, `function rt5682_update_status`.
- 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.