From 12d26dc6b47edb6fd498a72707752e82fba111c8 Mon Sep 17 00:00:00 2001 From: Evoke Zhang Date: Fri, 17 May 2019 17:09:22 +0800 Subject: [PATCH] tvafe: update parameters for AV NTSC [1/1] PD#SWPL-7283 Problem: display is not good Solution: modify cvd2 0xb0, 0xb1 reg value Verify: x301 Change-Id: Ib512258336d3a6bb14c4eda04488fbaf60e38af0 Signed-off-by: Evoke Zhang --- drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.c | 7 ++++- .../amlogic/media/vin/tvin/tvafe/tvafe_general.c | 36 ++++++++++------------ 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.c b/drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.c index f3f2848..67bff89 100644 --- a/drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.c +++ b/drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.c @@ -447,8 +447,13 @@ static void tvafe_cvd2_write_mode_reg(struct tvafe_cvd2_s *cvd2, if (((cvd2->vd_port == TVIN_PORT_CVBS1) || (cvd2->vd_port == TVIN_PORT_CVBS2)) && - (cvd2->config_fmt == TVIN_SIG_FMT_CVBS_NTSC_M)) + (cvd2->config_fmt == TVIN_SIG_FMT_CVBS_NTSC_M)) { W_APB_REG(CVD2_VSYNC_SIGNAL_THRESHOLD, 0x7d); + if (tvafe_cpu_type() == CPU_TYPE_TL1) { + W_APB_REG(CVD2_REG_B0, 0x0); + W_APB_REG(CVD2_3DCOMB_FILTER, 0xfd); + } + } /* reload CVD2 reg 0x87, 0x93, 0x94, 0x95, 0x96, 0xe6, 0xfa (int) */ W_APB_REG(((CVD_BASE_ADD+CVD_PART3_REG_0)<<2), diff --git a/drivers/amlogic/media/vin/tvin/tvafe/tvafe_general.c b/drivers/amlogic/media/vin/tvin/tvafe/tvafe_general.c index 6a4904c..7da6f83 100644 --- a/drivers/amlogic/media/vin/tvin/tvafe/tvafe_general.c +++ b/drivers/amlogic/media/vin/tvin/tvafe/tvafe_general.c @@ -326,9 +326,8 @@ void tvafe_set_regmap(struct am_regs_s *p) for (i = 0; i < p->length; i++) { switch (p->am_reg[i].type) { case REG_TYPE_PHY: - #ifdef PQ_DEBUG_EN - tvafe_pr_info("%s: bus type: phy..\n", __func__); - #endif + if (tvafe_dbg_enable) + tvafe_pr_info("%s: bus type: phy..\n", __func__); break; case REG_TYPE_CBUS: if (p->am_reg[i].mask == 0xffffffff) @@ -338,14 +337,13 @@ for (i = 0; i < p->length; i++) { (aml_read_cbus(p->am_reg[i].addr) & (~(p->am_reg[i].mask))) | (p->am_reg[i].val & p->am_reg[i].mask)); - #ifdef PQ_DEBUG_EN - tvafe_pr_info("%s: cbus: Reg0x%x(%u)=0x%x(%u)val=%x(%u)mask=%x(%u)\n", + if (tvafe_dbg_enable) + tvafe_pr_info("%s: cbus: Reg0x%x(%u)=0x%x(%u)val=%x(%u)mask=%x(%u)\n", __func__, p->am_reg[i].addr, p->am_reg[i].addr, - (p->am_reg[i].val & p->am_reg[i].mask), - (p->am_reg[i].val & p->am_reg[i].mask), - p->am_reg[i].val, p->am_reg[i].val, - p->am_reg[i].mask, p->am_reg[i].mask); - #endif + (p->am_reg[i].val & p->am_reg[i].mask), + (p->am_reg[i].val & p->am_reg[i].mask), + p->am_reg[i].val, p->am_reg[i].val, + p->am_reg[i].mask, p->am_reg[i].mask); break; case REG_TYPE_APB: if (p->am_reg[i].mask == 0xffffffff) @@ -355,20 +353,18 @@ for (i = 0; i < p->length; i++) { (R_APB_REG(p->am_reg[i].addr<<2) & (~(p->am_reg[i].mask))) | (p->am_reg[i].val & p->am_reg[i].mask)); - #ifdef PQ_DEBUG_EN - tvafe_pr_info("%s: apb: Reg0x%x(%u)=0x%x(%u)val=%x(%u)mask=%x(%u)\n", + if (tvafe_dbg_enable) + tvafe_pr_info("%s: apb: Reg0x%x(%u)=0x%x(%u)val=%x(%u)mask=%x(%u)\n", __func__, p->am_reg[i].addr, p->am_reg[i].addr, - (p->am_reg[i].val & p->am_reg[i].mask), - (p->am_reg[i].val & p->am_reg[i].mask), - p->am_reg[i].val, p->am_reg[i].val, - p->am_reg[i].mask, p->am_reg[i].mask); - #endif + (p->am_reg[i].val & p->am_reg[i].mask), + (p->am_reg[i].val & p->am_reg[i].mask), + p->am_reg[i].val, p->am_reg[i].val, + p->am_reg[i].mask, p->am_reg[i].mask); break; default: - #ifdef PQ_DEBUG_EN - tvafe_pr_info("%s: bus type error!!!bustype = 0x%x................\n", + if (tvafe_dbg_enable) + tvafe_pr_info("%s: bus type error!!!bustype = 0x%x................\n", __func__, p->am_reg[i].type); - #endif break; } } -- 2.7.4