Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc0f6a78 authored by Karthikeyan Mani's avatar Karthikeyan Mani Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: wcd934x: Fix mbhc errors upon removing SND_SOC_WCD934X_MBHC



Fix any mbhc related error seen in code compilation
when SND_SOC_WCD934X_MBHC is removed in Kconfig for
disabling mbhc. Add stub inline functions for any mbhc
function when SND_SOC_WCD934X_MBHC is not defined.

CRs-fixed: 2006189
Change-Id: I7222df8cd59ff751bf2109430ce0a0a496a76eb9
Signed-off-by: default avatarKarthikeyan Mani <kmani@codeaurora.org>
parent e3a1dc7e
Loading
Loading
Loading
Loading
+35 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ struct wcd934x_mbhc {
	bool is_hph_recover;
};

#ifdef CONFIG_SND_SOC_WCD934X_MBHC
extern int tavil_mbhc_init(struct wcd934x_mbhc **mbhc,
			   struct snd_soc_codec *codec,
			   struct fw_info *fw_data);
@@ -46,4 +47,38 @@ extern int tavil_mbhc_post_ssr_init(struct wcd934x_mbhc *mbhc,
				    struct snd_soc_codec *codec);
extern int tavil_mbhc_get_impedance(struct wcd934x_mbhc *wcd934x_mbhc,
				    uint32_t *zl, uint32_t *zr);
#else
static inline int tavil_mbhc_init(struct wcd934x_mbhc **mbhc,
				  struct snd_soc_codec *codec,
				  struct fw_info *fw_data)
{
	return 0;
}
static inline void tavil_mbhc_hs_detect_exit(struct snd_soc_codec *codec)
{
}
static inline int tavil_mbhc_hs_detect(struct snd_soc_codec *codec,
				       struct wcd_mbhc_config *mbhc_cfg)
{
		return 0;
}
static inline void tavil_mbhc_deinit(struct snd_soc_codec *codec)
{
}
static inline int tavil_mbhc_post_ssr_init(struct wcd934x_mbhc *mbhc,
					   struct snd_soc_codec *codec)
{
	return 0;
}
static inline int tavil_mbhc_get_impedance(struct wcd934x_mbhc *wcd934x_mbhc,
					   uint32_t *zl, uint32_t *zr)
{
	if (zl)
		*zl = 0;
	if (zr)
		*zr = 0;
	return -EINVAL;
}
#endif

#endif /* __WCD934X_MBHC_H__ */