mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
backlight: atmel-pwm-bl: clean up get_intensity
Clean up get_intensity to increase readability. Signed-off-by: Johan Hovold <[email protected]> Acked-by: Jingoo Han <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
ce726c9738
commit
9a26a84e3f
1 changed files with 6 additions and 7 deletions
|
|
@ -70,15 +70,14 @@ static int atmel_pwm_bl_set_intensity(struct backlight_device *bd)
|
|||
static int atmel_pwm_bl_get_intensity(struct backlight_device *bd)
|
||||
{
|
||||
struct atmel_pwm_bl *pwmbl = bl_get_data(bd);
|
||||
u32 cdty;
|
||||
u32 intensity;
|
||||
|
||||
if (pwmbl->pdata->pwm_active_low) {
|
||||
intensity = pwm_channel_readl(&pwmbl->pwmc, PWM_CDTY) -
|
||||
pwmbl->pdata->pwm_duty_min;
|
||||
} else {
|
||||
intensity = pwmbl->pdata->pwm_duty_max -
|
||||
pwm_channel_readl(&pwmbl->pwmc, PWM_CDTY);
|
||||
}
|
||||
cdty = pwm_channel_readl(&pwmbl->pwmc, PWM_CDTY);
|
||||
if (pwmbl->pdata->pwm_active_low)
|
||||
intensity = cdty - pwmbl->pdata->pwm_duty_min;
|
||||
else
|
||||
intensity = pwmbl->pdata->pwm_duty_max - cdty;
|
||||
|
||||
return intensity & 0xffff;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue