sound/soc/codecs/wsa884x.c

Source file repositories/reference/linux-study-clean/sound/soc/codecs/wsa884x.c

File Facts

System
Linux kernel
Corpus path
sound/soc/codecs/wsa884x.c
Extension
.c
Size
84298 bytes
Lines
2181
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 wsa884x_priv {
	struct regmap *regmap;
	struct device *dev;
	struct regulator_bulk_data supplies[WSA884X_SUPPLIES_NUM];
	struct sdw_slave *slave;
	struct sdw_stream_config sconfig;
	struct sdw_stream_runtime *sruntime;
	struct sdw_port_config port_config[WSA884X_MAX_SWR_PORTS];
	struct gpio_desc *sd_n;
	struct reset_control *sd_reset;
	bool port_prepared[WSA884X_MAX_SWR_PORTS];
	bool port_enable[WSA884X_MAX_SWR_PORTS];
	int active_ports;
	int dev_mode;
	bool hw_init;
	/*
	 * Protects temperature reading code (related to speaker protection) and
	 * fields: temperature and pa_on.
	 */
	struct mutex sp_lock;
	unsigned int temperature;
	bool pa_on;
};

enum {
	COMP_OFFSET0,
	COMP_OFFSET1,
	COMP_OFFSET2,
	COMP_OFFSET3,
	COMP_OFFSET4,
};

enum wsa884x_gain {
	G_21_DB = 0,
	G_19P5_DB,
	G_18_DB,
	G_16P5_DB,
	G_15_DB,
	G_13P5_DB,
	G_12_DB,
	G_10P5_DB,
	G_9_DB,
	G_7P5_DB,
	G_6_DB,
	G_4P5_DB,
	G_3_DB,
	G_1P5_DB,
	G_0_DB,
	G_M1P5_DB,
	G_M3_DB,
	G_M4P5_DB,
	G_M6_DB,
	G_MAX_DB,
};

enum wsa884x_isense {
	ISENSE_6_DB = 0,
	ISENSE_12_DB,
	ISENSE_15_DB,
	ISENSE_18_DB,
};

enum wsa884x_vsense {
	VSENSE_M12_DB = 0,
	VSENSE_M15_DB,
	VSENSE_M18_DB,
	VSENSE_M21_DB,
	VSENSE_M24_DB,
};

enum wsa884x_port_ids {
	WSA884X_PORT_DAC,
	WSA884X_PORT_COMP,
	WSA884X_PORT_BOOST,
	WSA884X_PORT_PBR,
	WSA884X_PORT_VISENSE,
	WSA884X_PORT_CPS,
};

static const char * const wsa884x_supply_name[] = {
	"vdd-io",
	"vdd-1p8",
};

static const char * const wsa884x_dev_mode_text[] = {
	"Speaker", "Receiver"
};

enum wsa884x_mode {
	WSA884X_SPEAKER,

Annotation

Implementation Notes