mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
dlkm: aw2033: set blink mode brightness
- set blink mode brightness, change as set by upper layer - add logs to debug brightness change issue Change-Id: Ia602012a27b7d9aacad1ab66148f9d7618141f77 Signed-off-by: wangyq13 <[email protected]> Reviewed-on: https://gerrit.mot.com/2294938 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Yuecai Liu <[email protected]> Reviewed-by: Huosheng Liao <[email protected]> Submit-Approved: Jira Key
This commit is contained in:
parent
be6a9eccb7
commit
f04c87e4f3
1 changed files with 5 additions and 1 deletions
|
|
@ -200,7 +200,10 @@ static void aw2033_led_blink_set(struct aw2033_led *led, unsigned long blinking)
|
|||
msleep(2);
|
||||
}
|
||||
|
||||
led->cdev.brightness = blinking ? led->cdev.max_brightness : 0;
|
||||
led->cdev.brightness = blinking;
|
||||
if (led->cdev.brightness > led->cdev.max_brightness)
|
||||
led->cdev.brightness = led->cdev.max_brightness;
|
||||
pr_info("aw2033_led_blink_set %ld %d\n", blinking, led->cdev.brightness);
|
||||
if (blinking > 0) {
|
||||
aw2033_write(led, AW2033_REG_GCR2, led->pdata->imax);
|
||||
aw2033_write(led, AW2033_REG_PWM0 + led->id, led->cdev.brightness);
|
||||
|
|
@ -234,6 +237,7 @@ static void aw2033_set_brightness(struct led_classdev *cdev,
|
|||
struct aw2033_led *led = container_of(cdev, struct aw2033_led, cdev);
|
||||
|
||||
led->cdev.brightness = brightness;
|
||||
pr_info("aw2033_set_brightness %d\n", brightness);
|
||||
|
||||
schedule_work(&led->brightness_work);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue