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

Commit b1f8ae8e authored by Jigarkumar Zala's avatar Jigarkumar Zala
Browse files

msm: camera: flash: Add torch handling in early PCR



Reentering video recording usecase with flash mode on, flashlow
operation triggered in early PCR to fire Torch. This change
adds FIRELOW opcode to support fire Torch.

Change-Id: Iffc6ad58b31bb27108af890796897dd37240253d
Signed-off-by: default avatarJigarkumar Zala <jzala@codeaurora.org>
parent a134943c
Loading
Loading
Loading
Loading
+26 −7
Original line number Diff line number Diff line
@@ -371,12 +371,12 @@ int cam_flash_apply_setting(struct cam_flash_ctrl *fctrl,

			if (flash_data->opcode ==
				CAMERA_SENSOR_FLASH_OP_FIREHIGH) {
				if (fctrl->flash_state !=
					CAM_FLASH_STATE_CONFIG) {
				if (fctrl->flash_state ==
					CAM_FLASH_STATE_START) {
					CAM_WARN(CAM_FLASH,
					"Cannot apply Start Dev:Prev state: %d",
					"Wrong state :Prev state: %d",
					fctrl->flash_state);
					return rc;
					return -EINVAL;
				}
				rc = cam_flash_prepare(fctrl, true);
				if (rc) {
@@ -387,8 +387,27 @@ int cam_flash_apply_setting(struct cam_flash_ctrl *fctrl,
				rc = cam_flash_high(fctrl, flash_data);
				if (rc)
					CAM_ERR(CAM_FLASH,
						"FLASH ON failed : %d",
						rc);
						"FLASH ON failed : %d", rc);
			}
			if (flash_data->opcode ==
				CAMERA_SENSOR_FLASH_OP_FIRELOW) {
				if (fctrl->flash_state ==
					CAM_FLASH_STATE_START) {
					CAM_WARN(CAM_FLASH,
					"Wrong state :Prev state: %d",
					fctrl->flash_state);
					return -EINVAL;
				}
				rc = cam_flash_prepare(fctrl, true);
				if (rc) {
					CAM_ERR(CAM_FLASH,
					"Enable Regulator Failed rc = %d", rc);
					return rc;
				}
				rc = cam_flash_low(fctrl, flash_data);
				if (rc)
					CAM_ERR(CAM_FLASH,
						"TORCH ON failed : %d", rc);
			}
			if (flash_data->opcode ==
				CAMERA_SENSOR_FLASH_OP_OFF) {
@@ -617,7 +636,7 @@ int cam_flash_parser(struct cam_flash_ctrl *fctrl, void *arg)
				CAM_FLASH_STATE_CONFIG;
			break;
		case CAMERA_SENSOR_FLASH_CMD_TYPE_INIT_FIRE:
			CAM_DBG(CAM_FLASH, "Widget Flash Operation");
			CAM_DBG(CAM_FLASH, "INIT Fire Operation");
				flash_operation_info =
					(struct cam_flash_set_on_off *) cmd_buf;
				fctrl->nrt_info.cmn_attr.count =
+8 −10
Original line number Diff line number Diff line
@@ -149,17 +149,15 @@ static int32_t cam_flash_driver_cmd(struct cam_flash_ctrl *fctrl,
			goto release_mutex;
		}

		if (fctrl->is_regulator_enabled == false) {
			rc = cam_flash_prepare(fctrl, true);
			if (rc) {
				CAM_ERR(CAM_FLASH,
					"Enable Regulator Failed rc = %d", rc);
				goto release_mutex;
			}
		rc = cam_flash_apply_setting(fctrl, 0);
		if (rc) {
			CAM_ERR(CAM_FLASH, "cannot apply settings rc = %d", rc);
			goto release_mutex;
		}

		fctrl->flash_state = CAM_FLASH_STATE_START;
		break;
	}