mirror of
https://github.com/genesi/linux-legacy.git
synced 2026-09-23 07:05:27 +00:00
backlight: jiggle the order of powering on backlight and deconfiguring the backlight PWM on blank/restore. Also, don't mess with the IO state of the PWM pin, if the PWM is disabled, it's disabled, all we need to do is turn the power off.
This commit is contained in:
@@ -120,24 +120,10 @@ static struct gpio_led mx51_efikasb_leds[] = {
|
||||
};
|
||||
|
||||
#if defined(CONFIG_BACKLIGHT_PWM)
|
||||
static void mx51_efikasb_backlight_power(int on)
|
||||
static void mx51_efikasb_backlight_power(int state)
|
||||
{
|
||||
if (on) {
|
||||
mxc_free_iomux(EFIKASB_PWM_BACKLIGHT, IOMUX_CONFIG_GPIO);
|
||||
mxc_request_iomux(EFIKASB_PWM_BACKLIGHT, IOMUX_CONFIG_ALT1);
|
||||
|
||||
msleep(10);
|
||||
|
||||
gpio_set_value(IOMUX_TO_GPIO(EFIKASB_PWM_BACKLIGHT_EN), 0); /* Backlight Power On */
|
||||
} else {
|
||||
gpio_set_value(IOMUX_TO_GPIO(EFIKASB_PWM_BACKLIGHT_EN), 1); /* Backlight Power Off */
|
||||
|
||||
msleep(10);
|
||||
|
||||
mxc_free_iomux(EFIKASB_PWM_BACKLIGHT, IOMUX_CONFIG_ALT1);
|
||||
mxc_request_iomux(EFIKASB_PWM_BACKLIGHT, IOMUX_CONFIG_GPIO);
|
||||
gpio_direction_output(IOMUX_TO_GPIO(EFIKASB_PWM_BACKLIGHT), 0);
|
||||
}
|
||||
msleep(10);
|
||||
gpio_set_value(IOMUX_TO_GPIO(EFIKASB_PWM_BACKLIGHT_EN), !state);
|
||||
}
|
||||
|
||||
static struct platform_pwm_backlight_data mx51_efikasb_backlight_data = {
|
||||
|
||||
@@ -50,12 +50,12 @@ static int pwm_backlight_update_status(struct backlight_device *bl)
|
||||
brightness = pb->notify(brightness);
|
||||
|
||||
if (brightness == 0) {
|
||||
pwm_config(pb->pwm, 0, pb->period);
|
||||
pwm_disable(pb->pwm);
|
||||
if (pb->power) {
|
||||
pb->power(0);
|
||||
pb->power_state = 0;
|
||||
}
|
||||
pwm_config(pb->pwm, 0, pb->period);
|
||||
pwm_disable(pb->pwm);
|
||||
} else {
|
||||
pwm_config(pb->pwm, brightness * pb->period / max, pb->period);
|
||||
pwm_enable(pb->pwm);
|
||||
@@ -87,12 +87,12 @@ static void pwm_bl_blank(struct pwm_bl_data *pb, int type)
|
||||
case FB_BLANK_POWERDOWN:
|
||||
case FB_BLANK_VSYNC_SUSPEND:
|
||||
case FB_BLANK_HSYNC_SUSPEND:
|
||||
pwm_config(pb->pwm, 0, pb->period);
|
||||
pwm_disable(pb->pwm);
|
||||
if (pb->power) {
|
||||
pb->power(0);
|
||||
pb->power_state = 0;
|
||||
}
|
||||
pwm_config(pb->pwm, 0, pb->period);
|
||||
pwm_disable(pb->pwm);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user