sound/soc/codecs/rt298.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/rt298.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/rt298.c- Extension
.c- Size
- 34432 bytes
- Lines
- 1315
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/i2c.hlinux/platform_device.hlinux/spi/spi.hlinux/dmi.hlinux/acpi.hsound/core.hsound/pcm.hsound/pcm_params.hsound/soc.hsound/soc-dapm.hsound/initval.hsound/tlv.hsound/jack.hlinux/workqueue.hsound/rt298.hrl6347a.hrt298.h
Detected Declarations
struct rt298_privfunction rt298_volatile_registerfunction rt298_readable_registerfunction rt298_index_syncfunction rt298_jack_detectfunction rt298_jack_detect_workfunction rt298_mic_detectfunction is_mclk_modefunction rt298_spk_eventfunction rt298_set_dmic1_eventfunction rt298_adc_eventfunction rt298_mic1_eventfunction rt298_hw_paramsfunction rt298_set_dai_fmtfunction rt298_set_dai_sysclkfunction rt298_set_bclk_ratiofunction rt298_set_bias_levelfunction rt298_irqfunction rt298_probefunction rt298_removefunction rt298_suspendfunction rt298_resumefunction rt298_i2c_probe
Annotated Snippet
struct rt298_priv {
struct reg_default *index_cache;
int index_cache_size;
struct regmap *regmap;
struct snd_soc_component *component;
struct rt298_platform_data pdata;
struct i2c_client *i2c;
struct snd_soc_jack *jack;
struct delayed_work jack_detect_work;
int sys_clk;
int clk_id;
int is_hp_in;
};
static const struct reg_default rt298_index_def[] = {
{ 0x01, 0xa5a8 },
{ 0x02, 0x8e95 },
{ 0x03, 0x0002 },
{ 0x04, 0xaf67 },
{ 0x08, 0x200f },
{ 0x09, 0xd010 },
{ 0x0a, 0x0100 },
{ 0x0b, 0x0000 },
{ 0x0d, 0x2800 },
{ 0x0f, 0x0022 },
{ 0x19, 0x0217 },
{ 0x20, 0x0020 },
{ 0x33, 0x0208 },
{ 0x46, 0x0300 },
{ 0x49, 0x4004 },
{ 0x4f, 0x50c9 },
{ 0x50, 0x3000 },
{ 0x63, 0x1b02 },
{ 0x67, 0x1111 },
{ 0x68, 0x1016 },
{ 0x69, 0x273f },
};
#define INDEX_CACHE_SIZE ARRAY_SIZE(rt298_index_def)
static const struct reg_default rt298_reg[] = {
{ 0x00170500, 0x00000400 },
{ 0x00220000, 0x00000031 },
{ 0x00239000, 0x0000007f },
{ 0x0023a000, 0x0000007f },
{ 0x00270500, 0x00000400 },
{ 0x00370500, 0x00000400 },
{ 0x00870500, 0x00000400 },
{ 0x00920000, 0x00000031 },
{ 0x00935000, 0x000000c3 },
{ 0x00936000, 0x000000c3 },
{ 0x00970500, 0x00000400 },
{ 0x00b37000, 0x00000097 },
{ 0x00b37200, 0x00000097 },
{ 0x00b37300, 0x00000097 },
{ 0x00c37000, 0x00000000 },
{ 0x00c37100, 0x00000080 },
{ 0x01270500, 0x00000400 },
{ 0x01370500, 0x00000400 },
{ 0x01371f00, 0x411111f0 },
{ 0x01439000, 0x00000080 },
{ 0x0143a000, 0x00000080 },
{ 0x01470700, 0x00000000 },
{ 0x01470500, 0x00000400 },
{ 0x01470c00, 0x00000000 },
{ 0x01470100, 0x00000000 },
{ 0x01837000, 0x00000000 },
{ 0x01870500, 0x00000400 },
{ 0x02050000, 0x00000000 },
{ 0x02139000, 0x00000080 },
{ 0x0213a000, 0x00000080 },
{ 0x02170100, 0x00000000 },
{ 0x02170500, 0x00000400 },
{ 0x02170700, 0x00000000 },
{ 0x02270100, 0x00000000 },
{ 0x02370100, 0x00000000 },
{ 0x01870700, 0x00000020 },
{ 0x00830000, 0x000000c3 },
{ 0x00930000, 0x000000c3 },
{ 0x01270700, 0x00000000 },
};
static bool rt298_volatile_register(struct device *dev, unsigned int reg)
{
switch (reg) {
case 0 ... 0xff:
case RT298_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID):
case RT298_GET_HP_SENSE:
case RT298_GET_MIC1_SENSE:
case RT298_PROC_COEF:
case VERB_CMD(AC_VERB_GET_EAPD_BTLENABLE, RT298_MIC1, 0):
Annotation
- Immediate include surface: `linux/module.h`, `linux/moduleparam.h`, `linux/init.h`, `linux/delay.h`, `linux/pm.h`, `linux/i2c.h`, `linux/platform_device.h`, `linux/spi/spi.h`.
- Detected declarations: `struct rt298_priv`, `function rt298_volatile_register`, `function rt298_readable_register`, `function rt298_index_sync`, `function rt298_jack_detect`, `function rt298_jack_detect_work`, `function rt298_mic_detect`, `function is_mclk_mode`, `function rt298_spk_event`, `function rt298_set_dmic1_event`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.