sound/soc/codecs/wcd-mbhc-v2.h
Source file repositories/reference/linux-study-clean/sound/soc/codecs/wcd-mbhc-v2.h
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/wcd-mbhc-v2.h- Extension
.h- Size
- 8671 bytes
- Lines
- 344
- 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
sound/jack.h
Detected Declarations
struct wcd_mbhc_configstruct wcd_mbhc_intrstruct wcd_mbhc_fieldstruct wcd_mbhcstruct wcd_mbhc_cbenum wcd_mbhc_field_functionenum wcd_mbhc_detect_logicenum wcd_mbhc_cs_mb_en_flagenum wcd_mbhc_plug_typeenum pa_dac_ack_flagsenum wcd_mbhc_btn_det_memenum wcd_notify_eventenum wcd_mbhc_event_stateenum wcd_mbhc_hph_typeenum mbhc_hs_pullup_irefenum mbhc_hs_pullup_iref_v2enum mbhc_moisture_rreffunction wcd_dt_parse_mbhc_datafunction wcd_mbhc_stopfunction wcd_mbhc_set_hph_typefunction wcd_mbhc_event_notifyfunction wcd_mbhc_startfunction wcd_mbhc_get_impedancefunction wcd_mbhc_deinit
Annotated Snippet
struct wcd_mbhc_config {
int btn_high[WCD_MBHC_DEF_BUTTONS];
int btn_low[WCD_MBHC_DEF_BUTTONS];
int v_hs_max;
int num_btn;
bool mono_stero_detection;
bool typec_analog_mux;
bool (*swap_gnd_mic)(struct snd_soc_component *component);
bool hs_ext_micbias;
bool gnd_det_en;
uint32_t linein_th;
bool moisture_en;
int mbhc_micbias;
int anc_micbias;
bool moisture_duty_cycle_en;
bool hphl_swh; /*track HPHL switch NC / NO */
bool gnd_swh; /*track GND switch NC / NO */
u32 hs_thr;
u32 hph_thr;
u32 micb_mv;
u32 moist_vref;
u32 moist_iref;
u32 moist_rref;
};
struct wcd_mbhc_intr {
int mbhc_sw_intr;
int mbhc_btn_press_intr;
int mbhc_btn_release_intr;
int mbhc_hs_ins_intr;
int mbhc_hs_rem_intr;
int hph_left_ocp;
int hph_right_ocp;
};
struct wcd_mbhc_field {
u16 reg;
u8 mask;
};
struct wcd_mbhc;
struct wcd_mbhc_cb {
void (*update_cross_conn_thr)(struct snd_soc_component *component);
void (*get_micbias_val)(struct snd_soc_component *component, int *mb);
void (*bcs_enable)(struct snd_soc_component *component, bool bcs_enable);
void (*compute_impedance)(struct snd_soc_component *component,
uint32_t *zl, uint32_t *zr);
void (*set_micbias_value)(struct snd_soc_component *component);
void (*set_auto_zeroing)(struct snd_soc_component *component,
bool enable);
void (*clk_setup)(struct snd_soc_component *component, bool enable);
bool (*micbias_enable_status)(struct snd_soc_component *component, int micb_num);
void (*mbhc_bias)(struct snd_soc_component *component, bool enable);
void (*set_btn_thr)(struct snd_soc_component *component,
int *btn_low, int *btn_high,
int num_btn, bool is_micbias);
void (*hph_pull_up_control)(struct snd_soc_component *component,
enum mbhc_hs_pullup_iref);
int (*mbhc_micbias_control)(struct snd_soc_component *component,
int micb_num, int req);
void (*mbhc_micb_ramp_control)(struct snd_soc_component *component,
bool enable);
bool (*extn_use_mb)(struct snd_soc_component *component);
int (*mbhc_micb_ctrl_thr_mic)(struct snd_soc_component *component,
int micb_num, bool req_en);
void (*mbhc_gnd_det_ctrl)(struct snd_soc_component *component,
bool enable);
void (*hph_pull_down_ctrl)(struct snd_soc_component *component,
bool enable);
void (*mbhc_moisture_config)(struct snd_soc_component *component);
void (*update_anc_state)(struct snd_soc_component *component,
bool enable, int anc_num);
void (*hph_pull_up_control_v2)(struct snd_soc_component *component,
int pull_up_cur);
bool (*mbhc_get_moisture_status)(struct snd_soc_component *component);
void (*mbhc_moisture_polling_ctrl)(struct snd_soc_component *component, bool enable);
void (*mbhc_moisture_detect_en)(struct snd_soc_component *component, bool enable);
};
#if IS_ENABLED(CONFIG_SND_SOC_WCD_MBHC)
int wcd_dt_parse_mbhc_data(struct device *dev, struct wcd_mbhc_config *cfg);
int wcd_mbhc_start(struct wcd_mbhc *mbhc, struct wcd_mbhc_config *mbhc_cfg,
struct snd_soc_jack *jack);
void wcd_mbhc_stop(struct wcd_mbhc *mbhc);
void wcd_mbhc_set_hph_type(struct wcd_mbhc *mbhc, int hph_type);
int wcd_mbhc_get_hph_type(struct wcd_mbhc *mbhc);
int wcd_mbhc_typec_report_plug(struct wcd_mbhc *mbhc);
int wcd_mbhc_typec_report_unplug(struct wcd_mbhc *mbhc);
struct wcd_mbhc *wcd_mbhc_init(struct snd_soc_component *component,
Annotation
- Immediate include surface: `sound/jack.h`.
- Detected declarations: `struct wcd_mbhc_config`, `struct wcd_mbhc_intr`, `struct wcd_mbhc_field`, `struct wcd_mbhc`, `struct wcd_mbhc_cb`, `enum wcd_mbhc_field_function`, `enum wcd_mbhc_detect_logic`, `enum wcd_mbhc_cs_mb_en_flag`, `enum wcd_mbhc_plug_type`, `enum pa_dac_ack_flags`.
- 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.