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

Commit 25c2c7fa 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: sensor: Add support for 3B read"

parents cbabcdfc f641e268
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -846,13 +846,12 @@ static int32_t msm_cci_i2c_read(struct v4l2_subdev *sd,
		goto ERROR;
	}

	if (read_cfg->addr_type == MSM_CAMERA_I2C_BYTE_ADDR)
		val = CCI_I2C_WRITE_DISABLE_P_CMD | (read_cfg->addr_type << 4) |
			((read_cfg->addr & 0xFF) << 8);
	if (read_cfg->addr_type == MSM_CAMERA_I2C_WORD_ADDR)
		val = CCI_I2C_WRITE_DISABLE_P_CMD | (read_cfg->addr_type << 4) |
			(((read_cfg->addr & 0xFF00) >> 8) << 8) |
			((read_cfg->addr & 0xFF) << 16);
	val = CCI_I2C_WRITE_DISABLE_P_CMD | (read_cfg->addr_type << 4);
	for (i = 0; i < read_cfg->addr_type; i++) {
		val |= ((read_cfg->addr >> (i << 3)) & 0xFF)  <<
		((read_cfg->addr_type - i) << 3);
	}

	rc = msm_cci_write_i2c_queue(cci_dev, val, master, queue);
	if (rc < 0) {
		CDBG("%s failed line %d\n", __func__, __LINE__);
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ struct msm_camera_cci_gpio_cfg {
};

struct msm_camera_cci_i2c_read_cfg {
	uint16_t addr;
	uint32_t addr;
	enum msm_camera_i2c_reg_addr_type addr_type;
	uint8_t *data;
	uint16_t num_byte;
+4 −2
Original line number Diff line number Diff line
@@ -27,7 +27,8 @@ int32_t msm_camera_cci_i2c_read(struct msm_camera_i2c_client *client,
	struct msm_camera_cci_ctrl cci_ctrl;

	if ((client->addr_type != MSM_CAMERA_I2C_BYTE_ADDR
		&& client->addr_type != MSM_CAMERA_I2C_WORD_ADDR)
		&& client->addr_type != MSM_CAMERA_I2C_WORD_ADDR
		&& client->addr_type != MSM_CAMERA_I2C_3B_ADDR)
		|| (data_type != MSM_CAMERA_I2C_BYTE_DATA
		&& data_type != MSM_CAMERA_I2C_WORD_DATA))
		return rc;
@@ -63,7 +64,8 @@ int32_t msm_camera_cci_i2c_read_seq(struct msm_camera_i2c_client *client,
	struct msm_camera_cci_ctrl cci_ctrl;

	if ((client->addr_type != MSM_CAMERA_I2C_BYTE_ADDR
		&& client->addr_type != MSM_CAMERA_I2C_WORD_ADDR)
		&& client->addr_type != MSM_CAMERA_I2C_WORD_ADDR
		&& client->addr_type != MSM_CAMERA_I2C_3B_ADDR)
		|| num_byte == 0)
		return rc;