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.

Dependency Surface

Detected Declarations

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

Implementation Notes