amvecm: fix platform boot failed [1/1]
authorBencheng Jing <bencheng.jing@amlogic.com>
Sat, 15 Dec 2018 10:03:20 +0000 (18:03 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Mon, 17 Dec 2018 02:26:44 +0000 (18:26 -0800)
PD#SWPL-3276

Problem:
platform boot failed except TL1

Solution:
protect LC  register read and Write

Verify:
R311&P321

Change-Id: I9b93a1c28cdef43db8f1c5ad46bd6597bc62a1bc
Signed-off-by: Bencheng Jing <bencheng.jing@amlogic.com>
drivers/amlogic/media/enhancement/amvecm/local_contrast.c

index 79359fe..b923d8a 100644 (file)
@@ -1138,9 +1138,6 @@ void lc_process(struct vframe_s *vf,
 {
        int blk_hnum, blk_vnum, dwTemp;
 
-       dwTemp = READ_VPP_REG(LC_CURVE_HV_NUM);
-       blk_hnum = (dwTemp >> 8) & 0x1f;
-       blk_vnum = (dwTemp) & 0x1f;
        if (get_cpu_type() < MESON_CPU_MAJOR_ID_TL1)
                return;
        if (!lc_en) {
@@ -1158,7 +1155,9 @@ void lc_process(struct vframe_s *vf,
                }
                return;
        }
-
+       dwTemp = READ_VPP_REG(LC_CURVE_HV_NUM);
+       blk_hnum = (dwTemp >> 8) & 0x1f;
+       blk_vnum = (dwTemp) & 0x1f;
        lc_config(lc_en, vf, sps_h_en, sps_v_en);
        /*get each block curve*/
        read_lc_curve(blk_vnum, blk_hnum);