The power up/down sequence is already ramped. Extend this to
the first user movement as well, as this will generally avoid
the "tick" noises due to rapid movements and overshooting.
Subsequent movements are generally smaller and so don't cause
issues.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
[sw0312.kim: cherry-pick raspberry pi kernel upstream to support rpi camera module v3]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I96f63baa59ecbac8f873953701b90e3c35f18d60
u16 idle_pos;
struct regulator *vdd;
struct notifier_block notifier;
u16 idle_pos;
struct regulator *vdd;
struct notifier_block notifier;
};
static inline struct dw9807_device *sd_to_dw9807_vcm(
};
static inline struct dw9807_device *sd_to_dw9807_vcm(
+ dw9807_dev->first = true;
+
return dw9807_ramp(client, dw9807_dev->idle_pos, dw9807_dev->current_val);
}
return dw9807_ramp(client, dw9807_dev->idle_pos, dw9807_dev->current_val);
}
if (ctrl->id == V4L2_CID_FOCUS_ABSOLUTE) {
struct i2c_client *client = v4l2_get_subdevdata(&dev_vcm->sd);
if (ctrl->id == V4L2_CID_FOCUS_ABSOLUTE) {
struct i2c_client *client = v4l2_get_subdevdata(&dev_vcm->sd);
+ int start = (dev_vcm->first) ? dev_vcm->current_val : ctrl->val;
+ dev_vcm->first = false;
dev_vcm->current_val = ctrl->val;
dev_vcm->current_val = ctrl->val;
- return dw9807_ramp(client, ctrl->val, ctrl->val);
+ return dw9807_ramp(client, start, ctrl->val);