Commit 68b65879 authored by Jae Hyun Yoo's avatar Jae Hyun Yoo Committed by Mauro Carvalho Chehab

media: aspeed: refine interrupt handling logic

There are cases that interrupt bits are cleared by a 500ms delayed
work which causes unnecessary irq calls. Also, the current
interrupt handler returns IRQ_HANDLED always but it should return
IRQ_NONE if there is any unhandled interrupt. So this commit
refines the interrupt handling logic to fix these issues.
Signed-off-by: default avatarJae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
Reviewed-by: default avatarAndrew Jeffery <andrew@aj.id.au>
Reviewed-by: default avatarEddie James <eajames@linux.ibm.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent f8a02b37
...@@ -488,6 +488,7 @@ static void aspeed_video_off(struct aspeed_video *video) ...@@ -488,6 +488,7 @@ static void aspeed_video_off(struct aspeed_video *video)
/* Disable interrupts */ /* Disable interrupts */
aspeed_video_write(video, VE_INTERRUPT_CTRL, 0); aspeed_video_write(video, VE_INTERRUPT_CTRL, 0);
aspeed_video_write(video, VE_INTERRUPT_STATUS, 0xffffffff);
/* Turn off the relevant clocks */ /* Turn off the relevant clocks */
clk_disable(video->vclk); clk_disable(video->vclk);
...@@ -554,7 +555,7 @@ static irqreturn_t aspeed_video_irq(int irq, void *arg) ...@@ -554,7 +555,7 @@ static irqreturn_t aspeed_video_irq(int irq, void *arg)
VE_INTERRUPT_MODE_DETECT, 0); VE_INTERRUPT_MODE_DETECT, 0);
aspeed_video_write(video, VE_INTERRUPT_STATUS, aspeed_video_write(video, VE_INTERRUPT_STATUS,
VE_INTERRUPT_MODE_DETECT); VE_INTERRUPT_MODE_DETECT);
sts &= ~VE_INTERRUPT_MODE_DETECT;
set_bit(VIDEO_MODE_DETECT_DONE, &video->flags); set_bit(VIDEO_MODE_DETECT_DONE, &video->flags);
wake_up_interruptible_all(&video->wait); wake_up_interruptible_all(&video->wait);
} else { } else {
...@@ -599,12 +600,12 @@ static irqreturn_t aspeed_video_irq(int irq, void *arg) ...@@ -599,12 +600,12 @@ static irqreturn_t aspeed_video_irq(int irq, void *arg)
VE_INTERRUPT_COMP_COMPLETE, 0); VE_INTERRUPT_COMP_COMPLETE, 0);
aspeed_video_write(video, VE_INTERRUPT_STATUS, aspeed_video_write(video, VE_INTERRUPT_STATUS,
VE_INTERRUPT_COMP_COMPLETE); VE_INTERRUPT_COMP_COMPLETE);
sts &= ~VE_INTERRUPT_COMP_COMPLETE;
if (test_bit(VIDEO_STREAMING, &video->flags) && buf) if (test_bit(VIDEO_STREAMING, &video->flags) && buf)
aspeed_video_start_frame(video); aspeed_video_start_frame(video);
} }
return IRQ_HANDLED; return sts ? IRQ_NONE : IRQ_HANDLED;
} }
static void aspeed_video_check_and_set_polarity(struct aspeed_video *video) static void aspeed_video_check_and_set_polarity(struct aspeed_video *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