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.
- 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.
- 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/bitfield.hlinux/cleanup.hlinux/device.hlinux/gpio/consumer.hlinux/hwmon.hlinux/init.hlinux/kernel.hlinux/module.hlinux/mutex.hlinux/pm_runtime.hlinux/regmap.hlinux/regulator/consumer.hlinux/reset.hlinux/slab.hlinux/soundwire/sdw.hlinux/soundwire/sdw_registers.hlinux/soundwire/sdw_type.hsound/pcm.hsound/pcm_params.hsound/soc-dapm.hsound/soc.hsound/tlv.h
Detected Declarations
struct wsa884x_privenum wsa884x_gainenum wsa884x_isenseenum wsa884x_vsenseenum wsa884x_port_idsenum wsa884x_modefunction wsa884x_readonly_registerfunction wsa884x_writeable_registerfunction wsa884x_volatile_registerfunction wsa884x_set_gain_parametersfunction wsa884x_initfunction wsa884x_update_statusfunction wsa884x_port_prepfunction wsa884x_dev_mode_getfunction wsa884x_dev_mode_putfunction wsa884x_get_swr_portfunction wsa884x_set_swr_portfunction wsa884x_codec_probefunction wsa884x_spkr_post_pmufunction wsa884x_spkr_eventfunction wsa884x_hw_paramsfunction wsa884x_hw_freefunction wsa884x_mute_streamfunction wsa884x_set_streamfunction wsa884x_get_tempfunction wsa884x_hwmon_is_visiblefunction wsa884x_hwmon_readfunction wsa884x_reset_powerdownfunction wsa884x_reset_deassertfunction wsa884x_regulator_disablefunction wsa884x_get_resetfunction wsa884x_probefunction wsa884x_runtime_suspendfunction wsa884x_runtime_resume
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
- Immediate include surface: `linux/bitfield.h`, `linux/cleanup.h`, `linux/device.h`, `linux/gpio/consumer.h`, `linux/hwmon.h`, `linux/init.h`, `linux/kernel.h`, `linux/module.h`.
- Detected declarations: `struct wsa884x_priv`, `enum wsa884x_gain`, `enum wsa884x_isense`, `enum wsa884x_vsense`, `enum wsa884x_port_ids`, `enum wsa884x_mode`, `function wsa884x_readonly_register`, `function wsa884x_writeable_register`, `function wsa884x_volatile_register`, `function wsa884x_set_gain_parameters`.
- 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.
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.