Lines Matching +full:ctrl +full:- +full:gpios

1 // SPDX-License-Identifier: GPL-2.0-only
24 #include <media/media-entity.h>
25 #include <media/v4l2-async.h>
26 #include <media/v4l2-ctrls.h>
27 #include <media/v4l2-device.h>
28 #include <media/v4l2-event.h>
29 #include <media/v4l2-image-sizes.h>
30 #include <media/v4l2-subdev.h>
31 #include <media/v4l2-mediabus.h>
35 MODULE_PARM_DESC(debug, "Debug level (0-2)");
43 #define REG_BLUE 0x01 /* AWB - Blue channel gain */
44 #define REG_RED 0x02 /* AWB - Red channel gain */
45 #define REG_VREF 0x03 /* [7:6] - AGC[9:8], [5:3]/[2:0] */
46 #define VREF_GAIN_MASK 0xc0 /* - VREF end/start low 3 bits */
131 #define TSLB_YUYV_MASK 0x0c /* UYVY or VYUY - see com13 */
142 #define COM13_UVSWAP 0x01 /* V before U - w/TSLB */
158 #define REG_MTX(__n) (0x4f + (__n) - 1)
161 #define REG_LCC(__n) (0x62 + (__n) - 1)
189 #define REG_AECHM 0xa1 /* Exposure value - bits AEC[15:10] */
250 struct gpio_desc *gpios[NUM_GPIOS]; member
413 static inline struct v4l2_subdev *ctrl_to_sd(struct v4l2_ctrl *ctrl) in ctrl_to_sd() argument
415 return &container_of(ctrl->handler, struct ov965x, ctrls.handler)->sd; in ctrl_to_sd()
428 ret = regmap_read(ov965x->regmap, addr, &buf); in ov965x_read()
432 *val = -1; in ov965x_read()
434 v4l2_dbg(2, debug, &ov965x->sd, "%s: 0x%02x @ 0x%02x. (%d)\n", in ov965x_read()
444 ret = regmap_write(ov965x->regmap, addr, val); in ov965x_write()
446 v4l2_dbg(2, debug, &ov965x->sd, "%s: 0x%02x @ 0x%02X (%d)\n", in ov965x_write()
509 int ret = clk_prepare_enable(ov965x->clk); in __ov965x_set_power()
514 gpiod_set_value_cansleep(ov965x->gpios[GPIO_PWDN], 0); in __ov965x_set_power()
515 gpiod_set_value_cansleep(ov965x->gpios[GPIO_RST], 0); in __ov965x_set_power()
518 gpiod_set_value_cansleep(ov965x->gpios[GPIO_RST], 1); in __ov965x_set_power()
519 gpiod_set_value_cansleep(ov965x->gpios[GPIO_PWDN], 1); in __ov965x_set_power()
521 clk_disable_unprepare(ov965x->clk); in __ov965x_set_power()
524 ov965x->streaming = 0; in __ov965x_set_power()
536 mutex_lock(&ov965x->lock); in ov965x_s_power()
537 if (ov965x->power == !on) { in ov965x_s_power()
542 ov965x->apply_frame_fmt = 1; in ov965x_s_power()
543 ov965x->ctrls.update = 1; in ov965x_s_power()
547 ov965x->power += on ? 1 : -1; in ov965x_s_power()
549 WARN_ON(ov965x->power < 0); in ov965x_s_power()
550 mutex_unlock(&ov965x->lock); in ov965x_s_power()
560 struct v4l2_ctrl *ctrl = ov965x->ctrls.exposure; in ov965x_update_exposure_ctrl() local
565 mutex_lock(&ov965x->lock); in ov965x_update_exposure_ctrl()
566 if (WARN_ON(!ctrl || !ov965x->frame_size)) { in ov965x_update_exposure_ctrl()
567 mutex_unlock(&ov965x->lock); in ov965x_update_exposure_ctrl()
570 clkrc = DEF_CLKRC + ov965x->fiv->clkrc_div; in ov965x_update_exposure_ctrl()
572 fint = ov965x->mclk_frequency * ((clkrc >> 7) + 1) / in ov965x_update_exposure_ctrl()
576 max = ov965x->frame_size->max_exp_lines * trow; in ov965x_update_exposure_ctrl()
577 ov965x->exp_row_interval = trow; in ov965x_update_exposure_ctrl()
578 mutex_unlock(&ov965x->lock); in ov965x_update_exposure_ctrl()
580 v4l2_dbg(1, debug, &ov965x->sd, "clkrc: %#x, fi: %lu, tr: %lu, %d\n", in ov965x_update_exposure_ctrl()
585 max = (max - 100) / 100; in ov965x_update_exposure_ctrl()
586 def = min + (max - min) / 2; in ov965x_update_exposure_ctrl()
588 if (v4l2_ctrl_modify_range(ctrl, min, max, 1, def)) in ov965x_update_exposure_ctrl()
589 v4l2_err(&ov965x->sd, "Exposure ctrl range update failed\n"); in ov965x_update_exposure_ctrl()
608 if (WARN_ON(!ov965x->fiv)) in ov965x_set_banding_filter()
609 return -EINVAL; in ov965x_set_banding_filter()
615 mbd = (1000UL * ov965x->fiv->interval.denominator * in ov965x_set_banding_filter()
616 ov965x->frame_size->max_exp_lines) / in ov965x_set_banding_filter()
617 ov965x->fiv->interval.numerator; in ov965x_set_banding_filter()
635 ov965x->ctrls.blue_balance->val); in ov965x_set_white_balance()
639 ov965x->ctrls.red_balance->val); in ov965x_set_white_balance()
651 { 0x1c, 0x12, 0x50 }, /* -3 */ in ov965x_set_brightness()
652 { 0x3d, 0x30, 0x71 }, /* -2 */ in ov965x_set_brightness()
653 { 0x50, 0x44, 0x92 }, /* -1 */ in ov965x_set_brightness()
663 return -EINVAL; in ov965x_set_brightness()
673 struct ov965x_ctrls *ctrls = &ov965x->ctrls; in ov965x_set_gain()
680 if (ctrls->auto_gain->is_new) { in ov965x_set_gain()
684 if (ctrls->auto_gain->val) in ov965x_set_gain()
693 if (ctrls->gain->is_new && !auto_gain) { in ov965x_set_gain()
694 unsigned int gain = ctrls->gain->val; in ov965x_set_gain()
701 for (m = 6; m >= 0; m--) in ov965x_set_gain()
707 return -EINVAL; in ov965x_set_gain()
709 rgain = (gain - ((1 << m) * 16)) / (1 << m); in ov965x_set_gain()
710 rgain |= (((1 << m) - 1) << 4); in ov965x_set_gain()
724 ctrls->gain->val = (1 << m) * (16 + (rgain & 0xf)); in ov965x_set_gain()
742 value--; in ov965x_set_sharpness()
761 struct ov965x_ctrls *ctrls = &ov965x->ctrls; in ov965x_set_exposure()
766 if (ctrls->auto_exp->is_new) { in ov965x_set_exposure()
779 if (!auto_exposure && ctrls->exposure->is_new) { in ov965x_set_exposure()
780 unsigned int exposure = (ctrls->exposure->val * 100) in ov965x_set_exposure()
781 / ov965x->exp_row_interval; in ov965x_set_exposure()
784 * [b15:b0] - AECHM (b15:b10), AECH (b9:b2), COM1 (b1:b0) in ov965x_set_exposure()
794 ctrls->exposure->val = ((exposure * ov965x->exp_row_interval) in ov965x_set_exposure()
800 v4l2_ctrl_activate(ov965x->ctrls.brightness, !exp); in ov965x_set_exposure()
808 if (ov965x->ctrls.hflip->val) in ov965x_set_flip()
811 if (ov965x->ctrls.vflip->val) in ov965x_set_flip()
824 { 0x1d, 0x1f, 0x02, 0x09, 0x13, 0x1c }, /* -2 */ in ov965x_set_saturation()
825 { 0x2e, 0x31, 0x02, 0x0e, 0x1e, 0x2d }, /* -1 */ in ov965x_set_saturation()
835 return -EINVAL; in ov965x_set_saturation()
855 static int __g_volatile_ctrl(struct ov965x *ov965x, struct v4l2_ctrl *ctrl) in __g_volatile_ctrl() argument
861 if (!ov965x->power) in __g_volatile_ctrl()
864 switch (ctrl->id) { in __g_volatile_ctrl()
866 if (!ctrl->val) in __g_volatile_ctrl()
876 ov965x->ctrls.gain->val = m * (16 + (gain & 0xf)); in __g_volatile_ctrl()
880 if (ctrl->val == V4L2_EXPOSURE_MANUAL) in __g_volatile_ctrl()
893 ov965x->ctrls.exposure->val = ((exposure * in __g_volatile_ctrl()
894 ov965x->exp_row_interval) + 50) / 100; in __g_volatile_ctrl()
901 static int ov965x_g_volatile_ctrl(struct v4l2_ctrl *ctrl) in ov965x_g_volatile_ctrl() argument
903 struct v4l2_subdev *sd = ctrl_to_sd(ctrl); in ov965x_g_volatile_ctrl()
907 v4l2_dbg(1, debug, sd, "g_ctrl: %s\n", ctrl->name); in ov965x_g_volatile_ctrl()
909 mutex_lock(&ov965x->lock); in ov965x_g_volatile_ctrl()
910 ret = __g_volatile_ctrl(ov965x, ctrl); in ov965x_g_volatile_ctrl()
911 mutex_unlock(&ov965x->lock); in ov965x_g_volatile_ctrl()
915 static int ov965x_s_ctrl(struct v4l2_ctrl *ctrl) in ov965x_s_ctrl() argument
917 struct v4l2_subdev *sd = ctrl_to_sd(ctrl); in ov965x_s_ctrl()
919 int ret = -EINVAL; in ov965x_s_ctrl()
922 ctrl->name, ctrl->val, ov965x->power); in ov965x_s_ctrl()
924 mutex_lock(&ov965x->lock); in ov965x_s_ctrl()
929 if (ov965x->power == 0) { in ov965x_s_ctrl()
930 mutex_unlock(&ov965x->lock); in ov965x_s_ctrl()
934 switch (ctrl->id) { in ov965x_s_ctrl()
936 ret = ov965x_set_white_balance(ov965x, ctrl->val); in ov965x_s_ctrl()
940 ret = ov965x_set_brightness(ov965x, ctrl->val); in ov965x_s_ctrl()
944 ret = ov965x_set_exposure(ov965x, ctrl->val); in ov965x_s_ctrl()
948 ret = ov965x_set_gain(ov965x, ctrl->val); in ov965x_s_ctrl()
956 ret = ov965x_set_banding_filter(ov965x, ctrl->val); in ov965x_s_ctrl()
960 ret = ov965x_set_saturation(ov965x, ctrl->val); in ov965x_s_ctrl()
964 ret = ov965x_set_sharpness(ov965x, ctrl->val); in ov965x_s_ctrl()
968 ret = ov965x_set_test_pattern(ov965x, ctrl->val); in ov965x_s_ctrl()
972 mutex_unlock(&ov965x->lock); in ov965x_s_ctrl()
989 struct ov965x_ctrls *ctrls = &ov965x->ctrls; in ov965x_initialize_controls()
990 struct v4l2_ctrl_handler *hdl = &ctrls->handler; in ov965x_initialize_controls()
998 ctrls->auto_wb = v4l2_ctrl_new_std(hdl, ops, in ov965x_initialize_controls()
1001 ctrls->blue_balance = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_BLUE_BALANCE, in ov965x_initialize_controls()
1003 ctrls->red_balance = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_RED_BALANCE, in ov965x_initialize_controls()
1006 ctrls->auto_exp = in ov965x_initialize_controls()
1012 ctrls->exposure = v4l2_ctrl_new_std(hdl, ops, in ov965x_initialize_controls()
1016 ctrls->auto_gain = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_AUTOGAIN, in ov965x_initialize_controls()
1018 ctrls->gain = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_GAIN, in ov965x_initialize_controls()
1021 ctrls->saturation = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_SATURATION, in ov965x_initialize_controls()
1022 -2, 2, 1, 0); in ov965x_initialize_controls()
1023 ctrls->brightness = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_BRIGHTNESS, in ov965x_initialize_controls()
1024 -3, 3, 1, 0); in ov965x_initialize_controls()
1025 ctrls->sharpness = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_SHARPNESS, in ov965x_initialize_controls()
1028 ctrls->hflip = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_HFLIP, 0, 1, 1, 0); in ov965x_initialize_controls()
1029 ctrls->vflip = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_VFLIP, 0, 1, 1, 0); in ov965x_initialize_controls()
1031 ctrls->light_freq = in ov965x_initialize_controls()
1038 ARRAY_SIZE(test_pattern_menu) - 1, 0, 0, in ov965x_initialize_controls()
1040 if (hdl->error) { in ov965x_initialize_controls()
1041 ret = hdl->error; in ov965x_initialize_controls()
1046 ctrls->gain->flags |= V4L2_CTRL_FLAG_VOLATILE; in ov965x_initialize_controls()
1047 ctrls->exposure->flags |= V4L2_CTRL_FLAG_VOLATILE; in ov965x_initialize_controls()
1049 v4l2_ctrl_auto_cluster(3, &ctrls->auto_wb, 0, false); in ov965x_initialize_controls()
1050 v4l2_ctrl_auto_cluster(2, &ctrls->auto_gain, 0, true); in ov965x_initialize_controls()
1051 v4l2_ctrl_auto_cluster(2, &ctrls->auto_exp, 1, true); in ov965x_initialize_controls()
1052 v4l2_ctrl_cluster(2, &ctrls->hflip); in ov965x_initialize_controls()
1054 ov965x->sd.ctrl_handler = hdl; in ov965x_initialize_controls()
1063 mf->width = ov965x_framesizes[0].width; in ov965x_get_default_format()
1064 mf->height = ov965x_framesizes[0].height; in ov965x_get_default_format()
1065 mf->colorspace = ov965x_formats[0].colorspace; in ov965x_get_default_format()
1066 mf->code = ov965x_formats[0].code; in ov965x_get_default_format()
1067 mf->field = V4L2_FIELD_NONE; in ov965x_get_default_format()
1074 if (code->index >= ARRAY_SIZE(ov965x_formats)) in ov965x_enum_mbus_code()
1075 return -EINVAL; in ov965x_enum_mbus_code()
1077 code->code = ov965x_formats[code->index].code; in ov965x_enum_mbus_code()
1087 if (fse->index >= ARRAY_SIZE(ov965x_framesizes)) in ov965x_enum_frame_sizes()
1088 return -EINVAL; in ov965x_enum_frame_sizes()
1090 while (--i) in ov965x_enum_frame_sizes()
1091 if (fse->code == ov965x_formats[i].code) in ov965x_enum_frame_sizes()
1094 fse->code = ov965x_formats[i].code; in ov965x_enum_frame_sizes()
1096 fse->min_width = ov965x_framesizes[fse->index].width; in ov965x_enum_frame_sizes()
1097 fse->max_width = fse->min_width; in ov965x_enum_frame_sizes()
1098 fse->max_height = ov965x_framesizes[fse->index].height; in ov965x_enum_frame_sizes()
1099 fse->min_height = fse->max_height; in ov965x_enum_frame_sizes()
1114 if (fi->which != V4L2_SUBDEV_FORMAT_ACTIVE) in ov965x_get_frame_interval()
1115 return -EINVAL; in ov965x_get_frame_interval()
1117 mutex_lock(&ov965x->lock); in ov965x_get_frame_interval()
1118 fi->interval = ov965x->fiv->interval; in ov965x_get_frame_interval()
1119 mutex_unlock(&ov965x->lock); in ov965x_get_frame_interval()
1127 struct v4l2_mbus_framefmt *mbus_fmt = &ov965x->format; in __ov965x_set_frame_interval()
1132 if (fi->interval.denominator == 0) in __ov965x_set_frame_interval()
1133 return -EINVAL; in __ov965x_set_frame_interval()
1135 req_int = (u64)fi->interval.numerator * 10000; in __ov965x_set_frame_interval()
1136 do_div(req_int, fi->interval.denominator); in __ov965x_set_frame_interval()
1141 if (mbus_fmt->width != iv->size.width || in __ov965x_set_frame_interval()
1142 mbus_fmt->height != iv->size.height) in __ov965x_set_frame_interval()
1144 err = abs((u64)(iv->interval.numerator * 10000) / in __ov965x_set_frame_interval()
1145 iv->interval.denominator - req_int); in __ov965x_set_frame_interval()
1151 ov965x->fiv = fiv; in __ov965x_set_frame_interval()
1153 v4l2_dbg(1, debug, &ov965x->sd, "Changed frame interval to %u us\n", in __ov965x_set_frame_interval()
1154 fiv->interval.numerator * 1000000 / fiv->interval.denominator); in __ov965x_set_frame_interval()
1170 if (fi->which != V4L2_SUBDEV_FORMAT_ACTIVE) in ov965x_set_frame_interval()
1171 return -EINVAL; in ov965x_set_frame_interval()
1174 fi->interval.numerator, fi->interval.denominator); in ov965x_set_frame_interval()
1176 mutex_lock(&ov965x->lock); in ov965x_set_frame_interval()
1178 ov965x->apply_frame_fmt = 1; in ov965x_set_frame_interval()
1179 mutex_unlock(&ov965x->lock); in ov965x_set_frame_interval()
1190 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { in ov965x_get_fmt()
1192 fmt->format = *mf; in ov965x_get_fmt()
1196 mutex_lock(&ov965x->lock); in ov965x_get_fmt()
1197 fmt->format = ov965x->format; in ov965x_get_fmt()
1198 mutex_unlock(&ov965x->lock); in ov965x_get_fmt()
1211 while (i--) { in __ov965x_try_frame_size()
1212 int err = abs(fsize->width - mf->width) in __ov965x_try_frame_size()
1213 + abs(fsize->height - mf->height); in __ov965x_try_frame_size()
1222 mf->width = match->width; in __ov965x_try_frame_size()
1223 mf->height = match->height; in __ov965x_try_frame_size()
1233 struct v4l2_mbus_framefmt *mf = &fmt->format; in ov965x_set_fmt()
1240 while (--index) in ov965x_set_fmt()
1241 if (ov965x_formats[index].code == mf->code) in ov965x_set_fmt()
1244 mf->colorspace = V4L2_COLORSPACE_JPEG; in ov965x_set_fmt()
1245 mf->code = ov965x_formats[index].code; in ov965x_set_fmt()
1246 mf->field = V4L2_FIELD_NONE; in ov965x_set_fmt()
1248 mutex_lock(&ov965x->lock); in ov965x_set_fmt()
1250 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { in ov965x_set_fmt()
1252 mf = v4l2_subdev_state_get_format(sd_state, fmt->pad); in ov965x_set_fmt()
1253 *mf = fmt->format; in ov965x_set_fmt()
1256 if (ov965x->streaming) { in ov965x_set_fmt()
1257 ret = -EBUSY; in ov965x_set_fmt()
1259 ov965x->frame_size = size; in ov965x_set_fmt()
1260 ov965x->format = fmt->format; in ov965x_set_fmt()
1261 ov965x->tslb_reg = ov965x_formats[index].tslb_reg; in ov965x_set_fmt()
1262 ov965x->apply_frame_fmt = 1; in ov965x_set_fmt()
1266 if (!ret && fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { in ov965x_set_fmt()
1273 mutex_unlock(&ov965x->lock); in ov965x_set_fmt()
1287 ov965x->frame_size->regs[i]); in ov965x_set_frame_size()
1293 struct ov965x_ctrls *ctrls = &ov965x->ctrls; in __ov965x_set_params()
1297 if (ov965x->apply_frame_fmt) { in __ov965x_set_params()
1298 reg = DEF_CLKRC + ov965x->fiv->clkrc_div; in __ov965x_set_params()
1309 reg |= ov965x->tslb_reg; in __ov965x_set_params()
1334 return ov965x_set_banding_filter(ov965x, ctrls->light_freq->val); in __ov965x_set_params()
1340 struct ov965x_ctrls *ctrls = &ov965x->ctrls; in ov965x_s_stream()
1345 mutex_lock(&ov965x->lock); in ov965x_s_stream()
1346 if (ov965x->streaming == !on) { in ov965x_s_stream()
1350 if (!ret && ctrls->update) { in ov965x_s_stream()
1355 mutex_unlock(&ov965x->lock); in ov965x_s_stream()
1356 ret = v4l2_ctrl_handler_setup(&ctrls->handler); in ov965x_s_stream()
1358 mutex_lock(&ov965x->lock); in ov965x_s_stream()
1360 ctrls->update = 0; in ov965x_s_stream()
1367 ov965x->streaming += on ? 1 : -1; in ov965x_s_stream()
1369 WARN_ON(ov965x->streaming < 0); in ov965x_s_stream()
1370 mutex_unlock(&ov965x->lock); in ov965x_s_stream()
1381 v4l2_subdev_state_get_format(fh->state, 0); in ov965x_open()
1420 struct device *dev = regmap_get_device(ov965x->regmap); in ov965x_configure_gpios()
1422 ov965x->gpios[GPIO_PWDN] = devm_gpiod_get_optional(dev, "powerdown", in ov965x_configure_gpios()
1424 if (IS_ERR(ov965x->gpios[GPIO_PWDN])) { in ov965x_configure_gpios()
1426 return PTR_ERR(ov965x->gpios[GPIO_PWDN]); in ov965x_configure_gpios()
1429 ov965x->gpios[GPIO_RST] = devm_gpiod_get_optional(dev, "reset", in ov965x_configure_gpios()
1431 if (IS_ERR(ov965x->gpios[GPIO_RST])) { in ov965x_configure_gpios()
1433 return PTR_ERR(ov965x->gpios[GPIO_RST]); in ov965x_configure_gpios()
1445 mutex_lock(&ov965x->lock); in ov965x_detect_sensor()
1460 ov965x->id = OV965X_ID(pid, ver); in ov965x_detect_sensor()
1461 if (ov965x->id == OV9650_ID || ov965x->id == OV9652_ID) { in ov965x_detect_sensor()
1462 v4l2_info(sd, "Found OV%04X sensor\n", ov965x->id); in ov965x_detect_sensor()
1465 ov965x->id); in ov965x_detect_sensor()
1466 ret = -ENODEV; in ov965x_detect_sensor()
1470 mutex_unlock(&ov965x->lock); in ov965x_detect_sensor()
1486 ov965x = devm_kzalloc(&client->dev, sizeof(*ov965x), GFP_KERNEL); in ov965x_probe()
1488 return -ENOMEM; in ov965x_probe()
1490 ov965x->regmap = devm_regmap_init_sccb(client, &ov965x_regmap_config); in ov965x_probe()
1491 if (IS_ERR(ov965x->regmap)) { in ov965x_probe()
1492 dev_err(&client->dev, "Failed to allocate register map\n"); in ov965x_probe()
1493 return PTR_ERR(ov965x->regmap); in ov965x_probe()
1496 if (dev_fwnode(&client->dev)) { in ov965x_probe()
1497 ov965x->clk = devm_clk_get(&client->dev, NULL); in ov965x_probe()
1498 if (IS_ERR(ov965x->clk)) in ov965x_probe()
1499 return PTR_ERR(ov965x->clk); in ov965x_probe()
1500 ov965x->mclk_frequency = clk_get_rate(ov965x->clk); in ov965x_probe()
1506 dev_err(&client->dev, in ov965x_probe()
1509 return -EINVAL; in ov965x_probe()
1512 mutex_init(&ov965x->lock); in ov965x_probe()
1514 sd = &ov965x->sd; in ov965x_probe()
1516 strscpy(sd->name, DRIVER_NAME, sizeof(sd->name)); in ov965x_probe()
1518 sd->internal_ops = &ov965x_sd_internal_ops; in ov965x_probe()
1519 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | in ov965x_probe()
1522 ov965x->pad.flags = MEDIA_PAD_FL_SOURCE; in ov965x_probe()
1523 sd->entity.function = MEDIA_ENT_F_CAM_SENSOR; in ov965x_probe()
1524 ret = media_entity_pads_init(&sd->entity, 1, &ov965x->pad); in ov965x_probe()
1532 ov965x_get_default_format(&ov965x->format); in ov965x_probe()
1533 ov965x->frame_size = &ov965x_framesizes[0]; in ov965x_probe()
1534 ov965x->fiv = &ov965x_intervals[0]; in ov965x_probe()
1549 v4l2_ctrl_handler_free(sd->ctrl_handler); in ov965x_probe()
1551 media_entity_cleanup(&sd->entity); in ov965x_probe()
1553 mutex_destroy(&ov965x->lock); in ov965x_probe()
1563 v4l2_ctrl_handler_free(sd->ctrl_handler); in ov965x_remove()
1564 media_entity_cleanup(&sd->entity); in ov965x_remove()
1565 mutex_destroy(&ov965x->lock); in ov965x_remove()