racer: fix cci tools can not access cci-device-1

16A/OV8856 use cci-2, it use cci-device-1 and cci-master-0,
modify cci driver to support access cci-2.

Change-Id: I64192fe24c62d6e6791e68bab02476f2645ee63d
Signed-off-by: liuwang2 <liuwang2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1476655
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Dawei Wang <wangdw10@motorola.com>
Reviewed-by: Long Cheng <chengl1@motorola.com>
Reviewed-by: Jian Zhang <zhangjo@motorola.com>
Reviewed-by: Zhuoran Xu <xuzr3@motorola.com>
Reviewed-by: Zhichao Chen <chenzc2@motorola.com>
Reviewed-by: Zhenxin Xi <xizx@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
liuwang2 2019-12-25 15:16:31 +08:00
commit f67102c9bd
2 changed files with 7 additions and 6 deletions

View file

@ -29,7 +29,7 @@ static int32_t cci_intf_xfer(
uint16_t addr;
struct cam_sensor_cci_client cci_info = {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)
.cci_subdev = cam_cci_get_subdev(CCI_DEVICE_0),
.cci_subdev = cam_cci_get_subdev(xfer->cci_device),
#else
.cci_subdev = cam_cci_get_subdev(),
#endif
@ -46,7 +46,7 @@ static int32_t cci_intf_xfer(
__func__, cmd, xfer->cci_bus, xfer->slave_addr,
xfer->reg.width, xfer->reg.addr, xfer->data.count);
if (xfer->cci_bus > 1 || xfer->slave_addr > 0x7F ||
if (xfer->cci_device > 1 || xfer->cci_bus > 1 || xfer->slave_addr > 0x7F ||
xfer->reg.width < 1 || xfer->reg.width > 2 ||
xfer->reg.addr > ((1<<(8*xfer->reg.width))-1) ||
xfer->data.count < 1 ||
@ -56,7 +56,7 @@ static int32_t cci_intf_xfer(
/* init */
cci_ctrl.cmd = MSM_CCI_INIT;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)
rc = v4l2_subdev_call(cam_cci_get_subdev(CCI_DEVICE_0),
rc = v4l2_subdev_call(cam_cci_get_subdev(xfer->cci_device),
#else
rc = v4l2_subdev_call(cam_cci_get_subdev(),
#endif
@ -78,7 +78,7 @@ static int32_t cci_intf_xfer(
cci_ctrl.cfg.cci_i2c_read_cfg.data = xfer->data.buf;
cci_ctrl.cfg.cci_i2c_read_cfg.num_byte = xfer->data.count;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)
rc = v4l2_subdev_call(cam_cci_get_subdev(CCI_DEVICE_0),
rc = v4l2_subdev_call(cam_cci_get_subdev(xfer->cci_device),
#else
rc = v4l2_subdev_call(cam_cci_get_subdev(),
#endif
@ -114,7 +114,7 @@ static int32_t cci_intf_xfer(
CAMERA_SENSOR_I2C_TYPE_BYTE;
cci_ctrl.cfg.cci_i2c_write_cfg.size = xfer->data.count;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)
rc = v4l2_subdev_call(cam_cci_get_subdev(CCI_DEVICE_0),
rc = v4l2_subdev_call(cam_cci_get_subdev(xfer->cci_device),
#else
rc = v4l2_subdev_call(cam_cci_get_subdev(),
#endif
@ -136,7 +136,7 @@ release:
/* release */
cci_ctrl.cmd = MSM_CCI_RELEASE;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)
rc2 = v4l2_subdev_call(cam_cci_get_subdev(CCI_DEVICE_0),
rc2 = v4l2_subdev_call(cam_cci_get_subdev(xfer->cci_device),
#else
rc2 = v4l2_subdev_call(cam_cci_get_subdev(),
#endif

View file

@ -31,6 +31,7 @@ struct msm_cci_intf_data {
};
struct msm_cci_intf_xfer {
unsigned short cci_device; /* 0 = DEVICE_0, 1 = DEVICE_1 */
unsigned short cci_bus; /* 0 = MASTER_0, 1 = MASTER_1 */
unsigned short slave_addr; /* 7-bit addr of intended device */
struct msm_cci_intf_register reg;