Loading sound/soc/codecs/sdm660_cdc/msm-analog-cdc.c +0 −16 Original line number Diff line number Diff line Loading @@ -3772,7 +3772,6 @@ static int msm_anlg_cdc_device_up(struct snd_soc_codec *codec) { struct sdm660_cdc_priv *sdm660_cdc_priv = snd_soc_codec_get_drvdata(codec); int ret = 0; dev_dbg(codec->dev, "%s: device up!\n", __func__); Loading @@ -3794,21 +3793,6 @@ static int msm_anlg_cdc_device_up(struct snd_soc_codec *codec) else if (sdm660_cdc_priv->boost_option == BYPASS_ALWAYS) msm_anlg_cdc_bypass_on(codec); msm_anlg_cdc_configure_cap(codec, false, false); wcd_mbhc_stop(&sdm660_cdc_priv->mbhc); wcd_mbhc_deinit(&sdm660_cdc_priv->mbhc); /* Disable mechanical detection and set type to insertion */ snd_soc_update_bits(codec, MSM89XX_PMIC_ANALOG_MBHC_DET_CTL_1, 0xA0, 0x20); ret = wcd_mbhc_init(&sdm660_cdc_priv->mbhc, codec, &mbhc_cb, &intr_ids, wcd_mbhc_registers, true); if (ret) dev_err(codec->dev, "%s: mbhc initialization failed\n", __func__); else wcd_mbhc_start(&sdm660_cdc_priv->mbhc, sdm660_cdc_priv->mbhc.mbhc_cfg); return 0; } Loading sound/soc/msm/sdm660-internal.c +31 −9 Original line number Diff line number Diff line Loading @@ -1301,15 +1301,6 @@ static int msm_audrx_init(struct snd_soc_pcm_runtime *rtd) msm_anlg_cdc_spk_ext_pa_cb(enable_spk_ext_pa, ana_cdc); msm_dig_cdc_hph_comp_cb(msm_config_hph_compander_gpio, dig_cdc); mbhc_cfg_ptr->calibration = def_msm_int_wcd_mbhc_cal(); if (mbhc_cfg_ptr->calibration) { ret = msm_anlg_cdc_hs_detect(ana_cdc, mbhc_cfg_ptr); if (ret) { pr_err("%s: msm_anlg_cdc_hs_detect failed\n", __func__); kfree(mbhc_cfg_ptr->calibration); return ret; } } card = rtd->card->snd_card; if (!codec_root) codec_root = snd_register_module_info(card->module, "codecs", Loading Loading @@ -1569,6 +1560,36 @@ end: return ret; } static int msm_snd_card_late_probe(struct snd_soc_card *card) { const char *be_dl_name = LPASS_BE_INT0_MI2S_RX; struct snd_soc_codec *ana_cdc; struct snd_soc_pcm_runtime *rtd; int ret = 0; rtd = snd_soc_get_pcm_runtime(card, be_dl_name); if (!rtd) { dev_err(card->dev, "%s: snd_soc_get_pcm_runtime for %s failed!\n", __func__, be_dl_name); return -EINVAL; } ana_cdc = rtd->codec_dais[ANA_CDC]->codec; mbhc_cfg_ptr->calibration = def_msm_int_wcd_mbhc_cal(); if (!mbhc_cfg_ptr->calibration) return -ENOMEM; ret = msm_anlg_cdc_hs_detect(ana_cdc, mbhc_cfg_ptr); if (ret) { dev_err(card->dev, "%s: msm_anlg_cdc_hs_detect failed\n", __func__); kfree(mbhc_cfg_ptr->calibration); } return ret; } static struct snd_soc_ops msm_tdm_be_ops = { .hw_params = msm_tdm_snd_hw_params }; Loading Loading @@ -2930,6 +2951,7 @@ static struct snd_soc_card sdm660_card = { .name = "sdm660-snd-card", .dai_link = msm_int_dai, .num_links = ARRAY_SIZE(msm_int_dai), .late_probe = msm_snd_card_late_probe, }; static void msm_disable_int_mclk0(struct work_struct *work) Loading Loading
sound/soc/codecs/sdm660_cdc/msm-analog-cdc.c +0 −16 Original line number Diff line number Diff line Loading @@ -3772,7 +3772,6 @@ static int msm_anlg_cdc_device_up(struct snd_soc_codec *codec) { struct sdm660_cdc_priv *sdm660_cdc_priv = snd_soc_codec_get_drvdata(codec); int ret = 0; dev_dbg(codec->dev, "%s: device up!\n", __func__); Loading @@ -3794,21 +3793,6 @@ static int msm_anlg_cdc_device_up(struct snd_soc_codec *codec) else if (sdm660_cdc_priv->boost_option == BYPASS_ALWAYS) msm_anlg_cdc_bypass_on(codec); msm_anlg_cdc_configure_cap(codec, false, false); wcd_mbhc_stop(&sdm660_cdc_priv->mbhc); wcd_mbhc_deinit(&sdm660_cdc_priv->mbhc); /* Disable mechanical detection and set type to insertion */ snd_soc_update_bits(codec, MSM89XX_PMIC_ANALOG_MBHC_DET_CTL_1, 0xA0, 0x20); ret = wcd_mbhc_init(&sdm660_cdc_priv->mbhc, codec, &mbhc_cb, &intr_ids, wcd_mbhc_registers, true); if (ret) dev_err(codec->dev, "%s: mbhc initialization failed\n", __func__); else wcd_mbhc_start(&sdm660_cdc_priv->mbhc, sdm660_cdc_priv->mbhc.mbhc_cfg); return 0; } Loading
sound/soc/msm/sdm660-internal.c +31 −9 Original line number Diff line number Diff line Loading @@ -1301,15 +1301,6 @@ static int msm_audrx_init(struct snd_soc_pcm_runtime *rtd) msm_anlg_cdc_spk_ext_pa_cb(enable_spk_ext_pa, ana_cdc); msm_dig_cdc_hph_comp_cb(msm_config_hph_compander_gpio, dig_cdc); mbhc_cfg_ptr->calibration = def_msm_int_wcd_mbhc_cal(); if (mbhc_cfg_ptr->calibration) { ret = msm_anlg_cdc_hs_detect(ana_cdc, mbhc_cfg_ptr); if (ret) { pr_err("%s: msm_anlg_cdc_hs_detect failed\n", __func__); kfree(mbhc_cfg_ptr->calibration); return ret; } } card = rtd->card->snd_card; if (!codec_root) codec_root = snd_register_module_info(card->module, "codecs", Loading Loading @@ -1569,6 +1560,36 @@ end: return ret; } static int msm_snd_card_late_probe(struct snd_soc_card *card) { const char *be_dl_name = LPASS_BE_INT0_MI2S_RX; struct snd_soc_codec *ana_cdc; struct snd_soc_pcm_runtime *rtd; int ret = 0; rtd = snd_soc_get_pcm_runtime(card, be_dl_name); if (!rtd) { dev_err(card->dev, "%s: snd_soc_get_pcm_runtime for %s failed!\n", __func__, be_dl_name); return -EINVAL; } ana_cdc = rtd->codec_dais[ANA_CDC]->codec; mbhc_cfg_ptr->calibration = def_msm_int_wcd_mbhc_cal(); if (!mbhc_cfg_ptr->calibration) return -ENOMEM; ret = msm_anlg_cdc_hs_detect(ana_cdc, mbhc_cfg_ptr); if (ret) { dev_err(card->dev, "%s: msm_anlg_cdc_hs_detect failed\n", __func__); kfree(mbhc_cfg_ptr->calibration); } return ret; } static struct snd_soc_ops msm_tdm_be_ops = { .hw_params = msm_tdm_snd_hw_params }; Loading Loading @@ -2930,6 +2951,7 @@ static struct snd_soc_card sdm660_card = { .name = "sdm660-snd-card", .dai_link = msm_int_dai, .num_links = ARRAY_SIZE(msm_int_dai), .late_probe = msm_snd_card_late_probe, }; static void msm_disable_int_mclk0(struct work_struct *work) Loading