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.

Dependency Surface

Detected Declarations

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

Implementation Notes