sound/soc/codecs/rt5668.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/rt5668.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/rt5668.c- Extension
.c- Size
- 71780 bytes
- Lines
- 2585
- 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/rt5668.hrl6231.hrt5668.h
Detected Declarations
struct rt5668_privfunction rt5668_volatile_registerfunction rt5668_readable_registerfunction rt5668_resetfunction rt5668_button_detectfunction rt5668_enable_push_button_irqfunction rt5668_headset_detectfunction rt5668_irqfunction rt5668_jd_check_handlerfunction rt5668_set_jack_detectfunction rt5668_jack_detect_handlerfunction rt5668_div_selfunction set_dmic_clkfunction set_filter_clkfunction is_sys_clk_from_pll1function is_using_asrcfunction rt5668_hp_eventfunction set_dmic_powerfunction rt5655_set_verffunction rt5668_set_tdm_slotfunction rt5668_hw_paramsfunction rt5668_set_dai_fmtfunction rt5668_set_component_sysclkfunction rt5668_set_component_pllfunction rt5668_set_bclk_ratiofunction rt5668_set_bias_levelfunction rt5668_probefunction rt5668_removefunction rt5668_suspendfunction rt5668_resumefunction rt5668_parse_dtfunction rt5668_calibratefunction rt5668_i2c_probefunction rt5668_i2c_shutdown
Annotated Snippet
struct rt5668_priv {
struct snd_soc_component *component;
struct rt5668_platform_data pdata;
struct gpio_desc *ldo1_en;
struct regmap *regmap;
struct snd_soc_jack *hs_jack;
struct regulator_bulk_data supplies[RT5668_NUM_SUPPLIES];
struct delayed_work jack_detect_work;
struct delayed_work jd_check_work;
struct mutex calibrate_mutex;
int sysclk;
int sysclk_src;
int lrck[RT5668_AIFS];
int bclk[RT5668_AIFS];
int master[RT5668_AIFS];
int pll_src;
int pll_in;
int pll_out;
int jack_type;
};
static const struct reg_default rt5668_reg[] = {
{0x0002, 0x8080},
{0x0003, 0x8000},
{0x0005, 0x0000},
{0x0006, 0x0000},
{0x0008, 0x800f},
{0x000b, 0x0000},
{0x0010, 0x4040},
{0x0011, 0x0000},
{0x0012, 0x1404},
{0x0013, 0x1000},
{0x0014, 0xa00a},
{0x0015, 0x0404},
{0x0016, 0x0404},
{0x0019, 0xafaf},
{0x001c, 0x2f2f},
{0x001f, 0x0000},
{0x0022, 0x5757},
{0x0023, 0x0039},
{0x0024, 0x000b},
{0x0026, 0xc0c4},
{0x0029, 0x8080},
{0x002a, 0xa0a0},
{0x002b, 0x0300},
{0x0030, 0x0000},
{0x003c, 0x0080},
{0x0044, 0x0c0c},
{0x0049, 0x0000},
{0x0061, 0x0000},
{0x0062, 0x0000},
{0x0063, 0x003f},
{0x0064, 0x0000},
{0x0065, 0x0000},
{0x0066, 0x0030},
{0x0067, 0x0000},
{0x006b, 0x0000},
{0x006c, 0x0000},
{0x006d, 0x2200},
{0x006e, 0x0a10},
{0x0070, 0x8000},
{0x0071, 0x8000},
{0x0073, 0x0000},
{0x0074, 0x0000},
{0x0075, 0x0002},
{0x0076, 0x0001},
{0x0079, 0x0000},
{0x007a, 0x0000},
{0x007b, 0x0000},
{0x007c, 0x0100},
{0x007e, 0x0000},
{0x0080, 0x0000},
{0x0081, 0x0000},
{0x0082, 0x0000},
{0x0083, 0x0000},
{0x0084, 0x0000},
{0x0085, 0x0000},
{0x0086, 0x0005},
{0x0087, 0x0000},
{0x0088, 0x0000},
{0x008c, 0x0003},
{0x008d, 0x0000},
{0x008e, 0x0060},
{0x008f, 0x1000},
{0x0091, 0x0c26},
{0x0092, 0x0073},
{0x0093, 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 rt5668_priv`, `function rt5668_volatile_register`, `function rt5668_readable_register`, `function rt5668_reset`, `function rt5668_button_detect`, `function rt5668_enable_push_button_irq`, `function rt5668_headset_detect`, `function rt5668_irq`, `function rt5668_jd_check_handler`, `function rt5668_set_jack_detect`.
- 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.