drm/bridge: synopsys: Recover sound for XRUN routine
This patch add audio reset in prepare stage to clean audio FIFO to recover sound from XRUN state. Change-Id: I3808be7973306cc6f8d377f5eb5a0bcec844ab16 Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
This commit is contained in:
@@ -132,6 +132,23 @@ static int dw_hdmi_i2s_hw_params(struct device *dev, void *data,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dw_hdmi_i2s_prepare(struct device *dev, void *data,
|
||||
struct hdmi_codec_daifmt *fmt,
|
||||
struct hdmi_codec_params *hparms)
|
||||
{
|
||||
struct dw_hdmi_i2s_audio_data *audio = data;
|
||||
struct dw_hdmi *hdmi = audio->hdmi;
|
||||
|
||||
dw_hdmi_audio_disable(hdmi);
|
||||
|
||||
hdmi_write(audio, HDMI_AUD_CONF0_SW_RESET, HDMI_AUD_CONF0);
|
||||
hdmi_write(audio, (u8)~HDMI_MC_SWRSTZ_I2SSWRST_REQ, HDMI_MC_SWRSTZ);
|
||||
|
||||
dw_hdmi_audio_enable(hdmi);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dw_hdmi_i2s_audio_startup(struct device *dev, void *data)
|
||||
{
|
||||
struct dw_hdmi_i2s_audio_data *audio = data;
|
||||
@@ -198,6 +215,7 @@ static int dw_hdmi_i2s_hook_plugged_cb(struct device *dev, void *data,
|
||||
|
||||
static struct hdmi_codec_ops dw_hdmi_i2s_ops = {
|
||||
.hw_params = dw_hdmi_i2s_hw_params,
|
||||
.prepare = dw_hdmi_i2s_prepare,
|
||||
.audio_startup = dw_hdmi_i2s_audio_startup,
|
||||
.audio_shutdown = dw_hdmi_i2s_audio_shutdown,
|
||||
.get_eld = dw_hdmi_i2s_get_eld,
|
||||
|
||||
Reference in New Issue
Block a user