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

Commit 2b490d2c authored by Lokesh Kumar Aakulu's avatar Lokesh Kumar Aakulu
Browse files

msm: camera: Fix CCI I2C write fail to write for reg addr 0x00



Allow CCI I2C write to 0x00 addressed register in data queue.

Change-Id: I6f3844c95fd6e6d258326e410826da0ee3c27bda
Signed-off-by: default avatarLokesh Kumar Aakulu <lkumar@codeaurora.org>
parent 3482d810
Loading
Loading
Loading
Loading
+16 −18
Original line number Diff line number Diff line
@@ -219,7 +219,6 @@ static int32_t msm_cci_data_queue(struct cci_device *cci_dev,
			cmd_size, i2c_cmd->reg_addr, i2c_cmd->reg_data);
		delay = i2c_cmd->delay;
		data[i++] = CCI_I2C_WRITE_CMD;
		if (i2c_cmd->reg_addr)
		reg_addr = i2c_cmd->reg_addr;
		/* either byte or word addr */
		if (i2c_msg->addr_type == MSM_CAMERA_I2C_BYTE_ADDR)
@@ -229,7 +228,6 @@ 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++;
@@ -244,7 +242,7 @@ static int32_t msm_cci_data_queue(struct cci_device *cci_dev,
				break;
		}
		i2c_cmd++;
		} while (--cmd_size && !i2c_cmd->reg_addr && (i <= 10));
		--cmd_size;
		data[0] |= ((i-1) << 4);
		len = ((i-1)/4) + 1;
		rc = msm_cci_validate_queue(cci_dev, len, master, queue);