Loading sound/soc/codecs/msm8x16-wcd.c +6 −3 Original line number Diff line number Diff line Loading @@ -320,7 +320,7 @@ static int __msm8x16_wcd_reg_read(struct snd_soc_codec *codec, unsigned short reg) { int ret = -EINVAL; u8 temp; u8 temp = 0; struct msm8x16_wcd *msm8x16_wcd = codec->control_data; struct msm8916_asoc_mach_data *pdata = NULL; Loading @@ -340,13 +340,14 @@ static int __msm8x16_wcd_reg_read(struct snd_soc_codec *codec, &pdata->digital_cdc_clk); if (ret < 0) { pr_err("failed to enable the MCLK\n"); return 0; goto err; } pr_debug("%s: MCLK not enabled\n", __func__); atomic_set(&pdata->dis_work_mclk, true); schedule_delayed_work(&pdata->enable_mclk_work, 50); ret = msm8x16_wcd_ahb_read_device( msm8x16_wcd, reg, 1, &temp); err: mutex_unlock(&pdata->cdc_mclk_mutex); mutex_unlock(&msm8x16_wcd->io_lock); return temp; Loading Loading @@ -391,12 +392,14 @@ static int __msm8x16_wcd_reg_write(struct snd_soc_codec *codec, &pdata->digital_cdc_clk); if (ret < 0) { pr_err("failed to enable the MCLK\n"); return 0; ret = 0; goto err; } atomic_set(&pdata->dis_work_mclk, true); schedule_delayed_work(&pdata->enable_mclk_work, 50); ret = msm8x16_wcd_ahb_write_device( msm8x16_wcd, reg, &val, 1); err: mutex_unlock(&pdata->cdc_mclk_mutex); mutex_unlock(&msm8x16_wcd->io_lock); return ret; Loading sound/soc/msm/msm8x16.c +3 −2 Original line number Diff line number Diff line Loading @@ -308,7 +308,7 @@ static int msm8x16_enable_codec_ext_clk(struct snd_soc_codec *codec, pdata = snd_soc_card_get_drvdata(codec->card); mutex_lock(&pdata->cdc_mclk_mutex); pr_err("%s: enable = %d codec name %s enable %d mclk ref counter %d\n", pr_debug("%s: enable = %d codec name %s enable %d mclk ref counter %d\n", __func__, enable, codec->name, enable, atomic_read(&pdata->mclk_rsc_ref)); if (enable) { Loading @@ -321,7 +321,7 @@ static int msm8x16_enable_codec_ext_clk(struct snd_soc_codec *codec, cancel_delayed_work_sync(&pdata->enable_mclk_work); } } else { if (atomic_dec_return(&pdata->mclk_rsc_ref) == 0) { if ((atomic_read(&pdata->mclk_rsc_ref) - 1) == 0) { pdata->digital_cdc_clk.clk_val = 0; msm8x16_wcd_mclk_enable(codec, 0, dapm); afe_set_digital_codec_core_clock( Loading @@ -334,6 +334,7 @@ static int msm8x16_enable_codec_ext_clk(struct snd_soc_codec *codec, &pdata->enable_mclk_work, 10); } } atomic_dec(&pdata->mclk_rsc_ref); } mutex_unlock(&pdata->cdc_mclk_mutex); return ret; Loading Loading
sound/soc/codecs/msm8x16-wcd.c +6 −3 Original line number Diff line number Diff line Loading @@ -320,7 +320,7 @@ static int __msm8x16_wcd_reg_read(struct snd_soc_codec *codec, unsigned short reg) { int ret = -EINVAL; u8 temp; u8 temp = 0; struct msm8x16_wcd *msm8x16_wcd = codec->control_data; struct msm8916_asoc_mach_data *pdata = NULL; Loading @@ -340,13 +340,14 @@ static int __msm8x16_wcd_reg_read(struct snd_soc_codec *codec, &pdata->digital_cdc_clk); if (ret < 0) { pr_err("failed to enable the MCLK\n"); return 0; goto err; } pr_debug("%s: MCLK not enabled\n", __func__); atomic_set(&pdata->dis_work_mclk, true); schedule_delayed_work(&pdata->enable_mclk_work, 50); ret = msm8x16_wcd_ahb_read_device( msm8x16_wcd, reg, 1, &temp); err: mutex_unlock(&pdata->cdc_mclk_mutex); mutex_unlock(&msm8x16_wcd->io_lock); return temp; Loading Loading @@ -391,12 +392,14 @@ static int __msm8x16_wcd_reg_write(struct snd_soc_codec *codec, &pdata->digital_cdc_clk); if (ret < 0) { pr_err("failed to enable the MCLK\n"); return 0; ret = 0; goto err; } atomic_set(&pdata->dis_work_mclk, true); schedule_delayed_work(&pdata->enable_mclk_work, 50); ret = msm8x16_wcd_ahb_write_device( msm8x16_wcd, reg, &val, 1); err: mutex_unlock(&pdata->cdc_mclk_mutex); mutex_unlock(&msm8x16_wcd->io_lock); return ret; Loading
sound/soc/msm/msm8x16.c +3 −2 Original line number Diff line number Diff line Loading @@ -308,7 +308,7 @@ static int msm8x16_enable_codec_ext_clk(struct snd_soc_codec *codec, pdata = snd_soc_card_get_drvdata(codec->card); mutex_lock(&pdata->cdc_mclk_mutex); pr_err("%s: enable = %d codec name %s enable %d mclk ref counter %d\n", pr_debug("%s: enable = %d codec name %s enable %d mclk ref counter %d\n", __func__, enable, codec->name, enable, atomic_read(&pdata->mclk_rsc_ref)); if (enable) { Loading @@ -321,7 +321,7 @@ static int msm8x16_enable_codec_ext_clk(struct snd_soc_codec *codec, cancel_delayed_work_sync(&pdata->enable_mclk_work); } } else { if (atomic_dec_return(&pdata->mclk_rsc_ref) == 0) { if ((atomic_read(&pdata->mclk_rsc_ref) - 1) == 0) { pdata->digital_cdc_clk.clk_val = 0; msm8x16_wcd_mclk_enable(codec, 0, dapm); afe_set_digital_codec_core_clock( Loading @@ -334,6 +334,7 @@ static int msm8x16_enable_codec_ext_clk(struct snd_soc_codec *codec, &pdata->enable_mclk_work, 10); } } atomic_dec(&pdata->mclk_rsc_ref); } mutex_unlock(&pdata->cdc_mclk_mutex); return ret; Loading