sound/soc/codecs/rt5665.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/rt5665.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/rt5665.c- Extension
.c- Size
- 157282 bytes
- Lines
- 4869
- 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.
- 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/gpio/consumer.hlinux/regulator/consumer.hlinux/mutex.hsound/core.hsound/pcm.hsound/pcm_params.hsound/jack.hsound/soc.hsound/soc-dapm.hsound/initval.hsound/tlv.hsound/rt5665.hrl6231.hrt5665.h
Detected Declarations
struct rt5665_privfunction rt5665_volatile_registerfunction rt5665_readable_registerfunction rt5665_hp_vol_putfunction rt5665_mono_vol_putfunction rt5665_button_detectfunction rt5665_enable_push_button_irqfunction rt5665_headset_detectfunction rt5665_irqfunction rt5665_jd_check_handlerfunction rt5665_set_jack_detectfunction rt5665_jack_detect_handlerfunction set_dmic_clkfunction rt5665_charge_pump_eventfunction is_sys_clk_from_pllfunction is_using_asrcfunction rt5665_mono_eventfunction rt5665_hp_eventfunction rt5665_lout_eventfunction set_dmic_powerfunction rt5665_set_verffunction rt5665_i2s_pin_eventfunction rt5665_set_tdm_slotfunction rt5665_hw_paramsfunction rt5665_set_dai_fmtfunction rt5665_set_component_sysclkfunction rt5665_set_component_pllfunction rt5665_set_bclk_ratiofunction rt5665_set_bias_levelfunction rt5665_probefunction rt5665_removefunction rt5665_suspendfunction rt5665_resumefunction rt5665_parse_dtfunction rt5665_calibratefunction rt5665_calibrate_handlerfunction rt5665_i2c_probefunction rt5665_i2c_shutdown
Annotated Snippet
struct rt5665_priv {
struct snd_soc_component *component;
struct rt5665_platform_data pdata;
struct regmap *regmap;
struct gpio_desc *gpiod_ldo1_en;
struct gpio_desc *gpiod_reset;
struct snd_soc_jack *hs_jack;
struct delayed_work jack_detect_work;
struct delayed_work calibrate_work;
struct delayed_work jd_check_work;
struct mutex calibrate_mutex;
int sysclk;
int sysclk_src;
int lrck[RT5665_AIFS];
int bclk[RT5665_AIFS];
int master[RT5665_AIFS];
int id;
int pll_src;
int pll_in;
int pll_out;
int jack_type;
int irq_work_delay_time;
unsigned int sar_adc_value;
bool calibration_done;
};
static const struct reg_default rt5665_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, 0x4040},
{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},
{0x0026, 0xc0c0},
{0x0027, 0xc0c0},
{0x0028, 0xc0c0},
{0x0029, 0x8080},
{0x002a, 0xaaaa},
{0x002b, 0xaaaa},
{0x002c, 0xaba8},
{0x002d, 0x0000},
{0x002e, 0x0000},
{0x002f, 0x0000},
{0x0030, 0x0000},
{0x0031, 0x5000},
{0x0032, 0x0000},
{0x0033, 0x0000},
{0x0034, 0x0000},
{0x0035, 0x0000},
{0x003a, 0x0000},
{0x003b, 0x0000},
{0x003c, 0x00ff},
{0x003d, 0x0000},
{0x003e, 0x00ff},
{0x003f, 0x0000},
{0x0040, 0x0000},
{0x0041, 0x00ff},
{0x0042, 0x0000},
{0x0043, 0x00ff},
{0x0044, 0x0c0c},
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 rt5665_priv`, `function rt5665_volatile_register`, `function rt5665_readable_register`, `function rt5665_hp_vol_put`, `function rt5665_mono_vol_put`, `function rt5665_button_detect`, `function rt5665_enable_push_button_irq`, `function rt5665_headset_detect`, `function rt5665_irq`, `function rt5665_jd_check_handler`.
- 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.
- 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.