sound/soc/codecs/wcd9335.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/wcd9335.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/wcd9335.c- Extension
.c- Size
- 160589 bytes
- Lines
- 5169
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/module.hlinux/init.hlinux/platform_device.hlinux/cleanup.hlinux/device.hlinux/wait.hlinux/bitops.hlinux/regulator/consumer.hlinux/clk.hlinux/delay.hlinux/kernel.hlinux/slimbus.hsound/soc.hsound/pcm_params.hsound/soc-dapm.hlinux/gpio/consumer.hlinux/of.hlinux/of_irq.hsound/tlv.hsound/info.hwcd9335.hwcd-clsh-v2.hdt-bindings/sound/qcom,wcd9335.h
Detected Declarations
struct wcd9335_slim_chstruct wcd_slim_codec_dai_datastruct wcd9335_codecstruct wcd9335_irqstruct interp_sample_ratestruct wcd9335_reg_mask_valenum wcd9335_sido_voltageenum wcd_clock_typefunction slim_rx_mux_getfunction slim_rx_mux_putfunction slim_tx_mixer_getfunction slim_tx_mixer_putfunction wcd9335_put_dec_enumfunction wcd9335_int_dem_inp_mux_putfunction wcd9335_set_mix_interpolator_ratefunction list_for_each_entryfunction wcd9335_set_prim_interpolator_ratefunction list_for_each_entryfunction wcd9335_set_interpolator_ratefunction wcd9335_slim_set_hw_paramsfunction wcd9335_set_decimator_ratefunction list_for_each_entryfunction wcd9335_hw_paramsfunction wcd9335_triggerfunction wcd9335_set_channel_mapfunction wcd9335_get_channel_mapfunction wcd9335_get_companderfunction wcd9335_set_companderfunction wcd9335_rx_hph_mode_getfunction wcd9335_rx_hph_mode_putfunction wcd9335_micbias_controlfunction __wcd9335_codec_enable_micbiasfunction wcd9335_codec_enable_micbiasfunction wcd9335_codec_set_tx_holdfunction wcd9335_codec_enable_adcfunction wcd9335_codec_find_amic_inputfunction wcd9335_codec_get_amic_pwlvl_regfunction wcd9335_codec_enable_decfunction wcd9335_get_dmic_clk_valfunction wcd9335_codec_enable_dmicfunction wcd9335_codec_enable_int_portfunction list_for_each_entryfunction wcd9335_codec_enable_slimfunction wcd9335_codec_enable_mix_pathfunction wcd9335_interp_get_primary_regfunction wcd9335_codec_hd2_controlfunction wcd9335_codec_enable_prim_interpolatorfunction wcd9335_config_compander
Annotated Snippet
struct wcd9335_slim_ch {
u32 ch_num;
u16 port;
u16 shift;
struct list_head list;
};
struct wcd_slim_codec_dai_data {
struct list_head slim_ch_list;
struct slim_stream_config sconfig;
struct slim_stream_runtime *sruntime;
};
struct wcd9335_codec {
struct device *dev;
struct clk *mclk;
struct clk *native_clk;
u32 mclk_rate;
struct slim_device *slim;
struct slim_device *slim_ifc_dev;
struct regmap *regmap;
struct regmap *if_regmap;
struct regmap_irq_chip_data *irq_data;
struct wcd9335_slim_ch rx_chs[WCD9335_RX_MAX];
struct wcd9335_slim_ch tx_chs[WCD9335_TX_MAX];
u32 num_rx_port;
u32 num_tx_port;
enum wcd9335_sido_voltage sido_voltage;
struct wcd_slim_codec_dai_data dai[NUM_CODEC_DAIS];
struct snd_soc_component *component;
int master_bias_users;
int clk_mclk_users;
int clk_rco_users;
int sido_ccl_cnt;
enum wcd_clock_type clk_type;
struct wcd_clsh_ctrl *clsh_ctrl;
u32 hph_mode;
int prim_int_users[WCD9335_NUM_INTERPOLATORS];
int comp_enabled[COMPANDER_MAX];
int intr1;
struct gpio_desc *reset_gpio;
unsigned int rx_port_value[WCD9335_RX_MAX];
unsigned int tx_port_value[WCD9335_TX_MAX];
int hph_l_gain;
int hph_r_gain;
u32 rx_bias_count;
/*TX*/
int micb_ref[WCD9335_MAX_MICBIAS];
int pullup_ref[WCD9335_MAX_MICBIAS];
int dmic_0_1_clk_cnt;
int dmic_2_3_clk_cnt;
int dmic_4_5_clk_cnt;
};
struct wcd9335_irq {
int irq;
irqreturn_t (*handler)(int irq, void *data);
char *name;
};
static const char * const wcd9335_supplies[] = {
"vdd-buck", "vdd-buck-sido", "vdd-tx", "vdd-rx", "vdd-io",
};
static const struct wcd9335_slim_ch wcd9335_tx_chs[WCD9335_TX_MAX] = {
WCD9335_SLIM_TX_CH(0),
WCD9335_SLIM_TX_CH(1),
WCD9335_SLIM_TX_CH(2),
WCD9335_SLIM_TX_CH(3),
WCD9335_SLIM_TX_CH(4),
WCD9335_SLIM_TX_CH(5),
WCD9335_SLIM_TX_CH(6),
WCD9335_SLIM_TX_CH(7),
WCD9335_SLIM_TX_CH(8),
WCD9335_SLIM_TX_CH(9),
WCD9335_SLIM_TX_CH(10),
WCD9335_SLIM_TX_CH(11),
WCD9335_SLIM_TX_CH(12),
WCD9335_SLIM_TX_CH(13),
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/platform_device.h`, `linux/cleanup.h`, `linux/device.h`, `linux/wait.h`, `linux/bitops.h`, `linux/regulator/consumer.h`.
- Detected declarations: `struct wcd9335_slim_ch`, `struct wcd_slim_codec_dai_data`, `struct wcd9335_codec`, `struct wcd9335_irq`, `struct interp_sample_rate`, `struct wcd9335_reg_mask_val`, `enum wcd9335_sido_voltage`, `enum wcd_clock_type`, `function slim_rx_mux_get`, `function slim_rx_mux_put`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.