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

Commit ae66c60d authored by Jigarkumar Zala's avatar Jigarkumar Zala Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: flash: Remove wrong bubble condition check



Bubble flag is set from userspace for every pd table in crm.
Wrong bubble flag check does not allow flash to fire in normal
condition. Remove bubble condition check resolve the issue for
both usecases.

Change-Id: If1399e8361c5459f55e7ff6a0bd0f3ebd77aebe8
Signed-off-by: default avatarJigarkumar Zala <jzala@codeaurora.org>
parent 2e180d28
Loading
Loading
Loading
Loading
+19 −14
Original line number Diff line number Diff line
@@ -493,8 +493,14 @@ int cam_flash_apply_setting(struct cam_flash_ctrl *fctrl,
					"Flash off failed %d", rc);
				goto apply_setting_err;
			}
		} else if (flash_data->opcode == CAM_PKT_NOP_OPCODE) {
			flash_data->opcode = 0;
			CAM_DBG(CAM_FLASH, "NOP Packet");
		} else {
			CAM_DBG(CAM_FLASH, "NOP opcode: req_id: %u", req_id);
			rc = -EINVAL;
			CAM_ERR(CAM_FLASH, "Invalid opcode: %d req_id: %llu",
				flash_data->opcode, req_id);
			goto apply_setting_err;
		}
	}

@@ -765,17 +771,20 @@ int cam_flash_parser(struct cam_flash_ctrl *fctrl, void *arg)
		break;
	}
	case CAM_PKT_NOP_OPCODE: {
		frm_offset = csl_packet->header.request_id %
			MAX_PER_FRAME_ARRAY;
		if ((fctrl->flash_state == CAM_FLASH_STATE_INIT) ||
			(fctrl->flash_state == CAM_FLASH_STATE_ACQUIRE)) {
			CAM_WARN(CAM_FLASH,
				"Rxed NOP packets without linking");
			frm_offset = csl_packet->header.request_id %
				MAX_PER_FRAME_ARRAY;
			fctrl->per_frame[frm_offset].cmn_attr.is_settings_valid
				= false;
			return 0;
		}

		fctrl->per_frame[frm_offset].cmn_attr.is_settings_valid = false;
		fctrl->per_frame[frm_offset].cmn_attr.request_id = 0;
		fctrl->per_frame[frm_offset].opcode = CAM_PKT_NOP_OPCODE;
		CAM_DBG(CAM_FLASH, "NOP Packet is Received: req_id: %u",
			csl_packet->header.request_id);
		goto update_req_mgr;
@@ -925,19 +934,15 @@ int cam_flash_apply_request(struct cam_req_mgr_apply_request *apply)
	fctrl = (struct cam_flash_ctrl *) cam_get_device_priv(apply->dev_hdl);
	if (!fctrl) {
		CAM_ERR(CAM_FLASH, "Device data is NULL");
		rc = -EINVAL;
		goto free_resource;
		return -EINVAL;
	}

	if (!(apply->report_if_bubble)) {
	mutex_lock(&fctrl->flash_wq_mutex);
	rc = cam_flash_apply_setting(fctrl, apply->request_id);
	if (rc)
		CAM_ERR(CAM_FLASH, "apply_setting failed with rc=%d",
			rc);
	mutex_unlock(&fctrl->flash_wq_mutex);
	}

free_resource:
	return rc;
}
+4 −4
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ struct cam_flash_intf_params {
 */
struct cam_flash_common_attr {
	bool      is_settings_valid;
	int32_t  request_id;
	uint64_t  request_id;
	uint16_t  count;
	uint8_t   cmd_type;
};