pastebin - collaborative debugging tool
eckelmann.kpaste.net RSS


HACK in pwm_bl to avoid flicker
Posted by Anonymous on Fri 3rd Aug 2018 12:52
raw | new post

  1. diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
  2. index 1c2289ddd555..dbdc9dc9bbb1 100644
  3. --- a/drivers/video/backlight/pwm_bl.c
  4. +++ b/drivers/video/backlight/pwm_bl.c
  5. @@ -23,6 +23,7 @@
  6.  #include <linux/pwm_backlight.h>
  7.  #include <linux/regulator/consumer.h>
  8.  #include <linux/slab.h>
  9. +#include <linux/delay.h>
  10.  
  11.  struct pwm_bl_data {
  12.     struct pwm_device   *pwm;
  13. @@ -54,10 +55,13 @@ static void pwm_backlight_power_on(struct pwm_bl_data *pb, int brightness)
  14.     if (err < 0)
  15.         dev_err(pb->dev, "failed to enable power supply\n");
  16.  
  17. +   pwm_enable(pb->pwm);
  18. +
  19. +   msleep_interruptible(100);
  20. +
  21.     if (pb->enable_gpio)
  22.         gpiod_set_value_cansleep(pb->enable_gpio, 1);
  23.  
  24. -   pwm_enable(pb->pwm);
  25.     pb->enabled = true;
  26.  }

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}





All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at