mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
leds: qti-flash: Fix updating flags when disabling flash/torch device
Currently when brightness is zeroed-out for a flash/torch device its "configured" flag is set to false. Hence the flash/torch device is ignored when its switch is disabled. This leads to the corresponding LED channel left enabled. Fix this by setting "configured" flag to false only when led strobe is de-asserted. Change-Id: I46c640d3e0db8611343e2e67321db820161dd144 Signed-off-by: Shyam Kumar Thella <sthella@codeaurora.org>
This commit is contained in:
parent
158a6ac631
commit
d06911ff63
1 changed files with 3 additions and 1 deletions
|
|
@ -257,6 +257,8 @@ static int qti_flash_led_strobe(struct flash_node_data *fnode,
|
|||
if (rc < 0)
|
||||
goto error;
|
||||
|
||||
fnode->configured = false;
|
||||
|
||||
if (led->ref_count)
|
||||
led->ref_count--;
|
||||
|
||||
|
|
@ -353,7 +355,7 @@ static int qti_flash_led_disable(struct flash_node_data *fnode)
|
|||
if (rc < 0)
|
||||
goto out;
|
||||
|
||||
fnode->configured = false;
|
||||
fnode->current_ma = 0;
|
||||
|
||||
out:
|
||||
spin_unlock(&led->lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue