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

Commit 0583b99a authored by Xu Han's avatar Xu Han
Browse files

msm: camera: Fix LED current for Dual LED support



This change is required for dual LED usecase where
flash/torch current = 0 is valid value. With this
change, current = 0 from user is treated as LED off
instead of LED on with default current.

Change-Id: I3d35e58bba38ba3cdf85aa24f0588f3a4c1219ac
Signed-off-by: default avatarIvan Tiyanov <ivant@codeaurora.org>
Signed-off-by: default avatarXu Han <hanxu@codeaurora.org>
parent 3511ae2a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ static int32_t msm_led_trigger_config(struct msm_led_flash_ctrl_t *fctrl,
		for (i = 0; i < fctrl->torch_num_sources; i++)
			if (fctrl->torch_trigger[i]) {
				max_curr_l = fctrl->torch_max_current[i];
				if (cfg->torch_current[i] > 0 &&
				if (cfg->torch_current[i] >= 0 &&
					cfg->torch_current[i] < max_curr_l) {
					curr_l = cfg->torch_current[i];
				} else {
@@ -92,7 +92,7 @@ static int32_t msm_led_trigger_config(struct msm_led_flash_ctrl_t *fctrl,
		for (i = 0; i < fctrl->flash_num_sources; i++)
			if (fctrl->flash_trigger[i]) {
				max_curr_l = fctrl->flash_max_current[i];
				if (cfg->flash_current[i] > 0 &&
				if (cfg->flash_current[i] >= 0 &&
					cfg->flash_current[i] < max_curr_l) {
					curr_l = cfg->flash_current[i];
				} else {