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

Commit e443c085 authored by Sachin Mohan Gadag's avatar Sachin Mohan Gadag Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: codec: add hwdep node for digital codec for qcs605 LC target



Create hwdep node for qcs605 LC target which supports digital codec.

Change-Id: Ie6ba8d047d9a906bbcf947f4abce34ceca3dce76
Signed-off-by: default avatarSachin Mohan Gadag <sgadag@codeaurora.org>
parent fc4d749d
Loading
Loading
Loading
Loading
+19 −5
Original line number Diff line number Diff line
@@ -1391,7 +1391,21 @@ static int msm_dig_cdc_soc_probe(struct snd_soc_codec *codec)
	atomic_set(&msm_dig_cdc->on_demand_list[ON_DEMAND_DIGITAL].ref, 0);

	registered_digcodec = codec;
	if (msm_dig_cdc->no_analog_codec) {
		msm_dig_cdc->fw_data = devm_kzalloc(codec->dev,
					    sizeof(*(msm_dig_cdc->fw_data)),
					    GFP_KERNEL);
		if (!msm_dig_cdc->fw_data)
			return -ENOMEM;

		ret = wcd_cal_create_hwdep(msm_dig_cdc->fw_data,
			WCD9XXX_CODEC_HWDEP_NODE, codec);
		if (ret < 0) {
			dev_err(codec->dev, "%s hwdep failed %d\n", __func__,
				ret);
			return ret;
		}
	}
	snd_soc_dapm_ignore_suspend(dapm, "AIF1 Playback");
	snd_soc_dapm_ignore_suspend(dapm, "AIF1 Capture");
	snd_soc_dapm_ignore_suspend(dapm, "ADC1_IN");
@@ -2469,7 +2483,6 @@ static int msm_dig_cdc_probe(struct platform_device *pdev)
	u32 dig_cdc_addr;
	struct msm_dig_priv *msm_dig_cdc;
	struct dig_ctrl_platform_data *pdata = NULL;
	bool no_analog_codec = false;
	int adsp_state;

	adsp_state = apr_get_subsys_state();
@@ -2491,10 +2504,11 @@ static int msm_dig_cdc_probe(struct platform_device *pdev)
		return -EINVAL;

	if (pdev->dev.of_node)
		no_analog_codec = of_property_read_bool(pdev->dev.of_node,
		msm_dig_cdc->no_analog_codec = of_property_read_bool(
					pdev->dev.of_node,
					"qcom,no-analog-codec");

	if (no_analog_codec) {
	if (msm_dig_cdc->no_analog_codec) {
		dev_dbg(&pdev->dev, "%s:Platform data from device tree\n",
				__func__);
		if (msm_digital_cdc_populate_dt_pdata(&pdev->dev,
@@ -2549,7 +2563,7 @@ static int msm_dig_cdc_probe(struct platform_device *pdev)
			__func__, dig_cdc_addr);
	return ret;
err_supplies:
	if (no_analog_codec)
	if (msm_dig_cdc->no_analog_codec)
		msm_digital_cdc_disable_supplies(msm_dig_cdc);
rtn:
	return ret;
+3 −0
Original line number Diff line number Diff line
@@ -73,6 +73,9 @@ struct msm_dig_priv {
	s32 dmic_3_4_clk_cnt;
	bool dec_active[NUM_DECIMATORS];
	int version;
	/* cal info for codec */
	struct fw_info *fw_data;
	bool no_analog_codec;
	/* Entry for version info */
	struct snd_info_entry *entry;
	struct snd_info_entry *version_entry;