RK3288开发过程中遇到的问题点和解决方法之Kernel

修改背光改变区间

kernel\drivers\video\backlight\pwm_bl.c

static int pwm_backlight_update_status(struct backlight_device *bl)
  {
   struct pwm_bl_data *pb = bl_get_data(bl);
      int brightness = bl->props.brightness;
      int duty_cycle;
 
     if (bl->props.power != FB_BLANK_UNBLANK ||
         bl->props.fb_blank != FB_BLANK_UNBLANK ||
         bl->props.state & BL_CORE_FBBLANK)
         brightness = 0;

     if (pb->notify)
         brightness = pb->notify(pb->dev, brightness);
//此处修改区间值
     if (brightness > 0) {
        if(brightness<50)
             brightness=50;
         duty_cycle = compute_duty_cycle(pb, brightness);
         pwm_config(pb->pwm, duty_cycle, pb->period);
         pwm_backlight_power_on(pb, brightness);
     } else
         pwm_backlight_power_off(pb);
 
     if (pb->notify_after)
         pb->notify_after(pb->dev, brightness);
 
     return 0;
 }   

 

posted @ 2017-02-14 10:27  Mr古月  阅读(1705)  评论(0编辑  收藏  举报