From 6d74f4e4f18ea2802c0e90cb27b076c903f958b6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=99=88=E6=81=92=E6=98=8E?= Date: Fri, 4 Mar 2011 12:38:38 +0800 Subject: [PATCH] rk29: vpu: fix bug on pp reset --- arch/arm/mach-rk29/vpu.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-rk29/vpu.c b/arch/arm/mach-rk29/vpu.c index 4f8913bfc3e5..e6d0799c1e34 100644 --- a/arch/arm/mach-rk29/vpu.c +++ b/arch/arm/mach-rk29/vpu.c @@ -291,11 +291,10 @@ static long vpu_write_dec(u32 *src) int i; u32 *dst = (u32 *)dec_dev.hwregs; - dst[VPU_REG_DEC_GATE] = src[VPU_REG_DEC_GATE] | VPU_REG_DEC_GATE_BIT; - - for (i = VPU_REG_DEC_GATE + 1; i < REG_NUM_DEC; i++) + for (i = REG_NUM_DEC - 1; i > VPU_REG_DEC_GATE; i--) dst[i] = src[i]; + dst[VPU_REG_DEC_GATE] = src[VPU_REG_DEC_GATE] | VPU_REG_DEC_GATE_BIT; dst[VPU_REG_EN_DEC] = src[VPU_REG_EN_DEC]; return 0; @@ -402,8 +401,7 @@ static long vpu_clear_irqs(VPU_CLIENT_TYPE type) writel(0, &enc_dev.hwregs[ENC_INTERRUPT_REGISTER]); break; } - case VPU_DEC : - case VPU_DEC_PP : { + case VPU_DEC : { writel(0, &dec_dev.hwregs[DEC_INTERRUPT_REGISTER]); break; } @@ -411,6 +409,11 @@ static long vpu_clear_irqs(VPU_CLIENT_TYPE type) writel(0, &pp_dev.hwregs[PP_INTERRUPT_REGISTER]); break; } + case VPU_DEC_PP : { + writel(0, &pp_dev.hwregs[PP_INTERRUPT_REGISTER]); + writel(0, &dec_dev.hwregs[DEC_INTERRUPT_REGISTER]); + break; + } default : { ret = -1; } -- 2.34.1