OKMX6关于背光的调节
目前有三种方法:
1. root@imx6qsabresd:~# echo "1" > /sys/class/graphics/fb0/blank //关闭背光
root@imx6qsabresd:~# echo "0" > /sys/class/graphics/fb0/blank //打开背光
2. root@imx6qsabresd:~#echo 1 > /sys/class/backlight/backlight/bl_power //关闭背光
root@imx6qsabresd:~#echo 0 > /sys/class/backlight/backlight/bl_power //打开背光
3. root@imx6qsabresd:~# echo 0 > /sys/class/backlight/backlight/brightness //关闭背光
root@imx6qsabresd:~# echo 60 > /sys/class/backlight/backlight/brightness //打开背光
看下面原理图,看到可以通过两种方式控制背光PWREN 和 PWM3
EN引脚控制屏幕的外部供电,等于1时,导通
PWM控制背光亮度调节,等于0时,关闭背光
前两种方法是控制EN引脚控制外部供电,第三种方法是控制pwm输出
OKMX6关于屏幕闪烁问题的解决办法
在drivers/video/fbdev/core/fbmem.c文件相应位置改为如下内容
static int blank_flag = 0;
int
fb_blank(struct fb_info *info, int blank)
{
struct fb_event event;
int ret = -EINVAL, early_ret;
/* no blank during xorg init */
blank_flag = blank;
if(blank_flag==1) return 0;
blank_flag = 1;
if (blank > FB_BLANK_POWERDOWN)
blank = FB_BLANK_POWERDOWN;
event.info = info;
event.data = ␣
early_ret = fb_notifier_call_chain(FB_EARLY_EVENT_BLANK, &event);
if (info->fbops->fb_blank)
ret = info->fbops->fb_blank(blank, info);
if (!ret)
fb_notifier_call_chain(FB_EVENT_BLANK, &event);
else {
/*
* if fb_blank is failed then revert effects of
* the early blank event.
*/
if (!early_ret)
fb_notifier_call_chain(FB_R_EARLY_EVENT_BLANK, &event);
}
return ret;
}
EXPORT_SYMBOL(fb_blank);
/* no blank during xorg init */ 下面即为添加的代码,修改编译内核之后
即可改善屏幕闪烁现象