MLK-21447: ASoC: fsl_rpmsg_i2s: underrun in m4 for msg delayed

With small buffer size, the resume will be triggered after suspend
immediately, if we reserve the period done message to be sent with
the next command, one period time later, it will cause underrun in
m4 side, for ALSA thought the appl_ptr is updated, but the command
won't be sent to M4 immediately, M4 don't have enough data to play.

In this patch, we check that if the left size in the buffer is less
that one period, the work queue will be triggered to send the period
done message immediately.

Fixes: 348d47695622 ("MLK-21307: ASoC: fsl_rpmsg_i2s: optimize
the message sent to m4")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>

(cherry picked from commit 3dfecae40765329c0b7de1157f97ade24ecfce6d)
2 files changed