diff --git a/drivers/media/platform/msm/camera/cam_sensor_module/cam_cci/Kbuild b/drivers/media/platform/msm/camera/cam_sensor_module/cam_cci/Kbuild index 242c13da5e4f..3da778fe1a02 100644 --- a/drivers/media/platform/msm/camera/cam_sensor_module/cam_cci/Kbuild +++ b/drivers/media/platform/msm/camera/cam_sensor_module/cam_cci/Kbuild @@ -1,4 +1,8 @@ -KERNEL_SOURCE_PATH ?= kernel/msm-4.9 +ifeq ($(TARGET_KERNEL_VERSION),$(filter $(TARGET_KERNEL_VERSION),4.19)) + KERNEL_SOURCE_PATH ?= kernel/msm-4.19 +else + KERNEL_SOURCE_PATH ?= kernel/msm-4.9 +endif EXTRA_CFLAGS += -Wall EXTRA_CFLAGS += -I$(TOP)/motorola/kernel/modules/include diff --git a/drivers/media/platform/msm/camera/cam_sensor_module/cam_cci/cci_intf.c b/drivers/media/platform/msm/camera/cam_sensor_module/cam_cci/cci_intf.c index 258fd7a3900e..f8c45ddc6a3e 100644 --- a/drivers/media/platform/msm/camera/cam_sensor_module/cam_cci/cci_intf.c +++ b/drivers/media/platform/msm/camera/cam_sensor_module/cam_cci/cci_intf.c @@ -16,18 +16,23 @@ #include #include +#include #include #include #include static int32_t cci_intf_xfer( struct msm_cci_intf_xfer *xfer, - int cmd) + unsigned int cmd) { int32_t rc, rc2; 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(xfer->cci_bus), +#else .cci_subdev = cam_cci_get_subdev(), +#endif .cci_i2c_master = xfer->cci_bus, .sid = xfer->slave_addr, }; @@ -50,7 +55,11 @@ 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(xfer->cci_bus), +#else rc = v4l2_subdev_call(cam_cci_get_subdev(), +#endif core, ioctl, VIDIOC_MSM_CCI_CFG, &cci_ctrl); if (rc < 0) { pr_err("%s: cci init fail (%d)\n", __func__, rc); @@ -68,7 +77,11 @@ static int32_t cci_intf_xfer( CAMERA_SENSOR_I2C_TYPE_WORD); 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(xfer->cci_bus), +#else rc = v4l2_subdev_call(cam_cci_get_subdev(), +#endif core, ioctl, VIDIOC_MSM_CCI_CFG, &cci_ctrl); if (rc < 0) { pr_err("%s: cci read fail (%d)\n", __func__, rc); @@ -100,7 +113,11 @@ static int32_t cci_intf_xfer( cci_ctrl.cfg.cci_i2c_write_cfg.data_type = 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(xfer->cci_bus), +#else rc = v4l2_subdev_call(cam_cci_get_subdev(), +#endif core, ioctl, VIDIOC_MSM_CCI_CFG, &cci_ctrl); kfree(reg_conf_tbl); if (rc < 0) { @@ -118,7 +135,11 @@ static int32_t cci_intf_xfer( 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(xfer->cci_bus), +#else rc2 = v4l2_subdev_call(cam_cci_get_subdev(), +#endif core, ioctl, VIDIOC_MSM_CCI_CFG, &cci_ctrl); if (rc2 < 0) { pr_err("%s: cci release fail (%d)\n", __func__, rc2);