Skip to content

Commit 2a387bb

Browse files
Srinivasa Rao Mandadapugregkh
authored andcommitted
ASoC: qcom: lpass-cpu: Remove bit clock state check
[ Upstream commit 6c28377 ] No need of BCLK state maintenance from driver side as clock_enable and clk_disable API's maintaing state counter. One of the major issue was spotted when Headset jack inserted while playback continues, due to same PCM device node opens twice for playaback/capture and closes once for capture and playback continues. It can resolve the errors in such scenarios. Fixes: b182496 ("ASoC: qcom: Fix enabling BCLK and LRCLK in LPAIF invalid state") Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210127151824.8929-1-srivasam@codeaurora.org Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 2bebc6d commit 2a387bb

3 files changed

Lines changed: 8 additions & 18 deletions

File tree

sound/soc/qcom/lpass-cpu.c

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -286,16 +286,12 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream,
286286
dev_err(dai->dev, "error writing to i2sctl reg: %d\n",
287287
ret);
288288

289-
if (drvdata->bit_clk_state[id] == LPAIF_BIT_CLK_DISABLE) {
290-
ret = clk_enable(drvdata->mi2s_bit_clk[id]);
291-
if (ret) {
292-
dev_err(dai->dev, "error in enabling mi2s bit clk: %d\n", ret);
293-
clk_disable(drvdata->mi2s_osr_clk[id]);
294-
return ret;
295-
}
296-
drvdata->bit_clk_state[id] = LPAIF_BIT_CLK_ENABLE;
289+
ret = clk_enable(drvdata->mi2s_bit_clk[id]);
290+
if (ret) {
291+
dev_err(dai->dev, "error in enabling mi2s bit clk: %d\n", ret);
292+
clk_disable(drvdata->mi2s_osr_clk[id]);
293+
return ret;
297294
}
298-
299295
break;
300296
case SNDRV_PCM_TRIGGER_STOP:
301297
case SNDRV_PCM_TRIGGER_SUSPEND:
@@ -310,10 +306,9 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream,
310306
if (ret)
311307
dev_err(dai->dev, "error writing to i2sctl reg: %d\n",
312308
ret);
313-
if (drvdata->bit_clk_state[id] == LPAIF_BIT_CLK_ENABLE) {
314-
clk_disable(drvdata->mi2s_bit_clk[dai->driver->id]);
315-
drvdata->bit_clk_state[id] = LPAIF_BIT_CLK_DISABLE;
316-
}
309+
310+
clk_disable(drvdata->mi2s_bit_clk[dai->driver->id]);
311+
317312
break;
318313
}
319314

@@ -866,7 +861,6 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
866861
PTR_ERR(drvdata->mi2s_bit_clk[dai_id]));
867862
return PTR_ERR(drvdata->mi2s_bit_clk[dai_id]);
868863
}
869-
drvdata->bit_clk_state[dai_id] = LPAIF_BIT_CLK_DISABLE;
870864
}
871865

872866
/* Allocation for i2sctl regmap fields */

sound/soc/qcom/lpass-lpaif-reg.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@
6060
#define LPAIF_I2SCTL_BITWIDTH_24 1
6161
#define LPAIF_I2SCTL_BITWIDTH_32 2
6262

63-
#define LPAIF_BIT_CLK_DISABLE 0
64-
#define LPAIF_BIT_CLK_ENABLE 1
65-
6663
#define LPAIF_I2SCTL_RESET_STATE 0x003C0004
6764
#define LPAIF_DMACTL_RESET_STATE 0x00200000
6865

sound/soc/qcom/lpass.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ struct lpass_data {
6868
unsigned int mi2s_playback_sd_mode[LPASS_MAX_MI2S_PORTS];
6969
unsigned int mi2s_capture_sd_mode[LPASS_MAX_MI2S_PORTS];
7070
int hdmi_port_enable;
71-
int bit_clk_state[LPASS_MAX_MI2S_PORTS];
7271

7372
/* low-power audio interface (LPAIF) registers */
7473
void __iomem *lpaif;

0 commit comments

Comments
 (0)