Lines Matching refs:ak7375_dev
115 static void ak7375_subdev_cleanup(struct ak7375_device *ak7375_dev) in ak7375_subdev_cleanup() argument
117 v4l2_async_unregister_subdev(&ak7375_dev->sd); in ak7375_subdev_cleanup()
118 v4l2_ctrl_handler_free(&ak7375_dev->ctrls_vcm); in ak7375_subdev_cleanup()
119 media_entity_cleanup(&ak7375_dev->sd.entity); in ak7375_subdev_cleanup()
142 struct ak7375_device *ak7375_dev; in ak7375_probe() local
145 ak7375_dev = devm_kzalloc(&client->dev, sizeof(*ak7375_dev), in ak7375_probe()
147 if (!ak7375_dev) in ak7375_probe()
150 v4l2_i2c_subdev_init(&ak7375_dev->sd, client, &ak7375_ops); in ak7375_probe()
151 ak7375_dev->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; in ak7375_probe()
152 ak7375_dev->sd.internal_ops = &ak7375_int_ops; in ak7375_probe()
153 ak7375_dev->sd.entity.function = MEDIA_ENT_F_LENS; in ak7375_probe()
155 ret = ak7375_init_controls(ak7375_dev); in ak7375_probe()
159 ret = media_entity_pads_init(&ak7375_dev->sd.entity, 0, NULL); in ak7375_probe()
163 ret = v4l2_async_register_subdev(&ak7375_dev->sd); in ak7375_probe()
174 v4l2_ctrl_handler_free(&ak7375_dev->ctrls_vcm); in ak7375_probe()
175 media_entity_cleanup(&ak7375_dev->sd.entity); in ak7375_probe()
183 struct ak7375_device *ak7375_dev = sd_to_ak7375_vcm(sd); in ak7375_remove() local
185 ak7375_subdev_cleanup(ak7375_dev); in ak7375_remove()
202 struct ak7375_device *ak7375_dev = sd_to_ak7375_vcm(sd); in ak7375_vcm_suspend() local
205 if (!ak7375_dev->active) in ak7375_vcm_suspend()
208 for (val = ak7375_dev->focus->val & ~(AK7375_CTRL_STEPS - 1); in ak7375_vcm_suspend()
210 ret = ak7375_i2c_write(ak7375_dev, AK7375_REG_POSITION, in ak7375_vcm_suspend()
218 ret = ak7375_i2c_write(ak7375_dev, AK7375_REG_CONT, in ak7375_vcm_suspend()
223 ak7375_dev->active = false; in ak7375_vcm_suspend()
238 struct ak7375_device *ak7375_dev = sd_to_ak7375_vcm(sd); in ak7375_vcm_resume() local
241 if (ak7375_dev->active) in ak7375_vcm_resume()
244 ret = ak7375_i2c_write(ak7375_dev, AK7375_REG_CONT, in ak7375_vcm_resume()
251 for (val = ak7375_dev->focus->val % AK7375_CTRL_STEPS; in ak7375_vcm_resume()
252 val <= ak7375_dev->focus->val; in ak7375_vcm_resume()
254 ret = ak7375_i2c_write(ak7375_dev, AK7375_REG_POSITION, in ak7375_vcm_resume()
262 ak7375_dev->active = true; in ak7375_vcm_resume()