sound/soc/codecs/tas2764-quirks.h

Source file repositories/reference/linux-study-clean/sound/soc/codecs/tas2764-quirks.h

File Facts

System
Linux kernel
Corpus path
sound/soc/codecs/tas2764-quirks.h
Extension
.h
Size
5106 bytes
Lines
181
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

#ifndef __TAS2764_QUIRKS__
#define __TAS2764_QUIRKS__

#include <linux/regmap.h>

#include "tas2764.h"

/* Bitmask of enabled Apple quirks */
#define ENABLED_APPLE_QUIRKS	0x3f

/*
 * Disable noise gate and flip down reserved bit in NS_CFG0
 */
#define TAS2764_NOISE_GATE_DISABLE	BIT(0)

static const struct reg_sequence tas2764_noise_gate_dis_seq[] = {
	REG_SEQ0(TAS2764_REG(0x0, 0x35), 0xb0)
};

/*
 * CONV_VBAT_PVDD_MODE=1
 */
#define TAS2764_CONV_VBAT_PVDD_MODE	BIT(1)

static const struct reg_sequence tas2764_conv_vbat_pvdd_mode_seq[] = {
	REG_SEQ0(TAS2764_REG(0x0, 0x6b), 0x41)
};

/*
 * Reset of DAC modulator when DSP is OFF
 */
#define TAS2764_DMOD_RST		BIT(2)

static const struct reg_sequence tas2764_dmod_rst_seq[] = {
	REG_SEQ0(TAS2764_REG(0x0, 0x76), 0x0)
};

/*
 * Unknown 0x133/0x137 writes (maybe TDM related)
 */
#define TAS2764_UNK_SEQ0		BIT(3)

static const struct reg_sequence tas2764_unk_seq0[] = {
	REG_SEQ0(TAS2764_REG(0x1, 0x33), 0x80),
	REG_SEQ0(TAS2764_REG(0x1, 0x37), 0x3a),
};

/*
 * Unknown 0x614 - 0x61f writes
 */
#define TAS2764_APPLE_UNK_SEQ1		BIT(4)

static const struct reg_sequence tas2764_unk_seq1[] = {
	REG_SEQ0(TAS2764_REG(0x6, 0x14), 0x0),
	REG_SEQ0(TAS2764_REG(0x6, 0x15), 0x13),
	REG_SEQ0(TAS2764_REG(0x6, 0x16), 0x52),
	REG_SEQ0(TAS2764_REG(0x6, 0x17), 0x0),
	REG_SEQ0(TAS2764_REG(0x6, 0x18), 0xe4),
	REG_SEQ0(TAS2764_REG(0x6, 0x19), 0xc),
	REG_SEQ0(TAS2764_REG(0x6, 0x16), 0xaa),
	REG_SEQ0(TAS2764_REG(0x6, 0x1b), 0x0),
	REG_SEQ0(TAS2764_REG(0x6, 0x1c), 0x12),
	REG_SEQ0(TAS2764_REG(0x6, 0x1d), 0xa0),
	REG_SEQ0(TAS2764_REG(0x6, 0x1e), 0xd8),
	REG_SEQ0(TAS2764_REG(0x6, 0x1f), 0x0),
};

/*
 * Unknown writes in the 0xfd page (with secondary paging inside)
 */
#define TAS2764_APPLE_UNK_SEQ2		BIT(5)

static const struct reg_sequence tas2764_unk_seq2[] = {
	REG_SEQ0(TAS2764_REG(0xfd, 0x0d), 0xd),
	REG_SEQ0(TAS2764_REG(0xfd, 0x6c), 0x2),
	REG_SEQ0(TAS2764_REG(0xfd, 0x6d), 0xf),
	REG_SEQ0(TAS2764_REG(0xfd, 0x0d), 0x0),
};

/*
 * Disable 'Thermal Threshold 1'
 */
#define TAS2764_THERMAL_TH1_DISABLE	BIT(6)

static const struct reg_sequence tas2764_thermal_th1_dis_seq[] = {
	REG_SEQ0(TAS2764_REG(0x1, 0x47), 0x2),
};

/*
 * Imitate Apple's shutdown dance

Annotation

Implementation Notes