vdin: g12a/g12b: fix screencap error from ENCL
authorxuhua zhang <xuhua.zhang@amlogic.com>
Thu, 19 Jul 2018 08:15:52 +0000 (16:15 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Mon, 23 Jul 2018 05:59:53 +0000 (22:59 -0700)
PD#170320: vdin: g12a/g12b: fix screencap error from ENCL

Change-Id: I16bd33f31d126b714aa15e09bd782525b25da54b
Signed-off-by: xuhua zhang <xuhua.zhang@amlogic.com>
drivers/amlogic/media/vin/tvin/vdin/vdin_ctl.c
drivers/amlogic/media/vin/tvin/viu/viuin.c

index 2b3bc89..d87a2b6 100644 (file)
@@ -145,7 +145,7 @@ static unsigned int vpu_reg_27af = 0x3;
 #define MEAS_MUX_ISP                    8
 #define MEAS_MUX_656_B                  9
 #define MEAS_MUX_VIU1                   6
-#define MEAS_MUX_VIU2                   9
+#define MEAS_MUX_VIU2                   8
 
 #define HDMI_DE_REPEAT_DONE_FLAG       0xF0
 #define DECIMATION_REAL_RANGE          0x0F
index 51d3958..d1b60c8 100644 (file)
@@ -178,7 +178,11 @@ static int viuin_open(struct tvin_frontend_s *fe, enum tvin_port_e port)
        /*open the venc to vdin path*/
        switch (rd_bits_viu(VPU_VIU_VENC_MUX_CTRL, 0, 2)) {
        case 0:
-               viu_mux = 0x8;/* wr_bits(VPU_VIU_VENC_MUX_CTRL,0x88,4,8); */
+               if (is_meson_g12a_cpu() || is_meson_g12b_cpu())
+                       viu_mux = 0x4;
+               else
+                       viu_mux = 0x8;
+               /* wr_bits(VPU_VIU_VENC_MUX_CTRL,0x88,4,8); */
                devp->enc_info_addr = ENCL_INFO_READ;
                break;
        case 1:
@@ -208,7 +212,7 @@ static int viuin_open(struct tvin_frontend_s *fe, enum tvin_port_e port)
                        wr_viu(VPU_VIU2VDIN_HDN_CTRL, 0x40f00);
        } else
                wr_bits_viu(VPU_VIU2VDIN_HDN_CTRL, devp->parm.h_active, 0, 14);
-       if (is_meson_g12a_cpu()  || is_meson_g12b_cpu()) {
+       if (is_meson_g12a_cpu() || is_meson_g12b_cpu()) {
                if (((port >= TVIN_PORT_VIU1_WB0_VD1) &&
                        (port <= TVIN_PORT_VIU1_WB0_POST_BLEND)) ||
                        ((port >= TVIN_PORT_VIU2_WB0_VD1) &&
@@ -305,6 +309,7 @@ static void viuin_close(struct tvin_frontend_s *fe)
        if (open_cnt == 0) {
                if (is_meson_g12a_cpu() || is_meson_g12b_cpu()) {
                        wr_viu(VPU_VIU_VDIN_IF_MUX_CTRL, 0);
+                       wr_viu(VPU_VIU_VENC_MUX_CTRL, 0);
                        wr_viu(VPP_WRBAK_CTRL, 0);
 
                } else {