Loading sound/soc/codecs/msm8x10-wcd.c +36 −14 Original line number Original line Diff line number Diff line Loading @@ -3163,9 +3163,25 @@ static int msm8x10_wcd_device_down(struct snd_soc_codec *codec) return 0; return 0; } } static const struct wcd9xxx_mbhc_intr cdc_intr_ids = { .poll_plug_rem = MSM8X10_WCD_IRQ_MBHC_REMOVAL, .shortavg_complete = MSM8X10_WCD_IRQ_MBHC_SHORT_TERM, .potential_button_press = MSM8X10_WCD_IRQ_MBHC_PRESS, .button_release = MSM8X10_WCD_IRQ_MBHC_RELEASE, .dce_est_complete = MSM8X10_WCD_IRQ_MBHC_POTENTIAL, .insertion = MSM8X10_WCD_IRQ_MBHC_INSERTION, .hph_left_ocp = MSM8X10_WCD_IRQ_HPH_PA_OCPL_FAULT, .hph_right_ocp = MSM8X10_WCD_IRQ_HPH_PA_OCPR_FAULT, .hs_jack_switch = MSM8X10_WCD_IRQ_MBHC_HS_DET, }; static int msm8x10_wcd_device_up(struct snd_soc_codec *codec) static int msm8x10_wcd_device_up(struct snd_soc_codec *codec) { { dev_dbg(codec->dev, "%s: device up!\n", __func__); int ret = 0; struct msm8x10_wcd_priv *msm8x10_wcd_priv = snd_soc_codec_get_drvdata(codec); dev_err(codec->dev, "%s: device up!\n", __func__); snd_soc_card_change_online_state(codec->card, 1); snd_soc_card_change_online_state(codec->card, 1); /* delay is required to make sure sound card state updated */ /* delay is required to make sure sound card state updated */ Loading @@ -3174,9 +3190,27 @@ static int msm8x10_wcd_device_up(struct snd_soc_codec *codec) mutex_lock(&codec->mutex); mutex_lock(&codec->mutex); msm8x10_wcd_bringup(codec); msm8x10_wcd_bringup(codec); msm8x10_wcd_codec_init_reg(codec); msm8x10_wcd_update_reg_defaults(codec); msm8x10_wcd_update_reg_defaults(codec); msm8x10_wcd_codec_init_reg(codec); wcd9xxx_resmgr_post_ssr(&msm8x10_wcd_priv->resmgr); wcd9xxx_mbhc_deinit(&msm8x10_wcd_priv->mbhc); ret = wcd9xxx_mbhc_init(&msm8x10_wcd_priv->mbhc, &msm8x10_wcd_priv->resmgr, codec, msm8x10_wcd_enable_mbhc_micbias, &mbhc_cb, &cdc_intr_ids, HELICON_MCLK_CLK_9P6MHZ, true); if (ret) dev_err(codec->dev, "%s: Failed to initialize mbhc\n", __func__); else wcd9xxx_mbhc_start(&msm8x10_wcd_priv->mbhc, msm8x10_wcd_priv->mbhc.mbhc_cfg); mutex_unlock(&codec->mutex); mutex_unlock(&codec->mutex); return 0; return 0; Loading Loading @@ -3221,18 +3255,6 @@ static struct notifier_block adsp_state_notifier_block = { .priority = -INT_MAX, .priority = -INT_MAX, }; }; static const struct wcd9xxx_mbhc_intr cdc_intr_ids = { .poll_plug_rem = MSM8X10_WCD_IRQ_MBHC_REMOVAL, .shortavg_complete = MSM8X10_WCD_IRQ_MBHC_SHORT_TERM, .potential_button_press = MSM8X10_WCD_IRQ_MBHC_PRESS, .button_release = MSM8X10_WCD_IRQ_MBHC_RELEASE, .dce_est_complete = MSM8X10_WCD_IRQ_MBHC_POTENTIAL, .insertion = MSM8X10_WCD_IRQ_MBHC_INSERTION, .hph_left_ocp = MSM8X10_WCD_IRQ_HPH_PA_OCPL_FAULT, .hph_right_ocp = MSM8X10_WCD_IRQ_HPH_PA_OCPR_FAULT, .hs_jack_switch = MSM8X10_WCD_IRQ_MBHC_HS_DET, }; static int msm8x10_wcd_handle_pdata(struct snd_soc_codec *codec, static int msm8x10_wcd_handle_pdata(struct snd_soc_codec *codec, struct msm8x10_wcd_pdata *pdata) struct msm8x10_wcd_pdata *pdata) { { Loading Loading
sound/soc/codecs/msm8x10-wcd.c +36 −14 Original line number Original line Diff line number Diff line Loading @@ -3163,9 +3163,25 @@ static int msm8x10_wcd_device_down(struct snd_soc_codec *codec) return 0; return 0; } } static const struct wcd9xxx_mbhc_intr cdc_intr_ids = { .poll_plug_rem = MSM8X10_WCD_IRQ_MBHC_REMOVAL, .shortavg_complete = MSM8X10_WCD_IRQ_MBHC_SHORT_TERM, .potential_button_press = MSM8X10_WCD_IRQ_MBHC_PRESS, .button_release = MSM8X10_WCD_IRQ_MBHC_RELEASE, .dce_est_complete = MSM8X10_WCD_IRQ_MBHC_POTENTIAL, .insertion = MSM8X10_WCD_IRQ_MBHC_INSERTION, .hph_left_ocp = MSM8X10_WCD_IRQ_HPH_PA_OCPL_FAULT, .hph_right_ocp = MSM8X10_WCD_IRQ_HPH_PA_OCPR_FAULT, .hs_jack_switch = MSM8X10_WCD_IRQ_MBHC_HS_DET, }; static int msm8x10_wcd_device_up(struct snd_soc_codec *codec) static int msm8x10_wcd_device_up(struct snd_soc_codec *codec) { { dev_dbg(codec->dev, "%s: device up!\n", __func__); int ret = 0; struct msm8x10_wcd_priv *msm8x10_wcd_priv = snd_soc_codec_get_drvdata(codec); dev_err(codec->dev, "%s: device up!\n", __func__); snd_soc_card_change_online_state(codec->card, 1); snd_soc_card_change_online_state(codec->card, 1); /* delay is required to make sure sound card state updated */ /* delay is required to make sure sound card state updated */ Loading @@ -3174,9 +3190,27 @@ static int msm8x10_wcd_device_up(struct snd_soc_codec *codec) mutex_lock(&codec->mutex); mutex_lock(&codec->mutex); msm8x10_wcd_bringup(codec); msm8x10_wcd_bringup(codec); msm8x10_wcd_codec_init_reg(codec); msm8x10_wcd_update_reg_defaults(codec); msm8x10_wcd_update_reg_defaults(codec); msm8x10_wcd_codec_init_reg(codec); wcd9xxx_resmgr_post_ssr(&msm8x10_wcd_priv->resmgr); wcd9xxx_mbhc_deinit(&msm8x10_wcd_priv->mbhc); ret = wcd9xxx_mbhc_init(&msm8x10_wcd_priv->mbhc, &msm8x10_wcd_priv->resmgr, codec, msm8x10_wcd_enable_mbhc_micbias, &mbhc_cb, &cdc_intr_ids, HELICON_MCLK_CLK_9P6MHZ, true); if (ret) dev_err(codec->dev, "%s: Failed to initialize mbhc\n", __func__); else wcd9xxx_mbhc_start(&msm8x10_wcd_priv->mbhc, msm8x10_wcd_priv->mbhc.mbhc_cfg); mutex_unlock(&codec->mutex); mutex_unlock(&codec->mutex); return 0; return 0; Loading Loading @@ -3221,18 +3255,6 @@ static struct notifier_block adsp_state_notifier_block = { .priority = -INT_MAX, .priority = -INT_MAX, }; }; static const struct wcd9xxx_mbhc_intr cdc_intr_ids = { .poll_plug_rem = MSM8X10_WCD_IRQ_MBHC_REMOVAL, .shortavg_complete = MSM8X10_WCD_IRQ_MBHC_SHORT_TERM, .potential_button_press = MSM8X10_WCD_IRQ_MBHC_PRESS, .button_release = MSM8X10_WCD_IRQ_MBHC_RELEASE, .dce_est_complete = MSM8X10_WCD_IRQ_MBHC_POTENTIAL, .insertion = MSM8X10_WCD_IRQ_MBHC_INSERTION, .hph_left_ocp = MSM8X10_WCD_IRQ_HPH_PA_OCPL_FAULT, .hph_right_ocp = MSM8X10_WCD_IRQ_HPH_PA_OCPR_FAULT, .hs_jack_switch = MSM8X10_WCD_IRQ_MBHC_HS_DET, }; static int msm8x10_wcd_handle_pdata(struct snd_soc_codec *codec, static int msm8x10_wcd_handle_pdata(struct snd_soc_codec *codec, struct msm8x10_wcd_pdata *pdata) struct msm8x10_wcd_pdata *pdata) { { Loading