From 4527ef851e75b80d78990ab373ed925dfb832eb5 Mon Sep 17 00:00:00 2001 From: MingLiang Dong Date: Thu, 17 May 2018 16:24:11 +0800 Subject: [PATCH] amvecm: use rdma load vpp reg PD#166562: amvecm: use rdma load vpp reg Change-Id: Id0b61be776d91e1b6270699aeb9b24fd43d1a67d Signed-off-by: MingLiang Dong --- drivers/amlogic/media/enhancement/amvecm/amcm.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/amlogic/media/enhancement/amvecm/amcm.c b/drivers/amlogic/media/enhancement/amvecm/amcm.c index 064ebc2..5374b05 100644 --- a/drivers/amlogic/media/enhancement/amvecm/amcm.c +++ b/drivers/amlogic/media/enhancement/amvecm/amcm.c @@ -29,6 +29,7 @@ #include "amcm.h" #include "amcm_regmap.h" #include +#include "amcsc.h" #define pr_amcm_dbg(fmt, args...)\ do {\ @@ -56,6 +57,10 @@ static unsigned int cm_width_limit = 50;/* vlsi adjust */ module_param(cm_width_limit, uint, 0664); MODULE_PARM_DESC(cm_width_limit, "\n cm_width_limit\n"); +int pq_reg_wr_rdma = 1;/* 0:disabel;1:enable */ +module_param(pq_reg_wr_rdma, int, 0664); +MODULE_PARM_DESC(pq_reg_wr_rdma, "\n pq_reg_wr_rdma\n"); + #if 0 struct cm_region_s cm_region; struct cm_top_s cm_top; @@ -189,12 +194,16 @@ void am_set_regmap(struct am_regs_s *p) break; /* #if (MESON_CPU_TYPE >= MESON_CPU_TYPE_MESONG9TV) */ case REG_TYPE_VCBUS: - if (p->am_reg[i].mask == 0xffffffff) + if (p->am_reg[i].mask == 0xffffffff) { /* WRITE_VCBUS_REG(p->am_reg[i].addr,*/ /* p->am_reg[i].val); */ - aml_write_vcbus(p->am_reg[i].addr, + if (pq_reg_wr_rdma) + VSYNC_WR_MPEG_REG(p->am_reg[i].addr, p->am_reg[i].val); - else + else + aml_write_vcbus(p->am_reg[i].addr, + p->am_reg[i].val); + } else /* WRITE_VCBUS_REG(p->am_reg[i].addr, */ /* (READ_VCBUS_REG(p->am_reg[i].addr) & */ /* (~(p->am_reg[i].mask))) | */ @@ -220,7 +229,13 @@ void am_set_regmap(struct am_regs_s *p) } else { if (p->am_reg[i].addr == 0x1d26) break; - aml_write_vcbus(p->am_reg[i].addr, + if (pq_reg_wr_rdma) + VSYNC_WR_MPEG_REG(p->am_reg[i].addr, + (aml_read_vcbus(p->am_reg[i].addr) & + (~(p->am_reg[i].mask))) | + (p->am_reg[i].val & p->am_reg[i].mask)); + else + aml_write_vcbus(p->am_reg[i].addr, (aml_read_vcbus(p->am_reg[i].addr) & (~(p->am_reg[i].mask))) | (p->am_reg[i].val & p->am_reg[i].mask)); -- 2.7.4