Lines Matching +full:colour +full:- +full:sensor

1 // SPDX-License-Identifier: GPL-2.0
5 * Adapted from the atomisp-ov5693 driver, with contributions from:
8 * Jean-Michel Hautbois
26 #include <media/v4l2-cci.h>
27 #include <media/v4l2-ctrls.h>
28 #include <media/v4l2-device.h>
29 #include <media/v4l2-fwnode.h>
342 "Colour Bars",
343 "Colour Bars with Rolling Bar"
363 ret = cci_update_bits(ov5693->regmap, OV5693_FORMAT1_REG, bits, in ov5693_flip_vert_configure()
378 ret = cci_update_bits(ov5693->regmap, OV5693_FORMAT2_REG, bits, in ov5693_flip_horz_configure()
391 ret = cci_read(ov5693->regmap, OV5693_EXPOSURE_CTRL_REG, &exposure, in ov5693_get_exposure()
409 cci_write(ov5693->regmap, OV5693_EXPOSURE_CTRL_REG, exposure, &ret); in ov5693_exposure_configure()
419 ret = cci_read(ov5693->regmap, OV5693_GAIN_CTRL_REG, &value, NULL); in ov5693_get_gain()
436 cci_write(ov5693->regmap, OV5693_MWB_RED_GAIN_REG, gain, &ret); in ov5693_digital_gain_configure()
437 cci_write(ov5693->regmap, OV5693_MWB_GREEN_GAIN_REG, gain, &ret); in ov5693_digital_gain_configure()
438 cci_write(ov5693->regmap, OV5693_MWB_BLUE_GAIN_REG, gain, &ret); in ov5693_digital_gain_configure()
449 cci_write(ov5693->regmap, OV5693_GAIN_CTRL_REG, gain, &ret); in ov5693_analog_gain_configure()
456 u16 vts = ov5693->mode.format.height + vblank; in ov5693_vts_configure()
459 cci_write(ov5693->regmap, OV5693_TIMING_VTS_REG, vts, &ret); in ov5693_vts_configure()
468 cci_write(ov5693->regmap, OV5693_TEST_PATTERN_REG, in ov5693_test_pattern_configure()
477 container_of(ctrl->handler, struct ov5693_device, ctrls.handler); in ov5693_s_ctrl()
481 if (ctrl->id == V4L2_CID_VBLANK) { in ov5693_s_ctrl()
484 exposure_max = ov5693->mode.format.height + ctrl->val - in ov5693_s_ctrl()
486 __v4l2_ctrl_modify_range(ov5693->ctrls.exposure, in ov5693_s_ctrl()
487 ov5693->ctrls.exposure->minimum, in ov5693_s_ctrl()
489 ov5693->ctrls.exposure->step, in ov5693_s_ctrl()
490 min(ov5693->ctrls.exposure->val, in ov5693_s_ctrl()
495 if (!pm_runtime_get_if_in_use(ov5693->dev)) in ov5693_s_ctrl()
498 switch (ctrl->id) { in ov5693_s_ctrl()
500 ret = ov5693_exposure_configure(ov5693, ctrl->val); in ov5693_s_ctrl()
503 ret = ov5693_analog_gain_configure(ov5693, ctrl->val); in ov5693_s_ctrl()
506 ret = ov5693_digital_gain_configure(ov5693, ctrl->val); in ov5693_s_ctrl()
509 ret = ov5693_flip_horz_configure(ov5693, !!ctrl->val); in ov5693_s_ctrl()
512 ret = ov5693_flip_vert_configure(ov5693, !!ctrl->val); in ov5693_s_ctrl()
515 ret = ov5693_vts_configure(ov5693, ctrl->val); in ov5693_s_ctrl()
518 ret = ov5693_test_pattern_configure(ov5693, ctrl->val); in ov5693_s_ctrl()
521 ret = -EINVAL; in ov5693_s_ctrl()
524 pm_runtime_put(ov5693->dev); in ov5693_s_ctrl()
531 struct ov5693_device *ov5693 = container_of(ctrl->handler, in ov5693_g_volatile_ctrl()
535 switch (ctrl->id) { in ov5693_g_volatile_ctrl()
537 return ov5693_get_exposure(ov5693, &ctrl->val); in ov5693_g_volatile_ctrl()
539 return ov5693_get_gain(ov5693, &ctrl->val); in ov5693_g_volatile_ctrl()
541 return -EINVAL; in ov5693_g_volatile_ctrl()
554 const struct ov5693_mode *mode = &ov5693->mode; in ov5693_mode_configure()
558 cci_write(ov5693->regmap, OV5693_CROP_START_X_REG, mode->crop.left, in ov5693_mode_configure()
562 cci_write(ov5693->regmap, OV5693_OFFSET_START_X_REG, 0, &ret); in ov5693_mode_configure()
565 cci_write(ov5693->regmap, OV5693_OUTPUT_SIZE_X_REG, mode->format.width, in ov5693_mode_configure()
569 cci_write(ov5693->regmap, OV5693_CROP_END_X_REG, in ov5693_mode_configure()
570 mode->crop.left + mode->crop.width, &ret); in ov5693_mode_configure()
573 cci_write(ov5693->regmap, OV5693_TIMING_HTS_REG, OV5693_FIXED_PPL, in ov5693_mode_configure()
577 cci_write(ov5693->regmap, OV5693_CROP_START_Y_REG, mode->crop.top, in ov5693_mode_configure()
581 cci_write(ov5693->regmap, OV5693_OFFSET_START_Y_REG, 0, &ret); in ov5693_mode_configure()
584 cci_write(ov5693->regmap, OV5693_OUTPUT_SIZE_Y_REG, mode->format.height, in ov5693_mode_configure()
588 cci_write(ov5693->regmap, OV5693_CROP_END_Y_REG, in ov5693_mode_configure()
589 mode->crop.top + mode->crop.height, &ret); in ov5693_mode_configure()
592 cci_write(ov5693->regmap, OV5693_SUB_INC_X_REG, in ov5693_mode_configure()
593 ((mode->inc_x_odd << 4) & 0xf0) | 0x01, &ret); in ov5693_mode_configure()
595 cci_write(ov5693->regmap, OV5693_SUB_INC_Y_REG, in ov5693_mode_configure()
596 ((mode->inc_y_odd << 4) & 0xf0) | 0x01, &ret); in ov5693_mode_configure()
599 cci_update_bits(ov5693->regmap, OV5693_FORMAT1_REG, in ov5693_mode_configure()
601 mode->binning_y ? OV5693_FORMAT1_VBIN_EN : 0, &ret); in ov5693_mode_configure()
603 cci_update_bits(ov5693->regmap, OV5693_FORMAT2_REG, in ov5693_mode_configure()
605 mode->binning_x ? OV5693_FORMAT2_HBIN_EN : 0, &ret); in ov5693_mode_configure()
614 cci_write(ov5693->regmap, OV5693_SW_STREAM_REG, in ov5693_enable_streaming()
625 cci_write(ov5693->regmap, OV5693_SW_RESET_REG, OV5693_SW_RESET, &ret); in ov5693_sw_reset()
636 return dev_err_probe(ov5693->dev, ret, in ov5693_sensor_init()
639 ret = cci_multi_reg_write(ov5693->regmap, ov5693_global_regs, in ov5693_sensor_init()
642 return dev_err_probe(ov5693->dev, ret, in ov5693_sensor_init()
647 return dev_err_probe(ov5693->dev, ret, in ov5693_sensor_init()
652 dev_err(ov5693->dev, "stop streaming error\n"); in ov5693_sensor_init()
659 gpiod_set_value_cansleep(ov5693->reset, 1); in ov5693_sensor_powerdown()
660 gpiod_set_value_cansleep(ov5693->powerdown, 1); in ov5693_sensor_powerdown()
662 regulator_bulk_disable(OV5693_NUM_SUPPLIES, ov5693->supplies); in ov5693_sensor_powerdown()
664 clk_disable_unprepare(ov5693->xvclk); in ov5693_sensor_powerdown()
671 gpiod_set_value_cansleep(ov5693->reset, 1); in ov5693_sensor_powerup()
672 gpiod_set_value_cansleep(ov5693->powerdown, 1); in ov5693_sensor_powerup()
674 ret = clk_prepare_enable(ov5693->xvclk); in ov5693_sensor_powerup()
676 dev_err(ov5693->dev, "Failed to enable clk\n"); in ov5693_sensor_powerup()
680 ret = regulator_bulk_enable(OV5693_NUM_SUPPLIES, ov5693->supplies); in ov5693_sensor_powerup()
682 dev_err(ov5693->dev, "Failed to enable regulators\n"); in ov5693_sensor_powerup()
686 gpiod_set_value_cansleep(ov5693->powerdown, 0); in ov5693_sensor_powerup()
687 gpiod_set_value_cansleep(ov5693->reset, 0); in ov5693_sensor_powerup()
714 mutex_lock(&ov5693->lock); in ov5693_sensor_resume()
722 dev_err(dev, "ov5693 sensor init failure\n"); in ov5693_sensor_resume()
731 mutex_unlock(&ov5693->lock); in ov5693_sensor_resume()
740 ret = cci_read(ov5693->regmap, OV5693_REG_CHIP_ID, &id, NULL); in ov5693_detect()
745 return dev_err_probe(ov5693->dev, -ENODEV, in ov5693_detect()
746 "sensor ID mismatch. Got 0x%04llx\n", id); in ov5693_detect()
777 return &ov5693->mode.format; in __ov5693_get_pad_format()
792 return &ov5693->mode.crop; in __ov5693_get_pad_crop()
804 format->format = ov5693->mode.format; in ov5693_get_fmt()
821 crop = __ov5693_get_pad_crop(ov5693, state, format->pad, format->which); in ov5693_set_fmt()
827 width = clamp_t(unsigned int, ALIGN(format->format.width, 2), in ov5693_set_fmt()
828 OV5693_MIN_CROP_WIDTH, crop->width); in ov5693_set_fmt()
829 height = clamp_t(unsigned int, ALIGN(format->format.height, 2), in ov5693_set_fmt()
830 OV5693_MIN_CROP_HEIGHT, crop->height); in ov5693_set_fmt()
837 DIV_ROUND_CLOSEST(crop->width, width), 1, 2); in ov5693_set_fmt()
839 DIV_ROUND_CLOSEST(crop->height, height), 1, 2); in ov5693_set_fmt()
841 fmt = __ov5693_get_pad_format(ov5693, state, format->pad, in ov5693_set_fmt()
842 format->which); in ov5693_set_fmt()
844 fmt->width = crop->width / hratio; in ov5693_set_fmt()
845 fmt->height = crop->height / vratio; in ov5693_set_fmt()
846 fmt->code = MEDIA_BUS_FMT_SBGGR10_1X10; in ov5693_set_fmt()
848 format->format = *fmt; in ov5693_set_fmt()
850 if (format->which == V4L2_SUBDEV_FORMAT_TRY) in ov5693_set_fmt()
853 mutex_lock(&ov5693->lock); in ov5693_set_fmt()
855 ov5693->mode.binning_x = hratio > 1; in ov5693_set_fmt()
856 ov5693->mode.inc_x_odd = hratio > 1 ? 3 : 1; in ov5693_set_fmt()
857 ov5693->mode.binning_y = vratio > 1; in ov5693_set_fmt()
858 ov5693->mode.inc_y_odd = vratio > 1 ? 3 : 1; in ov5693_set_fmt()
860 ov5693->mode.vts = __ov5693_calc_vts(fmt->height); in ov5693_set_fmt()
862 __v4l2_ctrl_modify_range(ov5693->ctrls.vblank, in ov5693_set_fmt()
864 OV5693_TIMING_MAX_VTS - fmt->height, in ov5693_set_fmt()
865 1, ov5693->mode.vts - fmt->height); in ov5693_set_fmt()
866 __v4l2_ctrl_s_ctrl(ov5693->ctrls.vblank, in ov5693_set_fmt()
867 ov5693->mode.vts - fmt->height); in ov5693_set_fmt()
869 hblank = OV5693_FIXED_PPL - fmt->width; in ov5693_set_fmt()
870 __v4l2_ctrl_modify_range(ov5693->ctrls.hblank, hblank, hblank, 1, in ov5693_set_fmt()
873 exposure_max = ov5693->mode.vts - OV5693_INTEGRATION_TIME_MARGIN; in ov5693_set_fmt()
874 __v4l2_ctrl_modify_range(ov5693->ctrls.exposure, in ov5693_set_fmt()
875 ov5693->ctrls.exposure->minimum, exposure_max, in ov5693_set_fmt()
876 ov5693->ctrls.exposure->step, in ov5693_set_fmt()
877 min(ov5693->ctrls.exposure->val, in ov5693_set_fmt()
880 mutex_unlock(&ov5693->lock); in ov5693_set_fmt()
890 switch (sel->target) { in ov5693_get_selection()
892 mutex_lock(&ov5693->lock); in ov5693_get_selection()
893 sel->r = *__ov5693_get_pad_crop(ov5693, state, sel->pad, in ov5693_get_selection()
894 sel->which); in ov5693_get_selection()
895 mutex_unlock(&ov5693->lock); in ov5693_get_selection()
898 sel->r.top = 0; in ov5693_get_selection()
899 sel->r.left = 0; in ov5693_get_selection()
900 sel->r.width = OV5693_NATIVE_WIDTH; in ov5693_get_selection()
901 sel->r.height = OV5693_NATIVE_HEIGHT; in ov5693_get_selection()
905 sel->r.top = OV5693_ACTIVE_START_TOP; in ov5693_get_selection()
906 sel->r.left = OV5693_ACTIVE_START_LEFT; in ov5693_get_selection()
907 sel->r.width = OV5693_ACTIVE_WIDTH; in ov5693_get_selection()
908 sel->r.height = OV5693_ACTIVE_HEIGHT; in ov5693_get_selection()
911 return -EINVAL; in ov5693_get_selection()
926 if (sel->target != V4L2_SEL_TGT_CROP) in ov5693_set_selection()
927 return -EINVAL; in ov5693_set_selection()
930 * Clamp the boundaries of the crop rectangle to the size of the sensor in ov5693_set_selection()
934 rect.left = clamp(ALIGN(sel->r.left, 2), OV5693_NATIVE_START_LEFT, in ov5693_set_selection()
936 rect.top = clamp(ALIGN(sel->r.top, 2), OV5693_NATIVE_START_TOP, in ov5693_set_selection()
938 rect.width = clamp_t(unsigned int, ALIGN(sel->r.width, 2), in ov5693_set_selection()
940 rect.height = clamp_t(unsigned int, ALIGN(sel->r.height, 2), in ov5693_set_selection()
945 OV5693_NATIVE_WIDTH - rect.left); in ov5693_set_selection()
947 OV5693_NATIVE_HEIGHT - rect.top); in ov5693_set_selection()
949 __crop = __ov5693_get_pad_crop(ov5693, state, sel->pad, sel->which); in ov5693_set_selection()
951 if (rect.width != __crop->width || rect.height != __crop->height) { in ov5693_set_selection()
956 format = __ov5693_get_pad_format(ov5693, state, sel->pad, in ov5693_set_selection()
957 sel->which); in ov5693_set_selection()
958 format->width = rect.width; in ov5693_set_selection()
959 format->height = rect.height; in ov5693_set_selection()
963 sel->r = rect; in ov5693_set_selection()
974 ret = pm_runtime_resume_and_get(ov5693->dev); in ov5693_s_stream()
978 mutex_lock(&ov5693->lock); in ov5693_s_stream()
979 ret = __v4l2_ctrl_handler_setup(&ov5693->ctrls.handler); in ov5693_s_stream()
981 mutex_unlock(&ov5693->lock); in ov5693_s_stream()
986 mutex_unlock(&ov5693->lock); in ov5693_s_stream()
988 mutex_lock(&ov5693->lock); in ov5693_s_stream()
990 mutex_unlock(&ov5693->lock); in ov5693_s_stream()
996 pm_runtime_put(ov5693->dev); in ov5693_s_stream()
1000 pm_runtime_put_noidle(ov5693->dev); in ov5693_s_stream()
1009 unsigned int framesize = OV5693_FIXED_PPL * (ov5693->mode.format.height + in ov5693_get_frame_interval()
1010 ov5693->ctrls.vblank->val); in ov5693_get_frame_interval()
1017 if (interval->which != V4L2_SUBDEV_FORMAT_ACTIVE) in ov5693_get_frame_interval()
1018 return -EINVAL; in ov5693_get_frame_interval()
1020 interval->interval.numerator = 1; in ov5693_get_frame_interval()
1021 interval->interval.denominator = fps; in ov5693_get_frame_interval()
1031 if (code->index > 0) in ov5693_enum_mbus_code()
1032 return -EINVAL; in ov5693_enum_mbus_code()
1034 code->code = MEDIA_BUS_FMT_SBGGR10_1X10; in ov5693_enum_mbus_code()
1045 if (fse->index > 1 || fse->code != MEDIA_BUS_FMT_SBGGR10_1X10) in ov5693_enum_frame_size()
1046 return -EINVAL; in ov5693_enum_frame_size()
1048 __crop = __ov5693_get_pad_crop(ov5693, state, fse->pad, fse->which); in ov5693_enum_frame_size()
1050 return -EINVAL; in ov5693_enum_frame_size()
1052 fse->min_width = __crop->width / (fse->index + 1); in ov5693_enum_frame_size()
1053 fse->min_height = __crop->height / (fse->index + 1); in ov5693_enum_frame_size()
1054 fse->max_width = fse->min_width; in ov5693_enum_frame_size()
1055 fse->max_height = fse->min_height; in ov5693_enum_frame_size()
1079 /* Sensor and Driver Configuration Functions */
1084 struct ov5693_v4l2_ctrls *ctrls = &ov5693->ctrls; in ov5693_init_controls()
1091 ret = v4l2_ctrl_handler_init(&ctrls->handler, 12); in ov5693_init_controls()
1096 ctrls->link_freq = v4l2_ctrl_new_int_menu(&ctrls->handler, in ov5693_init_controls()
1099 if (ctrls->link_freq) in ov5693_init_controls()
1100 ctrls->link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY; in ov5693_init_controls()
1103 ctrls->pixel_rate = v4l2_ctrl_new_std(&ctrls->handler, NULL, in ov5693_init_controls()
1109 exposure_max = ov5693->mode.vts - OV5693_INTEGRATION_TIME_MARGIN; in ov5693_init_controls()
1110 ctrls->exposure = v4l2_ctrl_new_std(&ctrls->handler, ops, in ov5693_init_controls()
1116 ctrls->analogue_gain = v4l2_ctrl_new_std(&ctrls->handler, in ov5693_init_controls()
1123 ctrls->digital_gain = v4l2_ctrl_new_std(&ctrls->handler, ops, in ov5693_init_controls()
1131 ctrls->hflip = v4l2_ctrl_new_std(&ctrls->handler, ops, in ov5693_init_controls()
1134 ctrls->vflip = v4l2_ctrl_new_std(&ctrls->handler, ops, in ov5693_init_controls()
1137 hblank = OV5693_FIXED_PPL - ov5693->mode.format.width; in ov5693_init_controls()
1138 ctrls->hblank = v4l2_ctrl_new_std(&ctrls->handler, ops, in ov5693_init_controls()
1142 if (ctrls->hblank) in ov5693_init_controls()
1143 ctrls->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY; in ov5693_init_controls()
1145 vblank_max = OV5693_TIMING_MAX_VTS - ov5693->mode.format.height; in ov5693_init_controls()
1146 vblank_def = ov5693->mode.vts - ov5693->mode.format.height; in ov5693_init_controls()
1147 ctrls->vblank = v4l2_ctrl_new_std(&ctrls->handler, ops, in ov5693_init_controls()
1152 ctrls->test_pattern = v4l2_ctrl_new_std_menu_items( in ov5693_init_controls()
1153 &ctrls->handler, ops, in ov5693_init_controls()
1155 ARRAY_SIZE(ov5693_test_pattern_menu) - 1, in ov5693_init_controls()
1158 if (ctrls->handler.error) { in ov5693_init_controls()
1159 dev_err(ov5693->dev, "Error initialising v4l2 ctrls\n"); in ov5693_init_controls()
1160 ret = ctrls->handler.error; in ov5693_init_controls()
1165 ret = v4l2_fwnode_device_parse(ov5693->dev, &props); in ov5693_init_controls()
1169 ret = v4l2_ctrl_new_fwnode_properties(&ctrls->handler, ops, in ov5693_init_controls()
1175 ctrls->handler.lock = &ov5693->lock; in ov5693_init_controls()
1176 ov5693->sd.ctrl_handler = &ctrls->handler; in ov5693_init_controls()
1181 v4l2_ctrl_handler_free(&ctrls->handler); in ov5693_init_controls()
1187 ov5693->reset = devm_gpiod_get_optional(ov5693->dev, "reset", in ov5693_configure_gpios()
1189 if (IS_ERR(ov5693->reset)) { in ov5693_configure_gpios()
1190 dev_err(ov5693->dev, "Error fetching reset GPIO\n"); in ov5693_configure_gpios()
1191 return PTR_ERR(ov5693->reset); in ov5693_configure_gpios()
1194 ov5693->powerdown = devm_gpiod_get_optional(ov5693->dev, "powerdown", in ov5693_configure_gpios()
1196 if (IS_ERR(ov5693->powerdown)) { in ov5693_configure_gpios()
1197 dev_err(ov5693->dev, "Error fetching powerdown GPIO\n"); in ov5693_configure_gpios()
1198 return PTR_ERR(ov5693->powerdown); in ov5693_configure_gpios()
1209 ov5693->supplies[i].supply = ov5693_supply_names[i]; in ov5693_get_regulators()
1211 return devm_regulator_bulk_get(ov5693->dev, OV5693_NUM_SUPPLIES, in ov5693_get_regulators()
1212 ov5693->supplies); in ov5693_get_regulators()
1217 struct fwnode_handle *fwnode = dev_fwnode(ov5693->dev); in ov5693_check_hwcfg()
1227 return -EPROBE_DEFER; /* Could be provided by cio2-bridge */ in ov5693_check_hwcfg()
1235 dev_err(ov5693->dev, "only a 2-lane CSI2 config is supported"); in ov5693_check_hwcfg()
1236 ret = -EINVAL; in ov5693_check_hwcfg()
1241 dev_err(ov5693->dev, "no link frequencies defined\n"); in ov5693_check_hwcfg()
1242 ret = -EINVAL; in ov5693_check_hwcfg()
1251 dev_err(ov5693->dev, "supported link freq %ull not found\n", in ov5693_check_hwcfg()
1253 ret = -EINVAL; in ov5693_check_hwcfg()
1269 ov5693 = devm_kzalloc(&client->dev, sizeof(*ov5693), GFP_KERNEL); in ov5693_probe()
1271 return -ENOMEM; in ov5693_probe()
1273 ov5693->dev = &client->dev; in ov5693_probe()
1275 ov5693->regmap = devm_cci_regmap_init_i2c(client, 16); in ov5693_probe()
1276 if (IS_ERR(ov5693->regmap)) in ov5693_probe()
1277 return PTR_ERR(ov5693->regmap); in ov5693_probe()
1283 mutex_init(&ov5693->lock); in ov5693_probe()
1285 v4l2_i2c_subdev_init(&ov5693->sd, client, &ov5693_ops); in ov5693_probe()
1287 ov5693->xvclk = devm_clk_get_optional(&client->dev, "xvclk"); in ov5693_probe()
1288 if (IS_ERR(ov5693->xvclk)) in ov5693_probe()
1289 return dev_err_probe(&client->dev, PTR_ERR(ov5693->xvclk), in ov5693_probe()
1291 PTR_ERR(ov5693->xvclk)); in ov5693_probe()
1293 if (ov5693->xvclk) { in ov5693_probe()
1294 xvclk_rate = clk_get_rate(ov5693->xvclk); in ov5693_probe()
1296 ret = fwnode_property_read_u32(dev_fwnode(&client->dev), in ov5693_probe()
1297 "clock-frequency", in ov5693_probe()
1301 dev_err(&client->dev, "can't get clock frequency"); in ov5693_probe()
1307 dev_warn(&client->dev, "Found clk freq %u, expected %u\n", in ov5693_probe()
1316 return dev_err_probe(&client->dev, ret, in ov5693_probe()
1319 ov5693->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; in ov5693_probe()
1320 ov5693->pad.flags = MEDIA_PAD_FL_SOURCE; in ov5693_probe()
1321 ov5693->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; in ov5693_probe()
1323 ov5693->mode.crop = ov5693_default_crop; in ov5693_probe()
1324 ov5693->mode.format = ov5693_default_fmt; in ov5693_probe()
1325 ov5693->mode.vts = __ov5693_calc_vts(ov5693->mode.format.height); in ov5693_probe()
1331 ret = media_entity_pads_init(&ov5693->sd.entity, 1, &ov5693->pad); in ov5693_probe()
1350 pm_runtime_set_active(&client->dev); in ov5693_probe()
1351 pm_runtime_get_noresume(&client->dev); in ov5693_probe()
1352 pm_runtime_enable(&client->dev); in ov5693_probe()
1354 ret = v4l2_async_register_subdev_sensor(&ov5693->sd); in ov5693_probe()
1356 dev_err(&client->dev, "failed to register V4L2 subdev: %d", in ov5693_probe()
1361 pm_runtime_set_autosuspend_delay(&client->dev, 1000); in ov5693_probe()
1362 pm_runtime_use_autosuspend(&client->dev); in ov5693_probe()
1363 pm_runtime_put_autosuspend(&client->dev); in ov5693_probe()
1368 pm_runtime_disable(&client->dev); in ov5693_probe()
1369 pm_runtime_put_noidle(&client->dev); in ov5693_probe()
1373 media_entity_cleanup(&ov5693->sd.entity); in ov5693_probe()
1375 v4l2_ctrl_handler_free(&ov5693->ctrls.handler); in ov5693_probe()
1386 media_entity_cleanup(&ov5693->sd.entity); in ov5693_remove()
1387 v4l2_ctrl_handler_free(&ov5693->ctrls.handler); in ov5693_remove()
1388 mutex_destroy(&ov5693->lock); in ov5693_remove()
1394 pm_runtime_disable(&client->dev); in ov5693_remove()
1395 if (!pm_runtime_status_suspended(&client->dev)) in ov5693_remove()
1397 pm_runtime_set_suspended(&client->dev); in ov5693_remove()
1428 MODULE_DESCRIPTION("A low-level driver for OmniVision 5693 sensors");