ASoC: rockchip: i2s: fix regmap_ops hang issue
This is because set_fmt ops maybe called when PD is off, and in such case, regmap_ops will lead system hang. enale PD before doing regmap_ops. Change-Id: Iafa18acb59995ad86885a8d6a6f5f49a7d233962 Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
This commit is contained in:
parent
6771a00c43
commit
732828af25
1 changed files with 14 additions and 5 deletions
|
|
@ -189,7 +189,9 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
|
|||
{
|
||||
struct rk_i2s_dev *i2s = to_info(cpu_dai);
|
||||
unsigned int mask = 0, val = 0;
|
||||
int ret = 0;
|
||||
|
||||
pm_runtime_get_sync(cpu_dai->dev);
|
||||
mask = I2S_CKR_MSS_MASK;
|
||||
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
|
||||
case SND_SOC_DAIFMT_CBS_CFS:
|
||||
|
|
@ -202,7 +204,8 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
|
|||
i2s->is_master_mode = false;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto err_pm_put;
|
||||
}
|
||||
|
||||
regmap_update_bits(i2s->regmap, I2S_CKR, mask, val);
|
||||
|
|
@ -216,7 +219,8 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
|
|||
val = I2S_CKR_CKP_POS;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto err_pm_put;
|
||||
}
|
||||
|
||||
regmap_update_bits(i2s->regmap, I2S_CKR, mask, val);
|
||||
|
|
@ -239,7 +243,8 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
|
|||
val = I2S_TXCR_TFS_PCM | I2S_TXCR_PBM_MODE(1);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto err_pm_put;
|
||||
}
|
||||
|
||||
regmap_update_bits(i2s->regmap, I2S_TXCR, mask, val);
|
||||
|
|
@ -262,12 +267,16 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
|
|||
val = I2S_RXCR_TFS_PCM | I2S_RXCR_PBM_MODE(1);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto err_pm_put;
|
||||
}
|
||||
|
||||
regmap_update_bits(i2s->regmap, I2S_RXCR, mask, val);
|
||||
|
||||
return 0;
|
||||
err_pm_put:
|
||||
pm_runtime_put(cpu_dai->dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue