Loading asoc/codecs/wcd937x/wcd937x-mbhc.c +25 −2 Original line number Diff line number Diff line Loading @@ -955,6 +955,31 @@ void wcd937x_mbhc_hs_detect_exit(struct snd_soc_codec *codec) } EXPORT_SYMBOL(wcd937x_mbhc_hs_detect_exit); /* * wcd937x_mbhc_ssr_down: stop mbhc during * wcd937x subsystem restart * @mbhc: pointer to wcd937x_mbhc structure * @codec: handle to snd_soc_codec * */ void wcd937x_mbhc_ssr_down(struct wcd937x_mbhc *mbhc, struct snd_soc_codec *codec) { struct wcd_mbhc *wcd_mbhc = NULL; if (!mbhc || !codec) return; wcd_mbhc = &mbhc->wcd_mbhc; if (wcd_mbhc == NULL) { dev_err(codec->dev, "%s: wcd_mbhc is NULL\n", __func__); return; } wcd937x_mbhc_hs_detect_exit(codec); wcd_mbhc_deinit(wcd_mbhc); } EXPORT_SYMBOL(wcd937x_mbhc_ssr_down); /* * wcd937x_mbhc_post_ssr_init: initialize mbhc for * wcd937x post subsystem restart Loading @@ -978,8 +1003,6 @@ int wcd937x_mbhc_post_ssr_init(struct wcd937x_mbhc *mbhc, return -EINVAL; } wcd937x_mbhc_hs_detect_exit(codec); wcd_mbhc_deinit(wcd_mbhc); snd_soc_update_bits(codec, WCD937X_ANA_MBHC_MECH, 0x20, 0x20); ret = wcd_mbhc_init(wcd_mbhc, codec, &mbhc_cb, &intr_ids, Loading asoc/codecs/wcd937x/wcd937x-mbhc.h +7 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ extern int wcd937x_mbhc_hs_detect(struct snd_soc_codec *codec, extern void wcd937x_mbhc_deinit(struct snd_soc_codec *codec); extern int wcd937x_mbhc_post_ssr_init(struct wcd937x_mbhc *mbhc, struct snd_soc_codec *codec); extern void wcd937x_mbhc_ssr_down(struct wcd937x_mbhc *mbhc, struct snd_soc_codec *codec); extern int wcd937x_mbhc_get_impedance(struct wcd937x_mbhc *wcd937x_mbhc, uint32_t *zl, uint32_t *zr); #else Loading @@ -54,7 +56,11 @@ static inline int wcd937x_mbhc_post_ssr_init(struct wcd937x_mbhc *mbhc, { return 0; } static inline void wcd937x_mbhc_ssr_down(struct wcd937x_mbhc *mbhc, struct snd_soc_codec *codec) { return 0; } static inline int wcd937x_mbhc_get_impedance(struct wcd937x_mbhc *wcd937x_mbhc, uint32_t *zl, uint32_t *zr) { Loading asoc/codecs/wcd937x/wcd937x.c +2 −0 Original line number Diff line number Diff line Loading @@ -1352,6 +1352,8 @@ static int wcd937x_event_notify(struct notifier_block *block, snd_soc_update_bits(codec, WCD937X_AUX_AUXPA, 0x80, 0x00); break; case BOLERO_WCD_EVT_SSR_DOWN: mbhc = &wcd937x->mbhc->wcd_mbhc; wcd937x_mbhc_ssr_down(wcd937x->mbhc, codec); wcd937x_reset_low(wcd937x->dev); break; case BOLERO_WCD_EVT_SSR_UP: Loading Loading
asoc/codecs/wcd937x/wcd937x-mbhc.c +25 −2 Original line number Diff line number Diff line Loading @@ -955,6 +955,31 @@ void wcd937x_mbhc_hs_detect_exit(struct snd_soc_codec *codec) } EXPORT_SYMBOL(wcd937x_mbhc_hs_detect_exit); /* * wcd937x_mbhc_ssr_down: stop mbhc during * wcd937x subsystem restart * @mbhc: pointer to wcd937x_mbhc structure * @codec: handle to snd_soc_codec * */ void wcd937x_mbhc_ssr_down(struct wcd937x_mbhc *mbhc, struct snd_soc_codec *codec) { struct wcd_mbhc *wcd_mbhc = NULL; if (!mbhc || !codec) return; wcd_mbhc = &mbhc->wcd_mbhc; if (wcd_mbhc == NULL) { dev_err(codec->dev, "%s: wcd_mbhc is NULL\n", __func__); return; } wcd937x_mbhc_hs_detect_exit(codec); wcd_mbhc_deinit(wcd_mbhc); } EXPORT_SYMBOL(wcd937x_mbhc_ssr_down); /* * wcd937x_mbhc_post_ssr_init: initialize mbhc for * wcd937x post subsystem restart Loading @@ -978,8 +1003,6 @@ int wcd937x_mbhc_post_ssr_init(struct wcd937x_mbhc *mbhc, return -EINVAL; } wcd937x_mbhc_hs_detect_exit(codec); wcd_mbhc_deinit(wcd_mbhc); snd_soc_update_bits(codec, WCD937X_ANA_MBHC_MECH, 0x20, 0x20); ret = wcd_mbhc_init(wcd_mbhc, codec, &mbhc_cb, &intr_ids, Loading
asoc/codecs/wcd937x/wcd937x-mbhc.h +7 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ extern int wcd937x_mbhc_hs_detect(struct snd_soc_codec *codec, extern void wcd937x_mbhc_deinit(struct snd_soc_codec *codec); extern int wcd937x_mbhc_post_ssr_init(struct wcd937x_mbhc *mbhc, struct snd_soc_codec *codec); extern void wcd937x_mbhc_ssr_down(struct wcd937x_mbhc *mbhc, struct snd_soc_codec *codec); extern int wcd937x_mbhc_get_impedance(struct wcd937x_mbhc *wcd937x_mbhc, uint32_t *zl, uint32_t *zr); #else Loading @@ -54,7 +56,11 @@ static inline int wcd937x_mbhc_post_ssr_init(struct wcd937x_mbhc *mbhc, { return 0; } static inline void wcd937x_mbhc_ssr_down(struct wcd937x_mbhc *mbhc, struct snd_soc_codec *codec) { return 0; } static inline int wcd937x_mbhc_get_impedance(struct wcd937x_mbhc *wcd937x_mbhc, uint32_t *zl, uint32_t *zr) { Loading
asoc/codecs/wcd937x/wcd937x.c +2 −0 Original line number Diff line number Diff line Loading @@ -1352,6 +1352,8 @@ static int wcd937x_event_notify(struct notifier_block *block, snd_soc_update_bits(codec, WCD937X_AUX_AUXPA, 0x80, 0x00); break; case BOLERO_WCD_EVT_SSR_DOWN: mbhc = &wcd937x->mbhc->wcd_mbhc; wcd937x_mbhc_ssr_down(wcd937x->mbhc, codec); wcd937x_reset_low(wcd937x->dev); break; case BOLERO_WCD_EVT_SSR_UP: Loading