Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1b411f51 authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy
Browse files

leds: qpnp-flash-v2: Do not clear led_on when flash/torch brightness is 0



Currently, led_on flag is cleared whenever the brightness is set
to 0. This is incorrect as the led_on flag should be cleared only
when switch device is disabled. Fix it.

Change-Id: I7d70cb9588b55610dbc8eaf57338490ce82a0917
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent 14681b57
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1222,7 +1222,8 @@ static void qpnp_flash_led_node_set(struct flash_node_data *fnode, int value)
	fnode->cdev.brightness = prgm_current_ma;
	fnode->current_reg_val = get_current_reg_code(prgm_current_ma,
					fnode->ires_ua);
	fnode->led_on = prgm_current_ma != 0;
	if (prgm_current_ma)
		fnode->led_on = true;

	if (pmic_subtype != PMI632_SUBTYPE &&
	       led->pdata->chgr_mitigation_sel == FLASH_SW_CHARGER_MITIGATION) {