Commit 62cea52a authored by Jammy Huang's avatar Jammy Huang Committed by Mauro Carvalho Chehab

media: aspeed: fix mode-detect always time out at 2nd run

aspeed_video_get_resolution() will try to do res-detect again if the
timing got in last try is invalid. But it will always time out because
VE_SEQ_CTRL_TRIG_MODE_DET is only cleared after 1st mode-detect.

To fix the problem, just clear VE_SEQ_CTRL_TRIG_MODE_DET before setting
it in aspeed_video_enable_mode_detect().

Fixes: d2b4387f ("media: platform: Add Aspeed Video Engine driver")
Signed-off-by: default avatarJammy Huang <jammy_huang@aspeedtech.com>
Acked-by: default avatarPaul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: default avatarJoel Stanley <joel@jms.id.au>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 352ff3f3
......@@ -539,6 +539,10 @@ static void aspeed_video_enable_mode_detect(struct aspeed_video *video)
aspeed_video_update(video, VE_INTERRUPT_CTRL, 0,
VE_INTERRUPT_MODE_DETECT);
/* Disable mode detect in order to re-trigger */
aspeed_video_update(video, VE_SEQ_CTRL,
VE_SEQ_CTRL_TRIG_MODE_DET, 0);
/* Trigger mode detect */
aspeed_video_update(video, VE_SEQ_CTRL, 0, VE_SEQ_CTRL_TRIG_MODE_DET);
}
......@@ -824,10 +828,6 @@ static void aspeed_video_get_resolution(struct aspeed_video *video)
return;
}
/* Disable mode detect in order to re-trigger */
aspeed_video_update(video, VE_SEQ_CTRL,
VE_SEQ_CTRL_TRIG_MODE_DET, 0);
aspeed_video_check_and_set_polarity(video);
aspeed_video_enable_mode_detect(video);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment