u16 idle_pos;
struct regulator *vdd;
struct notifier_block notifier;
+ bool first;
};
static inline struct dw9807_device *sd_to_dw9807_vcm(
return ret;
}
+ dw9807_dev->first = true;
+
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);
+ int start = (dev_vcm->first) ? dev_vcm->current_val : ctrl->val;
+ dev_vcm->first = false;
dev_vcm->current_val = ctrl->val;
- return dw9807_ramp(client, ctrl->val, ctrl->val);
+ return dw9807_ramp(client, start, ctrl->val);
}
return -EINVAL;