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

Commit 1c6adbe6 authored by Ivan Tiyanov's avatar Ivan Tiyanov
Browse files

msm: camera: Extend LED current for Dual LED support.



Extend LED current for Dual LED support.
Need two different current values for Dual LED.

Change-Id: I3ab2f3b0dd0ec665344fd5c5398957716fe3d0c4
Signed-off-by: default avatarIvan Tiyanov <ivant@codeaurora.org>
parent f74355c6
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@
#include "msm_camera_i2c.h"
#include "msm_sd.h"

#define MAX_LED_TRIGGERS 3

struct msm_led_flash_ctrl_t;

+6 −6
Original line number Diff line number Diff line
@@ -71,9 +71,9 @@ static int32_t msm_led_trigger_config(struct msm_led_flash_ctrl_t *fctrl,
	case MSM_CAMERA_LED_LOW:
		if (fctrl->torch_trigger) {
			max_curr_l = fctrl->torch_max_current;
			if (cfg->led_current > 0 &&
					cfg->led_current < max_curr_l) {
				curr_l = cfg->led_current;
			if (cfg->torch_current > 0 &&
				cfg->torch_current < max_curr_l) {
				curr_l = cfg->torch_current;
			} else {
				curr_l = fctrl->torch_op_current;
				pr_debug("LED current clamped to %d\n",
@@ -90,9 +90,9 @@ static int32_t msm_led_trigger_config(struct msm_led_flash_ctrl_t *fctrl,
		for (i = 0; i < fctrl->num_sources; i++)
			if (fctrl->flash_trigger[i]) {
				max_curr_l = fctrl->flash_max_current[i];
				if (cfg->led_current > 0 &&
						cfg->led_current < max_curr_l) {
					curr_l = cfg->led_current;
				if (cfg->flash_current[i] > 0 &&
					cfg->flash_current[i] < max_curr_l) {
					curr_l = cfg->flash_current[i];
				} else {
					curr_l = fctrl->flash_op_current[i];
					pr_debug("LED current clamped to %d\n",
+4 −1
Original line number Diff line number Diff line
@@ -52,6 +52,8 @@

#define MAX_AF_ITERATIONS 3

#define MAX_LED_TRIGGERS 3

enum flash_type {
	LED_FLASH = 1,
	STROBE_FLASH,
@@ -599,7 +601,8 @@ enum msm_camera_led_config_t {

struct msm_camera_led_cfg_t {
	enum msm_camera_led_config_t cfgtype;
	uint32_t led_current;
	uint32_t torch_current;
	uint32_t flash_current[MAX_LED_TRIGGERS];
};

/* sensor init structures and enums */