In ESAI_ASRC, to use ASRC for p2p playback, ESAI driver would maintain
an variable to keep track of ASRC pair number allocated. So every time
ESAI driver want to use ASRC, he would first init the variable to a value
(0 in ESAI driver)stand for unvalid pair number and then request an valid
pair number. At last, open the ASRC clock for ASRC register access.
However, ASRC driver treat 0 as an valid pair number. Thus, if an ESAI ASRC
playback is failed, ESAI driver would check whether the pair number is valid.
If the pair number is valid, ESAI driver would access ASRC register to do some
clean work. Thus, the init 0 value would be treat as an valid pair number and
ASRC register would be access without ASRC clock. In the case, an system
hang happens.
In this patch, init pair number variable to -1 after its allocation.
Signed-off-by: Chen Liangjun <b36089@freescale.com>
iprtd->asrc_enable = true;
iprtd->p2p =
(struct asrc_p2p_params *)snd_soc_pcm_get_drvdata(rtd);
+ iprtd->asrc_index = -1;
}
runtime->private_data = iprtd;