amvecm: add disable gamma pattern [1/1]
authorMingLiang Dong <mingliang.dong@amlogic.com>
Mon, 14 Jan 2019 09:59:00 +0000 (04:59 -0500)
committerJianxin Pan <jianxin.pan@amlogic.com>
Wed, 16 Jan 2019 02:14:26 +0000 (18:14 -0800)
PD#TV-2138

Problem:
after set gamma pattern, pattern can not resume

Solution:
add disable gamma pattern cmd

Verify:
verify on TL1

Change-Id: I5b123dce185c5f80e21b5e5e4a18ad65f7db626b
Signed-off-by: MingLiang Dong <mingliang.dong@amlogic.com>
drivers/amlogic/media/enhancement/amvecm/amvecm.c

index acb7012..47a3919 100644 (file)
@@ -2778,6 +2778,8 @@ static ssize_t set_gamma_pattern_show(struct class *cla,
        pr_info("8bit: echo r g b > /sys/class/amvecm/gamma_pattern\n");
        pr_info("10bit: echo r g b 0xa > /sys/class/amvecm/gamma_pattern\n");
        pr_info("       r g b should be hex\n");
+       pr_info("disable gamma pattern:\n");
+       pr_info("echo disable > /sys/class/amvecm/gamma_pattern\n");
        return 0;
 }
 
@@ -2807,6 +2809,14 @@ static ssize_t set_gamma_pattern_store(struct class *cls,
                parm[n++] = token;
        }
 
+       if (!strcmp(parm[0], "disable")) {
+               vecm_latch_flag |= FLAG_GAMMA_TABLE_R;
+               vecm_latch_flag |= FLAG_GAMMA_TABLE_G;
+               vecm_latch_flag |= FLAG_GAMMA_TABLE_B;
+               kfree(buf_orig);
+               return count;
+       }
+
        if (*(parm + 3) != NULL) {
                if (kstrtol(parm[3], 16, &val) < 0) {
                        kfree(buf_orig);