Breaking the spinlock into two halves, and possible fix to spinlock issue
This commit is contained in:
parent
eab694c170
commit
43b6034266
2 changed files with 5 additions and 4 deletions
3
ac101.c
3
ac101.c
|
@ -1258,6 +1258,7 @@ int ac101_trigger(struct snd_pcm_substream *substream, int cmd,
|
|||
struct snd_soc_codec *codec = dai->codec;
|
||||
struct ac10x_priv *ac10x = snd_soc_codec_get_drvdata(codec);
|
||||
int ret = 0;
|
||||
unsigned long flags;
|
||||
|
||||
AC101_DBG("stream=%s cmd=%d\n",
|
||||
snd_pcm_stream_str(substream),
|
||||
|
@ -1268,6 +1269,7 @@ int ac101_trigger(struct snd_pcm_substream *substream, int cmd,
|
|||
case SNDRV_PCM_TRIGGER_RESUME:
|
||||
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
|
||||
#if _MASTER_MULTI_CODEC == _MASTER_AC101
|
||||
spin_lock_irqsave(&ac10x->lock, flags);
|
||||
if (ac10x->aif1_clken == 0){
|
||||
/*
|
||||
* enable aif1clk, it' here due to reduce time between 'AC108 Sysclk Enable' and 'AC101 Sysclk Enable'
|
||||
|
@ -1277,6 +1279,7 @@ int ac101_trigger(struct snd_pcm_substream *substream, int cmd,
|
|||
ret = ret || ac101_update_bits(codec, MOD_CLK_ENA, (0x1<<MOD_CLK_AIF1), (0x1<<MOD_CLK_AIF1));
|
||||
ret = ret || ac101_update_bits(codec, MOD_RST_CTRL, (0x1<<MOD_RESET_AIF1), (0x1<<MOD_RESET_AIF1));
|
||||
}
|
||||
spin_unlock_irqrestore(&ac10x->lock, flags);
|
||||
#endif
|
||||
break;
|
||||
case SNDRV_PCM_TRIGGER_STOP:
|
||||
|
|
6
ac108.c
6
ac108.c
|
@ -1058,8 +1058,6 @@ static int ac108_trigger(struct snd_pcm_substream *substream, int cmd,
|
|||
snd_pcm_stream_str(substream),
|
||||
cmd);
|
||||
|
||||
spin_lock_irqsave(&ac10x->lock, flags);
|
||||
|
||||
if (ac10x->i2c101 && _MASTER_MULTI_CODEC == _MASTER_AC101) {
|
||||
ac101_trigger(substream, cmd, dai);
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
||||
|
@ -1071,12 +1069,14 @@ static int ac108_trigger(struct snd_pcm_substream *substream, int cmd,
|
|||
case SNDRV_PCM_TRIGGER_START:
|
||||
case SNDRV_PCM_TRIGGER_RESUME:
|
||||
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
|
||||
spin_lock_irqsave(&ac10x->lock, flags);
|
||||
/* disable global clock if lrck disabled */
|
||||
ac10x_read(I2S_CTRL, &r, ac10x->i2cmap[_MASTER_INDEX]);
|
||||
if ((r & (0x01 << BCLK_IOEN)) && (r & (0x01 << LRCK_IOEN)) == 0) {
|
||||
/* disable global clock */
|
||||
ac108_multi_update_bits(I2S_CTRL, 0x1 << TXEN | 0x1 << GEN, 0x0 << TXEN | 0x0 << GEN, ac10x);
|
||||
}
|
||||
spin_unlock_irqrestore(&ac10x->lock, flags);
|
||||
|
||||
/* delayed clock starting, move to machine trigger() */
|
||||
break;
|
||||
|
@ -1089,8 +1089,6 @@ static int ac108_trigger(struct snd_pcm_substream *substream, int cmd,
|
|||
}
|
||||
|
||||
__ret:
|
||||
spin_unlock_irqrestore(&ac10x->lock, flags);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue