• Home
  • Raw
  • Download

Lines Matching +full:lens +full:- +full:focus

1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (c) 2015--2017 Intel Corporation.
8 #include <media/v4l2-ctrls.h>
9 #include <media/v4l2-device.h>
14 * This sets the minimum granularity for the focus positions.
15 * A value of 1 gives maximum accuracy for a desired focus position
19 * This acts as the minimum granularity of lens movement.
21 * uniformly adjusted for gradual lens movement, with desired
42 return container_of(ctrl->handler, struct dw9714_device, ctrls_vcm); in to_dw9714_vcm()
57 dev_err(&client->dev, "I2C write fail\n"); in dw9714_i2c_write()
58 return -EIO; in dw9714_i2c_write()
65 struct i2c_client *client = v4l2_get_subdevdata(&dw9714_dev->sd); in dw9714_t_focus_vcm()
67 dw9714_dev->current_val = val; in dw9714_t_focus_vcm()
76 if (ctrl->id == V4L2_CID_FOCUS_ABSOLUTE) in dw9714_set_ctrl()
77 return dw9714_t_focus_vcm(dev_vcm, ctrl->val); in dw9714_set_ctrl()
79 return -EINVAL; in dw9714_set_ctrl()
90 rval = pm_runtime_get_sync(sd->dev); in dw9714_open()
92 pm_runtime_put_noidle(sd->dev); in dw9714_open()
101 pm_runtime_put(sd->dev); in dw9714_close()
115 v4l2_async_unregister_subdev(&dw9714_dev->sd); in dw9714_subdev_cleanup()
116 v4l2_ctrl_handler_free(&dw9714_dev->ctrls_vcm); in dw9714_subdev_cleanup()
117 media_entity_cleanup(&dw9714_dev->sd.entity); in dw9714_subdev_cleanup()
122 struct v4l2_ctrl_handler *hdl = &dev_vcm->ctrls_vcm; in dw9714_init_controls()
130 if (hdl->error) in dw9714_init_controls()
131 dev_err(dev_vcm->sd.dev, "%s fail error: 0x%x\n", in dw9714_init_controls()
132 __func__, hdl->error); in dw9714_init_controls()
133 dev_vcm->sd.ctrl_handler = hdl; in dw9714_init_controls()
134 return hdl->error; in dw9714_init_controls()
142 dw9714_dev = devm_kzalloc(&client->dev, sizeof(*dw9714_dev), in dw9714_probe()
145 return -ENOMEM; in dw9714_probe()
147 v4l2_i2c_subdev_init(&dw9714_dev->sd, client, &dw9714_ops); in dw9714_probe()
148 dw9714_dev->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; in dw9714_probe()
149 dw9714_dev->sd.internal_ops = &dw9714_int_ops; in dw9714_probe()
155 rval = media_entity_pads_init(&dw9714_dev->sd.entity, 0, NULL); in dw9714_probe()
159 dw9714_dev->sd.entity.function = MEDIA_ENT_F_LENS; in dw9714_probe()
161 rval = v4l2_async_register_subdev(&dw9714_dev->sd); in dw9714_probe()
165 pm_runtime_set_active(&client->dev); in dw9714_probe()
166 pm_runtime_enable(&client->dev); in dw9714_probe()
167 pm_runtime_idle(&client->dev); in dw9714_probe()
172 v4l2_ctrl_handler_free(&dw9714_dev->ctrls_vcm); in dw9714_probe()
173 media_entity_cleanup(&dw9714_dev->sd.entity); in dw9714_probe()
183 pm_runtime_disable(&client->dev); in dw9714_remove()
191 * The lens position is gradually moved in units of DW9714_CTRL_STEPS,
201 for (val = dw9714_dev->current_val & ~(DW9714_CTRL_STEPS - 1); in dw9714_vcm_suspend()
202 val >= 0; val -= DW9714_CTRL_STEPS) { in dw9714_vcm_suspend()
215 * The lens position is gradually moved in units of DW9714_CTRL_STEPS,
225 for (val = dw9714_dev->current_val % DW9714_CTRL_STEPS; in dw9714_vcm_resume()
226 val < dw9714_dev->current_val + DW9714_CTRL_STEPS - 1; in dw9714_vcm_resume()