Lines Matching +full:next +full:- +full:mode

1 // SPDX-License-Identifier: GPL-2.0-only
27 #include <linux/v4l2-mediabus.h>
29 #include <media/media-entity.h>
30 #include <media/v4l2-ctrls.h>
31 #include <media/v4l2-device.h>
32 #include <media/v4l2-subdev.h>
138 * Read a 8/16/32-bit i2c register. The value is returned in 'val'.
139 * Returns zero if successful, or non-zero otherwise.
148 if (!client->adapter) in et8ek8_i2c_read_reg()
149 return -ENODEV; in et8ek8_i2c_read_reg()
151 return -EINVAL; in et8ek8_i2c_read_reg()
153 msg.addr = client->addr; in et8ek8_i2c_read_reg()
161 r = i2c_transfer(client->adapter, &msg, 1); in et8ek8_i2c_read_reg()
167 r = i2c_transfer(client->adapter, &msg, 1); in et8ek8_i2c_read_reg()
181 dev_err(&client->dev, "read from offset 0x%x error %d\n", reg, r); in et8ek8_i2c_read_reg()
190 msg->addr = client->addr; in et8ek8_i2c_create_msg()
191 msg->flags = 0; /* Write */ in et8ek8_i2c_create_msg()
192 msg->len = 2 + len; in et8ek8_i2c_create_msg()
193 msg->buf = buf; in et8ek8_i2c_create_msg()
231 data_length = wnext->type; in et8ek8_i2c_buffered_write_regs()
232 reg = wnext->reg; in et8ek8_i2c_buffered_write_regs()
233 val = wnext->val; in et8ek8_i2c_buffered_write_regs()
245 rval = i2c_transfer(client->adapter, msg, wcnt); in et8ek8_i2c_buffered_write_regs()
249 cnt -= wcnt; in et8ek8_i2c_buffered_write_regs()
253 rval = i2c_transfer(client->adapter, msg, wcnt); in et8ek8_i2c_buffered_write_regs()
262 * Returns zero if successful, or non-zero otherwise.
268 const struct et8ek8_reg *next; in et8ek8_i2c_write_regs() local
270 if (!client->adapter) in et8ek8_i2c_write_regs()
271 return -ENODEV; in et8ek8_i2c_write_regs()
274 return -EINVAL; in et8ek8_i2c_write_regs()
277 next = regs; in et8ek8_i2c_write_regs()
284 while (next->type != ET8EK8_REG_TERM && in et8ek8_i2c_write_regs()
285 next->type != ET8EK8_REG_DELAY) { in et8ek8_i2c_write_regs()
290 if (WARN(next->type != ET8EK8_REG_8BIT && in et8ek8_i2c_write_regs()
291 next->type != ET8EK8_REG_16BIT, in et8ek8_i2c_write_regs()
292 "Invalid type = %d", next->type)) { in et8ek8_i2c_write_regs()
293 return -EINVAL; in et8ek8_i2c_write_regs()
300 next++; in et8ek8_i2c_write_regs()
308 dev_err(&client->dev, "i2c transfer error!\n"); in et8ek8_i2c_write_regs()
316 if (next->type == ET8EK8_REG_DELAY) { in et8ek8_i2c_write_regs()
317 msleep(next->val); in et8ek8_i2c_write_regs()
322 next++; in et8ek8_i2c_write_regs()
323 regs = next; in et8ek8_i2c_write_regs()
326 } while (next->type != ET8EK8_REG_TERM); in et8ek8_i2c_write_regs()
332 * Write to a 8/16-bit register.
333 * Returns zero if successful, or non-zero otherwise.
342 if (!client->adapter) in et8ek8_i2c_write_reg()
343 return -ENODEV; in et8ek8_i2c_write_reg()
345 return -EINVAL; in et8ek8_i2c_write_reg()
349 r = i2c_transfer(client->adapter, &msg, 1); in et8ek8_i2c_write_reg()
351 dev_err(&client->dev, in et8ek8_i2c_write_reg()
363 struct et8ek8_reglist **next = &meta->reglist[0].ptr; in et8ek8_reglist_find_type() local
365 while (*next) { in et8ek8_reglist_find_type()
366 if ((*next)->type == type) in et8ek8_reglist_find_type()
367 return *next; in et8ek8_reglist_find_type()
369 next++; in et8ek8_reglist_find_type()
383 return -EINVAL; in et8ek8_i2c_reglist_find_write()
385 return et8ek8_i2c_write_regs(client, reglist->regs); in et8ek8_i2c_reglist_find_write()
391 return &meta->reglist[0].ptr; in et8ek8_reglist_first()
397 fmt->width = reglist->mode.window_width; in et8ek8_reglist_to_mbus()
398 fmt->height = reglist->mode.window_height; in et8ek8_reglist_to_mbus()
399 fmt->code = reglist->mode.bus_format; in et8ek8_reglist_to_mbus()
410 unsigned int max_dist_match = (unsigned int)-1; in et8ek8_reglist_find_mode_fmt()
411 unsigned int max_dist_other = (unsigned int)-1; in et8ek8_reglist_find_mode_fmt()
414 * Find the mode with the closest image size. The distance between in et8ek8_reglist_find_mode_fmt()
415 * image sizes is the size in pixels of the non-overlapping regions in et8ek8_reglist_find_mode_fmt()
416 * between the requested size and the frame-specified size. in et8ek8_reglist_find_mode_fmt()
418 * Store both the closest mode that matches the requested format, and in et8ek8_reglist_find_mode_fmt()
419 * the closest mode for all other formats. The best match is returned in et8ek8_reglist_find_mode_fmt()
420 * if found, otherwise the best mode with a non-matching format is in et8ek8_reglist_find_mode_fmt()
426 if ((*list)->type != ET8EK8_REGLIST_MODE) in et8ek8_reglist_find_mode_fmt()
431 dist = min(fmt->width, format.width) in et8ek8_reglist_find_mode_fmt()
432 * min(fmt->height, format.height); in et8ek8_reglist_find_mode_fmt()
434 + fmt->width * fmt->height - 2 * dist; in et8ek8_reglist_find_mode_fmt()
437 if (fmt->code == format.code) { in et8ek8_reglist_find_mode_fmt()
463 struct et8ek8_mode *current_mode = &current_reglist->mode; in et8ek8_reglist_find_mode_ival()
466 struct et8ek8_mode *mode = &(*list)->mode; in et8ek8_reglist_find_mode_ival() local
468 if ((*list)->type != ET8EK8_REGLIST_MODE) in et8ek8_reglist_find_mode_ival()
471 if (mode->window_width != current_mode->window_width || in et8ek8_reglist_find_mode_ival()
472 mode->window_height != current_mode->window_height) in et8ek8_reglist_find_mode_ival()
475 if (TIMEPERFRAME_AVG_FPS(mode->timeperframe) == fps) in et8ek8_reglist_find_mode_ival()
488 if ((*list1)->type == ET8EK8_REGLIST_MODE && in et8ek8_reglist_cmp()
489 (*list2)->type != ET8EK8_REGLIST_MODE) in et8ek8_reglist_cmp()
490 return -1; in et8ek8_reglist_cmp()
491 if ((*list1)->type != ET8EK8_REGLIST_MODE && in et8ek8_reglist_cmp()
492 (*list2)->type == ET8EK8_REGLIST_MODE) in et8ek8_reglist_cmp()
496 if ((*list1)->mode.window_width > (*list2)->mode.window_width) in et8ek8_reglist_cmp()
497 return -1; in et8ek8_reglist_cmp()
498 if ((*list1)->mode.window_width < (*list2)->mode.window_width) in et8ek8_reglist_cmp()
501 if ((*list1)->mode.window_height > (*list2)->mode.window_height) in et8ek8_reglist_cmp()
502 return -1; in et8ek8_reglist_cmp()
503 if ((*list1)->mode.window_height < (*list2)->mode.window_height) in et8ek8_reglist_cmp()
514 dev_info(&client->dev, "meta_reglist version %s\n", meta->version); in et8ek8_reglist_import()
516 while (meta->reglist[nlists].ptr) in et8ek8_reglist_import()
520 return -EINVAL; in et8ek8_reglist_import()
522 sort(&meta->reglist[0].ptr, nlists, sizeof(meta->reglist[0].ptr), in et8ek8_reglist_import()
528 while (i--) { in et8ek8_reglist_import()
531 list = meta->reglist[nlists].ptr; in et8ek8_reglist_import()
533 dev_dbg(&client->dev, in et8ek8_reglist_import()
536 list->type, in et8ek8_reglist_import()
537 list->mode.window_width, list->mode.window_height, in et8ek8_reglist_import()
538 list->mode.bus_format, in et8ek8_reglist_import()
539 list->mode.timeperframe.numerator, in et8ek8_reglist_import()
540 list->mode.timeperframe.denominator, in et8ek8_reglist_import()
541 (void *)meta->reglist[nlists].ptr); in et8ek8_reglist_import()
556 struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev); in et8ek8_set_gain()
582 static int et8ek8_set_test_pattern(struct et8ek8_sensor *sensor, s32 mode) in et8ek8_set_test_pattern() argument
584 struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev); in et8ek8_set_test_pattern()
587 /* Values for normal mode */ in et8ek8_set_test_pattern()
594 if (mode) { in et8ek8_set_test_pattern()
595 /* Test pattern mode */ in et8ek8_set_test_pattern()
596 if (mode < 5) { in et8ek8_set_test_pattern()
599 tp_mode = mode + 3; in et8ek8_set_test_pattern()
603 tp_mode = mode - 4 + 3; in et8ek8_set_test_pattern()
632 /* -----------------------------------------------------------------------------
639 container_of(ctrl->handler, struct et8ek8_sensor, ctrl_handler); in et8ek8_set_ctrl()
641 switch (ctrl->id) { in et8ek8_set_ctrl()
643 return et8ek8_set_gain(sensor, ctrl->val); in et8ek8_set_ctrl()
648 v4l2_get_subdevdata(&sensor->subdev); in et8ek8_set_ctrl()
651 ctrl->val); in et8ek8_set_ctrl()
655 return et8ek8_set_test_pattern(sensor, ctrl->val); in et8ek8_set_ctrl()
661 return -EINVAL; in et8ek8_set_ctrl()
685 v4l2_ctrl_handler_init(&sensor->ctrl_handler, 4); in et8ek8_init_controls()
688 v4l2_ctrl_new_std(&sensor->ctrl_handler, &et8ek8_ctrl_ops, in et8ek8_init_controls()
689 V4L2_CID_GAIN, 0, ARRAY_SIZE(et8ek8_gain_table) - 1, in et8ek8_init_controls()
692 max_rows = sensor->current_reglist->mode.max_exp; in et8ek8_init_controls()
696 sensor->exposure = in et8ek8_init_controls()
697 v4l2_ctrl_new_std(&sensor->ctrl_handler, in et8ek8_init_controls()
703 sensor->pixel_rate = in et8ek8_init_controls()
704 v4l2_ctrl_new_std(&sensor->ctrl_handler, &et8ek8_ctrl_ops, in et8ek8_init_controls()
708 v4l2_ctrl_new_std_menu_items(&sensor->ctrl_handler, in et8ek8_init_controls()
710 ARRAY_SIZE(et8ek8_test_pattern_menu) - 1, in et8ek8_init_controls()
713 if (sensor->ctrl_handler.error) in et8ek8_init_controls()
714 return sensor->ctrl_handler.error; in et8ek8_init_controls()
716 sensor->subdev.ctrl_handler = &sensor->ctrl_handler; in et8ek8_init_controls()
724 struct et8ek8_mode *mode = &sensor->current_reglist->mode; in et8ek8_update_controls() local
729 ctrl = sensor->exposure; in et8ek8_update_controls()
732 max = mode->max_exp; in et8ek8_update_controls()
739 pixel_rate = ((mode->pixel_clock + (1 << S) - 1) >> S) + mode->width; in et8ek8_update_controls()
740 pixel_rate = mode->window_width * (pixel_rate - 1) / mode->width; in et8ek8_update_controls()
743 __v4l2_ctrl_s_ctrl_int64(sensor->pixel_rate, pixel_rate << S); in et8ek8_update_controls()
748 struct v4l2_subdev *subdev = &sensor->subdev; in et8ek8_configure()
752 rval = et8ek8_i2c_write_regs(client, sensor->current_reglist->regs); in et8ek8_configure()
760 rval = v4l2_ctrl_handler_setup(&sensor->ctrl_handler); in et8ek8_configure()
767 dev_err(&client->dev, "sensor configuration failed\n"); in et8ek8_configure()
774 struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev); in et8ek8_stream_on()
781 struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev); in et8ek8_stream_off()
801 /* --------------------------------------------------------------------------
807 gpiod_set_value(sensor->reset, 0); in et8ek8_power_off()
810 clk_disable_unprepare(sensor->ext_clk); in et8ek8_power_off()
812 return regulator_disable(sensor->vana); in et8ek8_power_off()
817 struct v4l2_subdev *subdev = &sensor->subdev; in et8ek8_power_on()
822 rval = regulator_enable(sensor->vana); in et8ek8_power_on()
824 dev_err(&client->dev, "failed to enable vana regulator\n"); in et8ek8_power_on()
828 if (sensor->current_reglist) in et8ek8_power_on()
829 xclk_freq = sensor->current_reglist->mode.ext_clock; in et8ek8_power_on()
831 xclk_freq = sensor->xclk_freq; in et8ek8_power_on()
833 rval = clk_set_rate(sensor->ext_clk, xclk_freq); in et8ek8_power_on()
835 dev_err(&client->dev, "unable to set extclk clock freq to %u\n", in et8ek8_power_on()
839 rval = clk_prepare_enable(sensor->ext_clk); in et8ek8_power_on()
841 dev_err(&client->dev, "failed to enable extclk\n"); in et8ek8_power_on()
850 gpiod_set_value(sensor->reset, 1); in et8ek8_power_on()
880 /* --------------------------------------------------------------------------
893 if (code->index >= MAX_FMTS) in et8ek8_enum_mbus_code()
894 return -EINVAL; in et8ek8_enum_mbus_code()
897 struct et8ek8_mode *mode = &(*list)->mode; in et8ek8_enum_mbus_code() local
900 if ((*list)->type != ET8EK8_REGLIST_MODE) in et8ek8_enum_mbus_code()
904 if (pixelformat[i] == mode->bus_format) in et8ek8_enum_mbus_code()
910 if (code->index == npixelformat) { in et8ek8_enum_mbus_code()
911 code->code = mode->bus_format; in et8ek8_enum_mbus_code()
915 pixelformat[npixelformat] = mode->bus_format; in et8ek8_enum_mbus_code()
919 return -EINVAL; in et8ek8_enum_mbus_code()
931 int index = fse->index; in et8ek8_enum_frame_size()
934 if ((*list)->type != ET8EK8_REGLIST_MODE) in et8ek8_enum_frame_size()
938 if (fse->code != format.code) in et8ek8_enum_frame_size()
948 if (index-- == 0) { in et8ek8_enum_frame_size()
949 fse->min_width = format.width; in et8ek8_enum_frame_size()
950 fse->min_height = format.height; in et8ek8_enum_frame_size()
951 fse->max_width = format.width; in et8ek8_enum_frame_size()
952 fse->max_height = format.height; in et8ek8_enum_frame_size()
957 return -EINVAL; in et8ek8_enum_frame_size()
967 int index = fie->index; in et8ek8_enum_frame_ival()
970 struct et8ek8_mode *mode = &(*list)->mode; in et8ek8_enum_frame_ival() local
972 if ((*list)->type != ET8EK8_REGLIST_MODE) in et8ek8_enum_frame_ival()
976 if (fie->code != format.code) in et8ek8_enum_frame_ival()
979 if (fie->width != format.width || fie->height != format.height) in et8ek8_enum_frame_ival()
982 if (index-- == 0) { in et8ek8_enum_frame_ival()
983 fie->interval = mode->timeperframe; in et8ek8_enum_frame_ival()
988 return -EINVAL; in et8ek8_enum_frame_ival()
1000 return &sensor->format; in __et8ek8_get_pad_format()
1013 format = __et8ek8_get_pad_format(sensor, sd_state, fmt->pad, in et8ek8_get_pad_format()
1014 fmt->which); in et8ek8_get_pad_format()
1016 return -EINVAL; in et8ek8_get_pad_format()
1018 fmt->format = *format; in et8ek8_get_pad_format()
1031 format = __et8ek8_get_pad_format(sensor, sd_state, fmt->pad, in et8ek8_set_pad_format()
1032 fmt->which); in et8ek8_set_pad_format()
1034 return -EINVAL; in et8ek8_set_pad_format()
1036 reglist = et8ek8_reglist_find_mode_fmt(&meta_reglist, &fmt->format); in et8ek8_set_pad_format()
1037 et8ek8_reglist_to_mbus(reglist, &fmt->format); in et8ek8_set_pad_format()
1038 *format = fmt->format; in et8ek8_set_pad_format()
1040 if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { in et8ek8_set_pad_format()
1041 sensor->current_reglist = reglist; in et8ek8_set_pad_format()
1058 if (fi->which != V4L2_SUBDEV_FORMAT_ACTIVE) in et8ek8_get_frame_interval()
1059 return -EINVAL; in et8ek8_get_frame_interval()
1062 fi->interval = sensor->current_reglist->mode.timeperframe; in et8ek8_get_frame_interval()
1078 if (fi->which != V4L2_SUBDEV_FORMAT_ACTIVE) in et8ek8_set_frame_interval()
1079 return -EINVAL; in et8ek8_set_frame_interval()
1082 sensor->current_reglist, in et8ek8_set_frame_interval()
1083 &fi->interval); in et8ek8_set_frame_interval()
1086 return -EINVAL; in et8ek8_set_frame_interval()
1088 if (sensor->current_reglist->mode.ext_clock != reglist->mode.ext_clock) in et8ek8_set_frame_interval()
1089 return -EINVAL; in et8ek8_set_frame_interval()
1091 sensor->current_reglist = reglist; in et8ek8_set_frame_interval()
1103 u8 *ptr = sensor->priv_mem; in et8ek8_g_priv_mem()
1106 /* Read the EEPROM window-by-window, each window 8 bytes */ in et8ek8_g_priv_mem()
1133 return -EIO; in et8ek8_g_priv_mem()
1137 bytes = length + ofs > 8 ? 8-ofs : length; in et8ek8_g_priv_mem()
1138 msg.addr = client->addr; in et8ek8_g_priv_mem()
1146 rval = i2c_transfer(client->adapter, &msg, 1); in et8ek8_g_priv_mem()
1151 msg.addr = client->addr; in et8ek8_g_priv_mem()
1157 rval = i2c_transfer(client->adapter, &msg, 1); in et8ek8_g_priv_mem()
1164 length -= bytes; in et8ek8_g_priv_mem()
1180 dev_err(&client->dev, "could not power on\n"); in et8ek8_dev_init()
1190 dev_err(&client->dev, "no et8ek8 sensor detected\n"); in et8ek8_dev_init()
1194 sensor->version = (rev_h << 8) + rev_l; in et8ek8_dev_init()
1195 if (sensor->version != ET8EK8_REV_1 && sensor->version != ET8EK8_REV_2) in et8ek8_dev_init()
1196 dev_info(&client->dev, in et8ek8_dev_init()
1198 sensor->version); in et8ek8_dev_init()
1202 dev_err(&client->dev, in et8ek8_dev_init()
1208 sensor->current_reglist = et8ek8_reglist_find_type(&meta_reglist, in et8ek8_dev_init()
1210 if (!sensor->current_reglist) { in et8ek8_dev_init()
1211 dev_err(&client->dev, in et8ek8_dev_init()
1212 "invalid register list %s, no mode found\n", in et8ek8_dev_init()
1214 rval = -ENODEV; in et8ek8_dev_init()
1218 et8ek8_reglist_to_mbus(sensor->current_reglist, &sensor->format); in et8ek8_dev_init()
1223 dev_err(&client->dev, in et8ek8_dev_init()
1224 "invalid register list %s, no POWERON mode found\n", in et8ek8_dev_init()
1233 dev_warn(&client->dev, in et8ek8_dev_init()
1251 /* --------------------------------------------------------------------------
1264 memcpy(buf, sensor->priv_mem, ET8EK8_PRIV_MEM_SIZE); in priv_mem_show()
1270 /* --------------------------------------------------------------------------
1281 dev_dbg(&client->dev, "registered!"); in et8ek8_registered()
1283 rval = device_create_file(&client->dev, &dev_attr_priv_mem); in et8ek8_registered()
1285 dev_err(&client->dev, "could not register sysfs entry\n"); in et8ek8_registered()
1295 dev_err(&client->dev, "controls initialization failed\n"); in et8ek8_registered()
1304 device_remove_file(&client->dev, &dev_attr_priv_mem); in et8ek8_registered()
1319 mutex_lock(&sensor->power_lock); in et8ek8_set_power()
1324 if (sensor->power_count == !on) { in et8ek8_set_power()
1331 sensor->power_count += on ? 1 : -1; in et8ek8_set_power()
1332 WARN_ON(sensor->power_count < 0); in et8ek8_set_power()
1335 mutex_unlock(&sensor->power_lock); in et8ek8_set_power()
1347 format = __et8ek8_get_pad_format(sensor, fh->state, 0, in et8ek8_open()
1389 /* --------------------------------------------------------------------------
1397 if (!sensor->power_count) in et8ek8_suspend()
1408 if (!sensor->power_count) in et8ek8_resume()
1417 struct device *dev = &client->dev; in et8ek8_probe()
1420 sensor = devm_kzalloc(&client->dev, sizeof(*sensor), GFP_KERNEL); in et8ek8_probe()
1422 return -ENOMEM; in et8ek8_probe()
1424 sensor->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); in et8ek8_probe()
1425 if (IS_ERR(sensor->reset)) { in et8ek8_probe()
1426 dev_dbg(&client->dev, "could not request reset gpio\n"); in et8ek8_probe()
1427 return PTR_ERR(sensor->reset); in et8ek8_probe()
1430 sensor->vana = devm_regulator_get(dev, "vana"); in et8ek8_probe()
1431 if (IS_ERR(sensor->vana)) { in et8ek8_probe()
1432 dev_err(&client->dev, "could not get regulator for vana\n"); in et8ek8_probe()
1433 return PTR_ERR(sensor->vana); in et8ek8_probe()
1436 sensor->ext_clk = devm_clk_get(dev, NULL); in et8ek8_probe()
1437 if (IS_ERR(sensor->ext_clk)) { in et8ek8_probe()
1438 dev_err(&client->dev, "could not get clock\n"); in et8ek8_probe()
1439 return PTR_ERR(sensor->ext_clk); in et8ek8_probe()
1442 ret = of_property_read_u32(dev->of_node, "clock-frequency", in et8ek8_probe()
1443 &sensor->xclk_freq); in et8ek8_probe()
1445 dev_warn(dev, "can't get clock-frequency\n"); in et8ek8_probe()
1449 mutex_init(&sensor->power_lock); in et8ek8_probe()
1451 v4l2_i2c_subdev_init(&sensor->subdev, client, &et8ek8_ops); in et8ek8_probe()
1452 sensor->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; in et8ek8_probe()
1453 sensor->subdev.internal_ops = &et8ek8_internal_ops; in et8ek8_probe()
1455 sensor->subdev.entity.function = MEDIA_ENT_F_CAM_SENSOR; in et8ek8_probe()
1456 sensor->pad.flags = MEDIA_PAD_FL_SOURCE; in et8ek8_probe()
1457 ret = media_entity_pads_init(&sensor->subdev.entity, 1, &sensor->pad); in et8ek8_probe()
1459 dev_err(&client->dev, "media entity init failed!\n"); in et8ek8_probe()
1463 ret = v4l2_async_register_subdev_sensor(&sensor->subdev); in et8ek8_probe()
1472 media_entity_cleanup(&sensor->subdev.entity); in et8ek8_probe()
1474 mutex_destroy(&sensor->power_lock); in et8ek8_probe()
1483 if (sensor->power_count) { in et8ek8_remove()
1486 sensor->power_count = 0; in et8ek8_remove()
1489 v4l2_device_unregister_subdev(&sensor->subdev); in et8ek8_remove()
1490 device_remove_file(&client->dev, &dev_attr_priv_mem); in et8ek8_remove()
1491 v4l2_ctrl_handler_free(&sensor->ctrl_handler); in et8ek8_remove()
1492 v4l2_async_unregister_subdev(&sensor->subdev); in et8ek8_remove()
1493 media_entity_cleanup(&sensor->subdev.entity); in et8ek8_remove()
1494 mutex_destroy(&sensor->power_lock); in et8ek8_remove()