#ifndef __WCD_MBHC_V2_H__
#define __WCD_MBHC_V2_H__
#include <sound/jack.h>
#define WCD_MBHC_FIELD(id, rreg, rmask) …
enum wcd_mbhc_field_function { … };
#define WCD_MBHC_DEF_BUTTONS …
#define WCD_MBHC_KEYCODE_NUM …
#define WCD_MBHC_USLEEP_RANGE_MARGIN_US …
#define WCD_MBHC_THR_HS_MICB_MV …
#define WCD_MONO_HS_MIN_THR …
enum wcd_mbhc_detect_logic { … };
enum wcd_mbhc_cs_mb_en_flag { … };
enum { … };
enum wcd_mbhc_plug_type { … };
enum pa_dac_ack_flags { … };
enum wcd_mbhc_btn_det_mem { … };
enum { … };
enum { … };
enum wcd_notify_event { … };
enum wcd_mbhc_event_state { … };
enum wcd_mbhc_hph_type { … };
enum mbhc_hs_pullup_iref { … };
enum mbhc_hs_pullup_iref_v2 { … };
enum mbhc_moisture_rref { … };
struct wcd_mbhc_config { … };
struct wcd_mbhc_intr { … };
struct wcd_mbhc_field { … };
struct wcd_mbhc;
struct wcd_mbhc_cb { … };
#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,
const struct wcd_mbhc_cb *mbhc_cb,
const struct wcd_mbhc_intr *mbhc_cdc_intr_ids,
const struct wcd_mbhc_field *fields,
bool impedance_det_en);
int wcd_mbhc_get_impedance(struct wcd_mbhc *mbhc, uint32_t *zl,
uint32_t *zr);
void wcd_mbhc_deinit(struct wcd_mbhc *mbhc);
int wcd_mbhc_event_notify(struct wcd_mbhc *mbhc, unsigned long event);
#else
static inline int wcd_dt_parse_mbhc_data(struct device *dev,
struct wcd_mbhc_config *cfg)
{
return -ENOTSUPP;
}
static inline void wcd_mbhc_stop(struct wcd_mbhc *mbhc)
{
}
static inline struct wcd_mbhc *wcd_mbhc_init(struct snd_soc_component *component,
const struct wcd_mbhc_cb *mbhc_cb,
const struct wcd_mbhc_intr *mbhc_cdc_intr_ids,
const struct wcd_mbhc_field *fields,
bool impedance_det_en)
{
return ERR_PTR(-ENOTSUPP);
}
static inline void wcd_mbhc_set_hph_type(struct wcd_mbhc *mbhc, int hph_type)
{
}
static inline int wcd_mbhc_get_hph_type(struct wcd_mbhc *mbhc)
{
return -ENOTSUPP;
}
static inline int wcd_mbhc_event_notify(struct wcd_mbhc *mbhc, unsigned long event)
{
return -ENOTSUPP;
}
static inline int wcd_mbhc_start(struct wcd_mbhc *mbhc,
struct wcd_mbhc_config *mbhc_cfg,
struct snd_soc_jack *jack)
{
return 0;
}
static inline int wcd_mbhc_get_impedance(struct wcd_mbhc *mbhc,
uint32_t *zl,
uint32_t *zr)
{
*zl = 0;
*zr = 0;
return -EINVAL;
}
static inline void wcd_mbhc_deinit(struct wcd_mbhc *mbhc)
{
}
#endif
#endif