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

Commit 71023e69 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: Fix CCI sequential write"

parents 3970860d 152e262f
Loading
Loading
Loading
Loading
+33 −18
Original line number Diff line number Diff line
@@ -213,13 +213,23 @@ static int32_t msm_cci_data_queue(struct cci_device *cci_dev,
		pr_err("%s failed line %d\n", __func__, __LINE__);
		return -EINVAL;
	}
	/* assume total size within the max queue */

	reg_addr = i2c_cmd->reg_addr;
	while (cmd_size) {
		CDBG("%s cmd_size %d addr 0x%x data 0x%x", __func__,
		CDBG("%s cmd_size %d addr 0x%x data 0x%x\n", __func__,
			cmd_size, i2c_cmd->reg_addr, i2c_cmd->reg_data);
		delay = i2c_cmd->delay;
		data[i++] = CCI_I2C_WRITE_CMD;

		/* in case of multiple command
		* MSM_CCI_I2C_WRITE : address is not continuous, so update
		*			address for a new packet.
		* MSM_CCI_I2C_WRITE_SEQ : address is continuous, need to keep
		*			the incremented address for a
		*			new packet */
		if (c_ctrl->cmd == MSM_CCI_I2C_WRITE)
			reg_addr = i2c_cmd->reg_addr;

		/* either byte or word addr */
		if (i2c_msg->addr_type == MSM_CAMERA_I2C_BYTE_ADDR)
			data[i++] = reg_addr;
@@ -228,6 +238,7 @@ static int32_t msm_cci_data_queue(struct cci_device *cci_dev,
			data[i++] = reg_addr & 0x00FF;
		}
		/* max of 10 data bytes */
		do {
			if (i2c_msg->data_type == MSM_CAMERA_I2C_BYTE_DATA) {
				data[i++] = i2c_cmd->reg_data;
				reg_addr++;
@@ -243,6 +254,9 @@ static int32_t msm_cci_data_queue(struct cci_device *cci_dev,
			}
			i2c_cmd++;
			--cmd_size;
		} while ((c_ctrl->cmd == MSM_CCI_I2C_WRITE_SEQ) &&
				(cmd_size > 0) && (i <= 10));

		data[0] |= ((i-1) << 4);
		len = ((i-1)/4) + 1;
		rc = msm_cci_validate_queue(cci_dev, len, master, queue);
@@ -867,6 +881,7 @@ static int32_t msm_cci_config(struct v4l2_subdev *sd,
		rc = msm_cci_i2c_read_bytes(sd, cci_ctrl);
		break;
	case MSM_CCI_I2C_WRITE:
	case MSM_CCI_I2C_WRITE_SEQ:
		rc = msm_cci_i2c_write(sd, cci_ctrl);
		break;
	case MSM_CCI_GPIO_WRITE:
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ enum msm_cci_cmd_type {
	MSM_CCI_SET_SYNC_CID,
	MSM_CCI_I2C_READ,
	MSM_CCI_I2C_WRITE,
	MSM_CCI_I2C_WRITE_SEQ,
	MSM_CCI_GPIO_WRITE,
};

+1 −1
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ int32_t msm_camera_cci_i2c_write_seq(struct msm_camera_i2c_client *client,
		reg_conf_tbl[i].reg_data = data[i];
		reg_conf_tbl[i].delay = 0;
	}
	cci_ctrl.cmd = MSM_CCI_I2C_WRITE;
	cci_ctrl.cmd = MSM_CCI_I2C_WRITE_SEQ;
	cci_ctrl.cci_info = client->cci_client;
	cci_ctrl.cfg.cci_i2c_write_cfg.reg_setting = reg_conf_tbl;
	cci_ctrl.cfg.cci_i2c_write_cfg.data_type = MSM_CAMERA_I2C_BYTE_DATA;