Merge "NFC: Read NFCC is fused or unfused"
diff --git a/drivers/media/platform/msm/camera_v2/sensor/cci/msm_cci.c b/drivers/media/platform/msm/camera_v2/sensor/cci/msm_cci.c
index 270fb38..e5d82fd 100644
--- a/drivers/media/platform/msm/camera_v2/sensor/cci/msm_cci.c
+++ b/drivers/media/platform/msm/camera_v2/sensor/cci/msm_cci.c
@@ -211,13 +211,23 @@
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;
- reg_addr = i2c_cmd->reg_addr;
+
+ /* 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;
@@ -226,21 +236,25 @@
data[i++] = reg_addr & 0x00FF;
}
/* max of 10 data bytes */
- if (i2c_msg->data_type == MSM_CAMERA_I2C_BYTE_DATA) {
- data[i++] = i2c_cmd->reg_data;
- reg_addr++;
- } else {
- if ((i + 1) <= 10) {
- data[i++] = (i2c_cmd->reg_data &
- 0xFF00) >> 8; /* MSB */
- data[i++] = i2c_cmd->reg_data &
- 0x00FF; /* LSB */
- reg_addr += 2;
- } else
- break;
- }
- i2c_cmd++;
- --cmd_size;
+ do {
+ if (i2c_msg->data_type == MSM_CAMERA_I2C_BYTE_DATA) {
+ data[i++] = i2c_cmd->reg_data;
+ reg_addr++;
+ } else {
+ if ((i + 1) <= 10) {
+ data[i++] = (i2c_cmd->reg_data &
+ 0xFF00) >> 8; /* MSB */
+ data[i++] = i2c_cmd->reg_data &
+ 0x00FF; /* LSB */
+ reg_addr += 2;
+ } else
+ break;
+ }
+ 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);
@@ -789,6 +803,7 @@
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:
diff --git a/drivers/media/platform/msm/camera_v2/sensor/cci/msm_cci.h b/drivers/media/platform/msm/camera_v2/sensor/cci/msm_cci.h
index 44c134e..283bd28 100644
--- a/drivers/media/platform/msm/camera_v2/sensor/cci/msm_cci.h
+++ b/drivers/media/platform/msm/camera_v2/sensor/cci/msm_cci.h
@@ -53,6 +53,7 @@
MSM_CCI_SET_SYNC_CID,
MSM_CCI_I2C_READ,
MSM_CCI_I2C_WRITE,
+ MSM_CCI_I2C_WRITE_SEQ,
MSM_CCI_GPIO_WRITE,
};
diff --git a/drivers/media/platform/msm/camera_v2/sensor/io/msm_camera_cci_i2c.c b/drivers/media/platform/msm/camera_v2/sensor/io/msm_camera_cci_i2c.c
index 8d9274b..6af0cea 100644
--- a/drivers/media/platform/msm/camera_v2/sensor/io/msm_camera_cci_i2c.c
+++ b/drivers/media/platform/msm/camera_v2/sensor/io/msm_camera_cci_i2c.c
@@ -158,7 +158,7 @@
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;
diff --git a/drivers/misc/qseecom.c b/drivers/misc/qseecom.c
index 276a6dc..399cea9 100644
--- a/drivers/misc/qseecom.c
+++ b/drivers/misc/qseecom.c
@@ -1115,8 +1115,8 @@
bool found_dead_app = false;
if (!memcmp(data->client.app_name, "keymaste", strlen("keymaste"))) {
- pr_warn("Do not unload keymaster app from tz\n");
- return 0;
+ pr_debug("Do not unload keymaster app from tz\n");
+ goto unload_exit;
}
if (data->client.app_id > 0) {
@@ -1211,6 +1211,7 @@
spin_unlock_irqrestore(&qseecom.registered_app_list_lock,
flags1);
}
+unload_exit:
qseecom_unmap_ion_allocated_memory(data);
data->released = true;
return ret;