Lines Matching refs:dw9714_dev

66 static int dw9714_t_focus_vcm(struct dw9714_device *dw9714_dev, u16 val)  in dw9714_t_focus_vcm()  argument
68 struct i2c_client *client = v4l2_get_subdevdata(&dw9714_dev->sd); in dw9714_t_focus_vcm()
70 dw9714_dev->current_val = val; in dw9714_t_focus_vcm()
116 static void dw9714_subdev_cleanup(struct dw9714_device *dw9714_dev) in dw9714_subdev_cleanup() argument
118 v4l2_async_unregister_subdev(&dw9714_dev->sd); in dw9714_subdev_cleanup()
119 v4l2_ctrl_handler_free(&dw9714_dev->ctrls_vcm); in dw9714_subdev_cleanup()
120 media_entity_cleanup(&dw9714_dev->sd.entity); in dw9714_subdev_cleanup()
142 struct dw9714_device *dw9714_dev; in dw9714_probe() local
145 dw9714_dev = devm_kzalloc(&client->dev, sizeof(*dw9714_dev), in dw9714_probe()
147 if (dw9714_dev == NULL) in dw9714_probe()
150 dw9714_dev->vcc = devm_regulator_get(&client->dev, "vcc"); in dw9714_probe()
151 if (IS_ERR(dw9714_dev->vcc)) in dw9714_probe()
152 return PTR_ERR(dw9714_dev->vcc); in dw9714_probe()
154 rval = regulator_enable(dw9714_dev->vcc); in dw9714_probe()
162 v4l2_i2c_subdev_init(&dw9714_dev->sd, client, &dw9714_ops); in dw9714_probe()
163 dw9714_dev->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | in dw9714_probe()
165 dw9714_dev->sd.internal_ops = &dw9714_int_ops; in dw9714_probe()
167 rval = dw9714_init_controls(dw9714_dev); in dw9714_probe()
171 rval = media_entity_pads_init(&dw9714_dev->sd.entity, 0, NULL); in dw9714_probe()
175 dw9714_dev->sd.entity.function = MEDIA_ENT_F_LENS; in dw9714_probe()
177 rval = v4l2_async_register_subdev(&dw9714_dev->sd); in dw9714_probe()
188 regulator_disable(dw9714_dev->vcc); in dw9714_probe()
189 v4l2_ctrl_handler_free(&dw9714_dev->ctrls_vcm); in dw9714_probe()
190 media_entity_cleanup(&dw9714_dev->sd.entity); in dw9714_probe()
198 struct dw9714_device *dw9714_dev = sd_to_dw9714_vcm(sd); in dw9714_remove() local
203 ret = regulator_disable(dw9714_dev->vcc); in dw9714_remove()
210 dw9714_subdev_cleanup(dw9714_dev); in dw9714_remove()
222 struct dw9714_device *dw9714_dev = sd_to_dw9714_vcm(sd); in dw9714_vcm_suspend() local
228 for (val = dw9714_dev->current_val & ~(DW9714_CTRL_STEPS - 1); in dw9714_vcm_suspend()
237 ret = regulator_disable(dw9714_dev->vcc); in dw9714_vcm_suspend()
254 struct dw9714_device *dw9714_dev = sd_to_dw9714_vcm(sd); in dw9714_vcm_resume() local
260 ret = regulator_enable(dw9714_dev->vcc); in dw9714_vcm_resume()
267 for (val = dw9714_dev->current_val % DW9714_CTRL_STEPS; in dw9714_vcm_resume()
268 val < dw9714_dev->current_val + DW9714_CTRL_STEPS - 1; in dw9714_vcm_resume()