/* printk(KERN_##(KERN_INFO) "AMVECM: " fmt, ## args) */
#define GAMMA_RETRY 1000
+unsigned int gamma_loadprotect_en = 1;
/* 0: Invalid */
/* 1: Valid */
spin_lock_irqsave(&vpp_lcd_gamma_lock, flags);
+ if (gamma_loadprotect_en)
+ WRITE_VPP_REG_BITS(L_GAMMA_CNTL_PORT, 0, GAMMA_EN, 1);
+
while (!(READ_VPP_REG(L_GAMMA_CNTL_PORT) & (0x1 << ADR_RDY))) {
udelay(10);
if (cnt++ > GAMMA_RETRY)
(0x1 << rgb_mask) |
(0x23 << HADR));
+ if (gamma_loadprotect_en)
+ VSYNC_WR_MPEG_REG_BITS(L_GAMMA_CNTL_PORT,
+ gamma_en, GAMMA_EN, 1);
+
spin_unlock_irqrestore(&vpp_lcd_gamma_lock, flags);
}
"echo vpp_size > /sys/class/amvecm/debug; get vpp size config\n"
"echo wb enable > /sys/class/amvecm/debug\n"
"echo wb disable > /sys/class/amvecm/debug\n"
- "echo gama enable > /sys/class/amvecm/debug\n"
- "echo gama disable > /sys/class/amvecm/debug\n"
+ "echo gamma enable > /sys/class/amvecm/debug\n"
+ "echo gamma disable > /sys/class/amvecm/debug\n"
+ "echo gamma load_protect_en > /sys/class/amvecm/debug\n"
+ "echo gamma load_protect_dis > /sys/class/amvecm/debug\n"
"echo sr peaking_en > /sys/class/amvecm/debug\n"
"echo sr peaking_dis > /sys/class/amvecm/debug\n"
"echo sr lcti_en > /sys/class/amvecm/debug\n"
} else if (!strncmp(parm[1], "disable", 7)) {
vecm_latch_flag |= FLAG_GAMMA_TABLE_DIS;/* gamma off */
pr_info("disable gamma\n");
+ } else if (!strncmp(parm[1], "load_protect_en", 15)) {
+ gamma_loadprotect_en = 1;
+ pr_info("disable gamma before loading new gamma\n");
+ } else if (!strncmp(parm[1], "load_protect_dis", 16)) {
+ gamma_loadprotect_en = 0;
+ pr_info("loading new gamma without pretect");
}
} else if (!strncmp(parm[0], "sr", 2)) {
if (!strncmp(parm[1], "peaking_en", 10)) {