diff options
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/mediatek/mt8186/mt8186-dai-adda.c | 5 | ||||
-rw-r--r-- | sound/soc/mediatek/mt8186/mt8186-dai-i2s.c | 63 | ||||
-rw-r--r-- | sound/soc/mediatek/mt8186/mt8186-dai-pcm.c | 5 | ||||
-rw-r--r-- | sound/soc/mediatek/mt8186/mt8186-dai-tdm.c | 55 |
4 files changed, 1 insertions, 127 deletions
diff --git a/sound/soc/mediatek/mt8186/mt8186-dai-adda.c b/sound/soc/mediatek/mt8186/mt8186-dai-adda.c index c226d3dace31..266704556f37 100644 --- a/sound/soc/mediatek/mt8186/mt8186-dai-adda.c +++ b/sound/soc/mediatek/mt8186/mt8186-dai-adda.c @@ -654,11 +654,6 @@ static int mtk_dai_adda_hw_params(struct snd_pcm_substream *substream, dev_dbg(afe->dev, "%s(), id %d, stream %d, rate %d\n", __func__, id, substream->stream, rate); - if (!adda_priv) { - dev_err(afe->dev, "%s(), adda_priv == NULL", __func__); - return -EINVAL; - } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { unsigned int dl_src2_con0; unsigned int dl_src2_con1; diff --git a/sound/soc/mediatek/mt8186/mt8186-dai-i2s.c b/sound/soc/mediatek/mt8186/mt8186-dai-i2s.c index 5c1290b950e8..ec79e2f2a54d 100644 --- a/sound/soc/mediatek/mt8186/mt8186-dai-i2s.c +++ b/sound/soc/mediatek/mt8186/mt8186-dai-i2s.c @@ -119,12 +119,6 @@ static int mt8186_i2s_hd_get(struct snd_kcontrol *kcontrol, struct mtk_afe_i2s_priv *i2s_priv; i2s_priv = get_i2s_priv_by_name(afe, kcontrol->id.name); - - if (!i2s_priv) { - dev_err(afe->dev, "%s(), i2s_priv == NULL", __func__); - return -EINVAL; - } - ucontrol->value.integer.value[0] = i2s_priv->low_jitter_en; return 0; @@ -148,12 +142,6 @@ static int mt8186_i2s_hd_set(struct snd_kcontrol *kcontrol, __func__, kcontrol->id.name, hd_en); i2s_priv = get_i2s_priv_by_name(afe, kcontrol->id.name); - - if (!i2s_priv) { - dev_err(afe->dev, "%s(), i2s_priv == NULL", __func__); - return -EINVAL; - } - if (i2s_priv->low_jitter_en == hd_en) return 0; @@ -377,11 +365,6 @@ static int mtk_i2s_en_event(struct snd_soc_dapm_widget *w, i2s_priv = get_i2s_priv_by_name(afe, w->name); - if (!i2s_priv) { - dev_err(afe->dev, "%s(), i2s_priv == NULL", __func__); - return -EINVAL; - } - dev_dbg(cmpnt->dev, "%s(), name %s, event 0x%x\n", __func__, w->name, event); @@ -442,11 +425,6 @@ static int mtk_mclk_en_event(struct snd_soc_dapm_widget *w, i2s_priv = get_i2s_priv_by_name(afe, w->name); - if (!i2s_priv) { - dev_err(afe->dev, "%s(), i2s_priv == NULL", __func__); - return -EINVAL; - } - switch (event) { case SND_SOC_DAPM_PRE_PMU: mt8186_mck_enable(afe, i2s_priv->mclk_id, i2s_priv->mclk_rate); @@ -566,12 +544,6 @@ static int mtk_afe_i2s_share_connect(struct snd_soc_dapm_widget *source, struct mtk_afe_i2s_priv *i2s_priv; i2s_priv = get_i2s_priv_by_name(afe, sink->name); - - if (!i2s_priv) { - dev_err(afe->dev, "%s(), i2s_priv == NULL", __func__); - return 0; - } - if (i2s_priv->share_i2s_id < 0) return 0; @@ -587,12 +559,6 @@ static int mtk_afe_i2s_hd_connect(struct snd_soc_dapm_widget *source, struct mtk_afe_i2s_priv *i2s_priv; i2s_priv = get_i2s_priv_by_name(afe, sink->name); - - if (!i2s_priv) { - dev_err(afe->dev, "%s(), i2s_priv == NULL", __func__); - return 0; - } - if (get_i2s_id_by_name(afe, sink->name) == get_i2s_id_by_name(afe, source->name)) return i2s_priv->low_jitter_en; @@ -618,15 +584,8 @@ static int mtk_afe_i2s_apll_connect(struct snd_soc_dapm_widget *source, int i2s_need_apll; i2s_priv = get_i2s_priv_by_name(afe, w->name); - - if (!i2s_priv) { - dev_err(afe->dev, "%s(), i2s_priv == NULL", __func__); - return 0; - } - /* which apll */ cur_apll = mt8186_get_apll_by_name(afe, source->name); - /* choose APLL from i2s rate */ i2s_need_apll = mt8186_get_apll_by_rate(afe, i2s_priv->rate); @@ -642,12 +601,6 @@ static int mtk_afe_i2s_mclk_connect(struct snd_soc_dapm_widget *source, struct mtk_afe_i2s_priv *i2s_priv; i2s_priv = get_i2s_priv_by_name(afe, sink->name); - - if (!i2s_priv) { - dev_err(afe->dev, "%s(), i2s_priv == NULL", __func__); - return 0; - } - if (get_i2s_id_by_name(afe, sink->name) == get_i2s_id_by_name(afe, source->name)) return (i2s_priv->mclk_rate > 0) ? 1 : 0; @@ -672,12 +625,6 @@ static int mtk_afe_mclk_apll_connect(struct snd_soc_dapm_widget *source, int cur_apll; i2s_priv = get_i2s_priv_by_name(afe, w->name); - - if (!i2s_priv) { - dev_err(afe->dev, "%s(), i2s_priv == NULL", __func__); - return 0; - } - /* which apll */ cur_apll = mt8186_get_apll_by_name(afe, source->name); @@ -980,11 +927,6 @@ static int mtk_dai_i2s_config(struct mtk_base_afe *afe, dev_dbg(afe->dev, "%s(), id %d, rate %d, format %d\n", __func__, i2s_id, rate, format); - if (!i2s_priv) { - dev_err(afe->dev, "%s(), i2s_priv == NULL", __func__); - return -EINVAL; - } - i2s_priv->rate = rate; switch (i2s_id) { @@ -1053,11 +995,6 @@ static int mtk_dai_i2s_set_sysclk(struct snd_soc_dai *dai, int apll; int apll_rate; - if (!i2s_priv) { - dev_err(afe->dev, "%s(), i2s_priv == NULL", __func__); - return -EINVAL; - } - if (dir != SND_SOC_CLOCK_OUT) { dev_err(afe->dev, "%s(), dir != SND_SOC_CLOCK_OUT", __func__); return -EINVAL; diff --git a/sound/soc/mediatek/mt8186/mt8186-dai-pcm.c b/sound/soc/mediatek/mt8186/mt8186-dai-pcm.c index 0b0032ecfe6d..41221a66111c 100644 --- a/sound/soc/mediatek/mt8186/mt8186-dai-pcm.c +++ b/sound/soc/mediatek/mt8186/mt8186-dai-pcm.c @@ -287,11 +287,6 @@ static int mtk_dai_pcm_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) struct mt8186_afe_private *afe_priv = afe->platform_priv; struct mtk_afe_pcm_priv *pcm_priv = afe_priv->dai_priv[dai->id]; - if (!pcm_priv) { - dev_err(afe->dev, "%s(), tdm_priv == NULL", __func__); - return -EINVAL; - } - /* DAI mode*/ switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { case SND_SOC_DAIFMT_I2S: diff --git a/sound/soc/mediatek/mt8186/mt8186-dai-tdm.c b/sound/soc/mediatek/mt8186/mt8186-dai-tdm.c index c6ead7c252f0..4148dceb3a4c 100644 --- a/sound/soc/mediatek/mt8186/mt8186-dai-tdm.c +++ b/sound/soc/mediatek/mt8186/mt8186-dai-tdm.c @@ -106,11 +106,6 @@ static int mtk_tdm_en_event(struct snd_soc_dapm_widget *w, int dai_id = get_tdm_id_by_name(w->name); struct mtk_afe_tdm_priv *tdm_priv = afe_priv->dai_priv[dai_id]; - if (!tdm_priv) { - dev_err(afe->dev, "%s(), tdm_priv == NULL", __func__); - return -EINVAL; - } - dev_dbg(cmpnt->dev, "%s(), name %s, event 0x%x\n", __func__, w->name, event); @@ -138,11 +133,6 @@ static int mtk_tdm_mck_en_event(struct snd_soc_dapm_widget *w, int dai_id = get_tdm_id_by_name(w->name); struct mtk_afe_tdm_priv *tdm_priv = afe_priv->dai_priv[dai_id]; - if (!tdm_priv) { - dev_err(afe->dev, "%s(), tdm_priv == NULL", __func__); - return -EINVAL; - } - dev_dbg(cmpnt->dev, "%s(), name %s, event 0x%x, dai_id %d\n", __func__, w->name, event, dai_id); @@ -215,11 +205,6 @@ static int mtk_afe_tdm_mclk_connect(struct snd_soc_dapm_widget *source, int dai_id = get_tdm_id_by_name(w->name); struct mtk_afe_tdm_priv *tdm_priv = afe_priv->dai_priv[dai_id]; - if (!tdm_priv) { - dev_err(afe->dev, "%s(), tdm_priv == NULL", __func__); - return 0; - } - return (tdm_priv->mclk_rate > 0) ? 1 : 0; } @@ -250,11 +235,6 @@ static int mtk_afe_tdm_hd_connect(struct snd_soc_dapm_widget *source, int dai_id = get_tdm_id_by_name(w->name); struct mtk_afe_tdm_priv *tdm_priv = afe_priv->dai_priv[dai_id]; - if (!tdm_priv) { - dev_err(afe->dev, "%s(), tdm_priv == NULL", __func__); - return 0; - } - return tdm_priv->low_jitter_en; } @@ -270,11 +250,6 @@ static int mtk_afe_tdm_apll_connect(struct snd_soc_dapm_widget *source, int cur_apll; int tdm_need_apll; - if (!tdm_priv) { - dev_err(afe->dev, "%s(), tdm_priv == NULL", __func__); - return 0; - } - /* which apll */ cur_apll = mt8186_get_apll_by_name(afe, source->name); @@ -303,11 +278,6 @@ static int mt8186_tdm_hd_get(struct snd_kcontrol *kcontrol, int dai_id = get_tdm_id_by_name(kcontrol->id.name); struct mtk_afe_tdm_priv *tdm_priv = afe_priv->dai_priv[dai_id]; - if (!tdm_priv) { - dev_err(afe->dev, "%s(), tdm_priv == NULL", __func__); - return -EINVAL; - } - ucontrol->value.integer.value[0] = tdm_priv->low_jitter_en; return 0; @@ -332,11 +302,6 @@ static int mt8186_tdm_hd_set(struct snd_kcontrol *kcontrol, dev_dbg(afe->dev, "%s(), kcontrol name %s, hd_en %d\n", __func__, kcontrol->id.name, hd_en); - if (!tdm_priv) { - dev_err(afe->dev, "%s(), tdm_priv == NULL", __func__); - return -EINVAL; - } - if (tdm_priv->low_jitter_en == hd_en) return 0; @@ -421,22 +386,14 @@ static int mtk_dai_tdm_hw_params(struct snd_pcm_substream *substream, unsigned int tran_rate; unsigned int tran_relatch_rate; - if (!tdm_priv) { - dev_err(afe->dev, "%s(), tdm_priv == NULL", __func__); - return -EINVAL; - } - tdm_priv->rate = rate; - tran_rate = mt8186_rate_transform(afe->dev, rate, dai->id); tran_relatch_rate = mt8186_tdm_relatch_rate_transform(afe->dev, rate); /* calculate mclk_rate, if not set explicitly */ if (!tdm_priv->mclk_rate) { tdm_priv->mclk_rate = rate * tdm_priv->mclk_multiple; - mtk_dai_tdm_cal_mclk(afe, - tdm_priv, - tdm_priv->mclk_rate); + mtk_dai_tdm_cal_mclk(afe, tdm_priv, tdm_priv->mclk_rate); } /* ETDM_IN1_CON0 */ @@ -508,11 +465,6 @@ static int mtk_dai_tdm_set_sysclk(struct snd_soc_dai *dai, struct mt8186_afe_private *afe_priv = afe->platform_priv; struct mtk_afe_tdm_priv *tdm_priv = afe_priv->dai_priv[dai->id]; - if (!tdm_priv) { - dev_err(afe->dev, "%s(), tdm_priv == NULL", __func__); - return -EINVAL; - } - if (dir != SND_SOC_CLOCK_IN) { dev_err(afe->dev, "%s(), dir != SND_SOC_CLOCK_OUT", __func__); return -EINVAL; @@ -529,11 +481,6 @@ static int mtk_dai_tdm_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) struct mt8186_afe_private *afe_priv = afe->platform_priv; struct mtk_afe_tdm_priv *tdm_priv = afe_priv->dai_priv[dai->id]; - if (!tdm_priv) { - dev_err(afe->dev, "%s(), tdm_priv == NULL", __func__); - return -EINVAL; - } - /* DAI mode*/ switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { case SND_SOC_DAIFMT_I2S: |