sound/soc/codecs/rt5663.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/rt5663.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/rt5663.c- Extension
.c- Size
- 106610 bytes
- Lines
- 3757
- 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.
- 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/acpi.hlinux/regulator/consumer.hlinux/workqueue.hsound/core.hsound/pcm.hsound/pcm_params.hsound/jack.hsound/soc.hsound/soc-dapm.hsound/initval.hsound/tlv.hrt5663.hrl6231.h
Detected Declarations
struct impedance_mapping_tablestruct rt5663_privfunction rt5663_volatile_registerfunction rt5663_readable_registerfunction rt5663_v2_volatile_registerfunction rt5663_v2_readable_registerfunction rt5663_enable_push_button_irqfunction rt5663_v2_jack_detectfunction rt5663_jack_detectfunction rt5663_impedance_sensingfunction rt5663_button_detectfunction rt5663_irqfunction rt5663_set_jack_detectfunction rt5663_check_jd_statusfunction rt5663_jack_detect_workfunction rt5663_jd_unplug_workfunction rt5663_is_sys_clk_from_pllfunction rt5663_is_using_asrcfunction rt5663_i2s_use_asrcfunction rt5663_sel_asrc_clk_srcfunction rt5663_hp_eventfunction rt5663_charge_pump_eventfunction rt5663_bst2_powerfunction rt5663_pre_div_powerfunction rt5663_hw_paramsfunction rt5663_set_dai_fmtfunction rt5663_set_dai_sysclkfunction rt5663_set_dai_pllfunction rt5663_set_tdm_slotfunction rt5663_set_bclk_ratiofunction rt5663_set_bias_levelfunction rt5663_probefunction rt5663_removefunction rt5663_suspendfunction rt5663_resumefunction rt5663_v2_calibratefunction rt5663_calibratefunction rt5663_parse_dpfunction rt5663_i2c_probefunction rt5663_i2c_removefunction rt5663_i2c_shutdownexport rt5663_sel_asrc_clk_src
Annotated Snippet
struct impedance_mapping_table {
unsigned int imp_min;
unsigned int imp_max;
unsigned int vol;
unsigned int dc_offset_l_manual;
unsigned int dc_offset_r_manual;
unsigned int dc_offset_l_manual_mic;
unsigned int dc_offset_r_manual_mic;
};
static const char *const rt5663_supply_names[] = {
"avdd",
"cpvdd",
};
struct rt5663_priv {
struct snd_soc_component *component;
struct rt5663_platform_data pdata;
struct regmap *regmap;
struct delayed_work jack_detect_work, jd_unplug_work;
struct snd_soc_jack *hs_jack;
struct timer_list btn_check_timer;
struct impedance_mapping_table *imp_table;
struct regulator_bulk_data supplies[ARRAY_SIZE(rt5663_supply_names)];
int codec_ver;
int sysclk;
int sysclk_src;
int lrck;
int pll_src;
int pll_in;
int pll_out;
int jack_type;
unsigned int irq;
};
static const struct reg_sequence rt5663_patch_list[] = {
{ 0x002a, 0x8020 },
{ 0x0086, 0x0028 },
{ 0x0100, 0xa020 },
{ 0x0117, 0x0f28 },
{ 0x02fb, 0x8089 },
};
static const struct reg_default rt5663_v2_reg[] = {
{ 0x0000, 0x0000 },
{ 0x0001, 0xc8c8 },
{ 0x0002, 0x8080 },
{ 0x0003, 0x8000 },
{ 0x0004, 0xc80a },
{ 0x0005, 0x0000 },
{ 0x0006, 0x0000 },
{ 0x0007, 0x0000 },
{ 0x000a, 0x0000 },
{ 0x000b, 0x0000 },
{ 0x000c, 0x0000 },
{ 0x000d, 0x0000 },
{ 0x000f, 0x0808 },
{ 0x0010, 0x4000 },
{ 0x0011, 0x0000 },
{ 0x0012, 0x1404 },
{ 0x0013, 0x1000 },
{ 0x0014, 0xa00a },
{ 0x0015, 0x0404 },
{ 0x0016, 0x0404 },
{ 0x0017, 0x0011 },
{ 0x0018, 0xafaf },
{ 0x0019, 0xafaf },
{ 0x001a, 0xafaf },
{ 0x001b, 0x0011 },
{ 0x001c, 0x2f2f },
{ 0x001d, 0x2f2f },
{ 0x001e, 0x2f2f },
{ 0x001f, 0x0000 },
{ 0x0020, 0x0000 },
{ 0x0021, 0x0000 },
{ 0x0022, 0x5757 },
{ 0x0023, 0x0039 },
{ 0x0024, 0x000b },
{ 0x0026, 0xc0c0 },
{ 0x0027, 0xc0c0 },
{ 0x0028, 0xc0c0 },
{ 0x0029, 0x8080 },
{ 0x002a, 0xaaaa },
{ 0x002b, 0xaaaa },
{ 0x002c, 0xaba8 },
{ 0x002d, 0x0000 },
{ 0x002e, 0x0000 },
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 impedance_mapping_table`, `struct rt5663_priv`, `function rt5663_volatile_register`, `function rt5663_readable_register`, `function rt5663_v2_volatile_register`, `function rt5663_v2_readable_register`, `function rt5663_enable_push_button_irq`, `function rt5663_v2_jack_detect`, `function rt5663_jack_detect`, `function rt5663_impedance_sensing`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: integration 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.