sound/soc/codecs/wcd937x.h
Source file repositories/reference/linux-study-clean/sound/soc/codecs/wcd937x.h
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/wcd937x.h- Extension
.h- Size
- 24474 bytes
- Lines
- 619
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/soundwire/sdw.hlinux/soundwire/sdw_type.hwcd-common.h
Detected Declarations
struct wcd937x_privstruct wcd937x_sdw_privenum wcd937x_tx_sdw_portsenum wcd937x_rx_sdw_portsenum wcd937x_tx_sdw_channelsenum wcd937x_rx_sdw_channelsfunction wcd937x_sdw_freefunction wcd937x_sdw_set_sdw_streamfunction wcd937x_sdw_hw_params
Annotated Snippet
struct wcd937x_sdw_priv {
struct sdw_slave *sdev;
struct sdw_stream_config sconfig;
struct sdw_stream_runtime *sruntime;
struct sdw_port_config port_config[WCD937X_MAX_SWR_PORTS];
struct wcd_sdw_ch_info *ch_info;
bool port_enable[WCD937X_MAX_SWR_CH_IDS];
unsigned int master_channel_map[SDW_MAX_PORTS];
int active_ports;
int num_ports;
bool is_tx;
struct wcd937x_priv *wcd937x;
struct irq_domain *slave_irq;
struct regmap *regmap;
};
#if IS_ENABLED(CONFIG_SND_SOC_WCD937X_SDW)
int wcd937x_sdw_free(struct wcd937x_sdw_priv *wcd,
struct snd_pcm_substream *substream,
struct snd_soc_dai *dai);
int wcd937x_sdw_set_sdw_stream(struct wcd937x_sdw_priv *wcd,
struct snd_soc_dai *dai,
void *stream, int direction);
int wcd937x_sdw_hw_params(struct wcd937x_sdw_priv *wcd,
struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai);
#else
static inline int wcd937x_sdw_free(struct wcd937x_sdw_priv *wcd,
struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
return -EOPNOTSUPP;
}
static inline int wcd937x_sdw_set_sdw_stream(struct wcd937x_sdw_priv *wcd,
struct snd_soc_dai *dai,
void *stream, int direction)
{
return -EOPNOTSUPP;
}
static inline int wcd937x_sdw_hw_params(struct wcd937x_sdw_priv *wcd,
struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{
return -EOPNOTSUPP;
}
#endif
enum {
/* INTR_CTRL_INT_MASK_0 */
WCD937X_IRQ_MBHC_BUTTON_PRESS_DET = 0,
WCD937X_IRQ_MBHC_BUTTON_RELEASE_DET,
WCD937X_IRQ_MBHC_ELECT_INS_REM_DET,
WCD937X_IRQ_MBHC_ELECT_INS_REM_LEG_DET,
WCD937X_IRQ_MBHC_SW_DET,
WCD937X_IRQ_HPHR_OCP_INT,
WCD937X_IRQ_HPHR_CNP_INT,
WCD937X_IRQ_HPHL_OCP_INT,
/* INTR_CTRL_INT_MASK_1 */
WCD937X_IRQ_HPHL_CNP_INT,
WCD937X_IRQ_EAR_CNP_INT,
WCD937X_IRQ_EAR_SCD_INT,
WCD937X_IRQ_AUX_CNP_INT,
WCD937X_IRQ_AUX_SCD_INT,
WCD937X_IRQ_HPHL_PDM_WD_INT,
WCD937X_IRQ_HPHR_PDM_WD_INT,
WCD937X_IRQ_AUX_PDM_WD_INT,
/* INTR_CTRL_INT_MASK_2 */
WCD937X_IRQ_LDORT_SCD_INT,
WCD937X_IRQ_MBHC_MOISTURE_INT,
WCD937X_IRQ_HPHL_SURGE_DET_INT,
WCD937X_IRQ_HPHR_SURGE_DET_INT,
WCD937X_NUM_IRQS,
};
enum wcd937x_tx_sdw_channels {
WCD937X_ADC1,
WCD937X_ADC2,
WCD937X_ADC3,
WCD937X_DMIC0,
WCD937X_DMIC1,
WCD937X_MBHC,
WCD937X_DMIC2,
WCD937X_DMIC3,
Annotation
- Immediate include surface: `linux/soundwire/sdw.h`, `linux/soundwire/sdw_type.h`, `wcd-common.h`.
- Detected declarations: `struct wcd937x_priv`, `struct wcd937x_sdw_priv`, `enum wcd937x_tx_sdw_ports`, `enum wcd937x_rx_sdw_ports`, `enum wcd937x_tx_sdw_channels`, `enum wcd937x_rx_sdw_channels`, `function wcd937x_sdw_free`, `function wcd937x_sdw_set_sdw_stream`, `function wcd937x_sdw_hw_params`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
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.