summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2018-01-19 20:10:34 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2018-01-19 20:10:34 -0800
commit5cbcd25aeaa3ca26417b19534866e492ed04625f (patch)
tree6c8b29f60c835f706b58ce9d989c4ec6301048bb
parenta407c5262df571401dc035fe8142bf161f1ccfce (diff)
parent2e21ea63b32cbf4a2bf082e88b312c304f7353ef (diff)
Merge "leds: qpnp-flash-v2: Update IRES for active LEDs"
-rw-r--r--drivers/leds/leds-qpnp-flash-v2.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/leds/leds-qpnp-flash-v2.c b/drivers/leds/leds-qpnp-flash-v2.c
index de13d3367648..ec3f68b5d406 100644
--- a/drivers/leds/leds-qpnp-flash-v2.c
+++ b/drivers/leds/leds-qpnp-flash-v2.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -1103,10 +1103,11 @@ static int qpnp_flash_led_switch_set(struct flash_switch_data *snode, bool on)
return rc;
}
- /* Iterate over all leds for this switch node */
+ /* Iterate over all active leds for this switch node */
val = 0;
for (i = 0; i < led->num_fnodes; i++)
- if (snode->led_mask & BIT(led->fnode[i].id))
+ if (led->fnode[i].led_on &&
+ snode->led_mask & BIT(led->fnode[i].id))
val |= led->fnode[i].ires_idx << (led->fnode[i].id * 2);
rc = qpnp_flash_led_masked_write(led, FLASH_LED_REG_IRES(led->base),