From 1d88e3036eee318fbd5c175abc7f48b0946465aa Mon Sep 17 00:00:00 2001 From: Hu Kejun Date: Thu, 8 Dec 2022 17:36:39 +0800 Subject: [PATCH] media: i2c: fp5510: fix set vcm config failed Signed-off-by: Hu Kejun Change-Id: I60291814215740e852feae28ce409d3b5335f563 --- drivers/media/i2c/fp5510.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/fp5510.c b/drivers/media/i2c/fp5510.c index 141159157eaa..1f720b120eb2 100644 --- a/drivers/media/i2c/fp5510.c +++ b/drivers/media/i2c/fp5510.c @@ -384,6 +384,8 @@ static int fp5510_set_pos(struct fp5510_device *dev_vcm, if (position > FP5510_MAX_REG) position = FP5510_MAX_REG; + dev_info(&client->dev, "%s: set dest_pos %d, position %d\n", __func__, dest_pos, position); + dev_vcm->current_lens_pos = position; dev_vcm->current_related_pos = dest_pos; msb = (0x00U | ((dev_vcm->current_lens_pos & 0x3F0U) >> 4U)); @@ -504,7 +506,7 @@ static void fp5510_update_vcm_cfg(struct fp5510_device *dev_vcm) VCMDRV_MAX_LOG * dev_vcm->step; dev_vcm->step_mode = dev_vcm->vcm_cfg.step_mode; - dev_dbg(&client->dev, + dev_info(&client->dev, "vcm_cfg: %d, %d, %d, max_ma %d\n", dev_vcm->vcm_cfg.start_ma, dev_vcm->vcm_cfg.rated_ma, @@ -561,13 +563,15 @@ static long fp5510_compat_ioctl32(struct v4l2_subdev *sd, unsigned int cmd, unsigned long arg) { struct i2c_client *client = v4l2_get_subdevdata(sd); - struct rk_cam_compat_vcm_tim __user *p32 = compat_ptr(arg); + void __user *up = compat_ptr(arg); struct rk_cam_compat_vcm_tim compat_vcm_tim; struct rk_cam_vcm_tim vcm_tim; struct rk_cam_vcm_cfg vcm_cfg; long ret; if (cmd == RK_VIDIOC_COMPAT_VCM_TIMEINFO) { + struct rk_cam_compat_vcm_tim __user *p32 = up; + ret = fp5510_ioctl(sd, RK_VIDIOC_VCM_TIMEINFO, &vcm_tim); compat_vcm_tim.vcm_start_t.tv_sec = vcm_tim.vcm_start_t.tv_sec; compat_vcm_tim.vcm_start_t.tv_usec =