• Home
  • Raw
  • Download

Lines Matching +full:sense +full:- +full:gain +full:- +full:div

1 // SPDX-License-Identifier: GPL-2.0-only
9 * Copyright 2006-7 Jonathan Corbet <corbet@lwn.net>
19 #include <media/v4l2-device.h>
20 #include <media/v4l2-event.h>
21 #include <media/v4l2-ctrls.h>
22 #include <media/v4l2-fwnode.h>
23 #include <media/v4l2-mediabus.h>
24 #include <media/v4l2-image-sizes.h>
28 MODULE_DESCRIPTION("A low-level driver for OmniVision ov7670 sensors");
33 MODULE_PARM_DESC(debug, "Debug level (0-1)");
43 #define REG_GAIN 0x00 /* Gain lower 8 bits (rest in vref) */
44 #define REG_BLUE 0x01 /* blue gain */
45 #define REG_RED 0x02 /* red gain */
46 #define REG_VREF 0x03 /* Pieces of GAIN, VSTART, VSTOP */
75 #define COM7_RGB 0x04 /* bits 0 and 2 - RGB format */
83 #define COM8_AGC 0x04 /* Auto gain enable */
86 #define REG_COM9 0x14 /* Control 9 - gain ceiling */
112 #define TSLB_YLAST 0x04 /* UYVY or VYUY - see com13 */
124 #define COM13_UVSWAP 0x01 /* V before U - w/TSLB */
126 #define COM14_DCWEN 0x10 /* DCW/PCLK-scale enable */
135 #define COM16_AWBGAIN 0x08 /* AWB gain enable */
137 #define COM17_AECWIN 0xc0 /* AEC window - must match COM4 */
144 * Order: v-red, v-green, v-blue, u-red, u-green, u-blue
146 * They are nine-bit signed quantities, with the sign bit
147 * stored in 0x58. Sign for v-red is bit 0, and up from there.
157 #define REG_GFIX 0x69 /* Fix gain control */
200 int vstart; /* sense to humans, but evidently the sensor */
225 /* gain cluster */
227 struct v4l2_ctrl *gain; member
264 return &container_of(ctrl->handler, struct ov7670_info, hdl)->sd; in to_sd()
271 * is really no making sense of most of these - lots of "reserved" values
294 * make sense - hstop is less than hstart. But they work...
322 { REG_COM9, 0x18 }, /* 4x gain + magic rsvd bit */
383 /* Extra-weird stuff. Some sort of multiplexor register */
416 { REG_COM9, 0x48 }, /* 32x gain ceiling; 0x8 is reserved bit */
432 { REG_COM9, 0x38 }, /* 16x gain ceiling; 0x8 is reserved bit */
448 { REG_COM9, 0x38 }, /* 16x gain ceiling; 0x8 is reserved bit */
470 * Low-level register I/O.
517 msg.addr = client->addr; in ov7670_read_i2c()
521 ret = i2c_transfer(client->adapter, &msg, 1); in ov7670_read_i2c()
530 ret = i2c_transfer(client->adapter, &msg, 1); in ov7670_read_i2c()
547 msg.addr = client->addr; in ov7670_write_i2c()
551 ret = i2c_transfer(client->adapter, &msg, 1); in ov7670_write_i2c()
564 if (info->use_smbus) in ov7670_read()
575 if (info->use_smbus) in ov7670_write()
599 while (vals->reg_num != 0xff || vals->value != 0xff) { in ov7670_write_array()
600 int ret = ov7670_write(sd, vals->reg_num, vals->value); in ov7670_write_array()
638 return -ENODEV; in ov7670_detect()
643 return -ENODEV; in ov7670_detect()
651 return -ENODEV; in ov7670_detect()
656 return -ENODEV; in ov7670_detect()
676 .cmatrix = { 128, -128, 0, -34, -94, 128 },
682 .cmatrix = { 179, -179, 0, -61, -176, 228 },
688 .cmatrix = { 179, -179, 0, -61, -176, 228 },
705 * QCIF mode is done (by OV) in a very strange way - it actually looks like
706 * VGA with weird scaling options - they do *not* use the canned QCIF mode
798 u32 clkrc = info->clkrc; in ov7675_get_framerate()
801 if (info->pll_bypass) in ov7675_get_framerate()
807 if (info->fmt->mbus_code == MEDIA_BUS_FMT_SBGGR8_1X8) in ov7675_get_framerate()
810 tpf->numerator = 1; in ov7675_get_framerate()
811 tpf->denominator = (5 * pll_factor * info->clock_speed) / in ov7675_get_framerate()
820 ret = ov7670_write(sd, REG_CLKRC, info->clkrc); in ov7675_apply_framerate()
825 info->pll_bypass ? DBLV_BYPASS : DBLV_X4); in ov7675_apply_framerate()
842 if (tpf->numerator == 0 || tpf->denominator == 0) { in ov7675_set_framerate()
845 pll_factor = info->pll_bypass ? 1 : PLL_FACTOR; in ov7675_set_framerate()
846 clkrc = (5 * pll_factor * info->clock_speed * tpf->numerator) / in ov7675_set_framerate()
847 (4 * tpf->denominator); in ov7675_set_framerate()
848 if (info->fmt->mbus_code == MEDIA_BUS_FMT_SBGGR8_1X8) in ov7675_set_framerate()
850 clkrc--; in ov7675_set_framerate()
862 info->clkrc = clkrc; in ov7675_set_framerate()
870 * the framerate will be restored right after power-up. in ov7675_set_framerate()
872 if (info->on) in ov7675_set_framerate()
883 tpf->numerator = 1; in ov7670_get_framerate_legacy()
884 tpf->denominator = info->clock_speed; in ov7670_get_framerate_legacy()
885 if ((info->clkrc & CLK_EXT) == 0 && (info->clkrc & CLK_SCALE) > 1) in ov7670_get_framerate_legacy()
886 tpf->denominator /= (info->clkrc & CLK_SCALE); in ov7670_get_framerate_legacy()
893 int div; in ov7670_set_framerate_legacy() local
895 if (tpf->numerator == 0 || tpf->denominator == 0) in ov7670_set_framerate_legacy()
896 div = 1; /* Reset to full rate */ in ov7670_set_framerate_legacy()
898 div = (tpf->numerator * info->clock_speed) / tpf->denominator; in ov7670_set_framerate_legacy()
899 if (div == 0) in ov7670_set_framerate_legacy()
900 div = 1; in ov7670_set_framerate_legacy()
901 else if (div > CLK_SCALE) in ov7670_set_framerate_legacy()
902 div = CLK_SCALE; in ov7670_set_framerate_legacy()
903 info->clkrc = (info->clkrc & 0x80) | div; in ov7670_set_framerate_legacy()
904 tpf->numerator = 1; in ov7670_set_framerate_legacy()
905 tpf->denominator = info->clock_speed / div; in ov7670_set_framerate_legacy()
910 * the framerate will be restored right after power-up. in ov7670_set_framerate_legacy()
912 if (info->on) in ov7670_set_framerate_legacy()
913 return ov7670_write(sd, REG_CLKRC, info->clkrc); in ov7670_set_framerate_legacy()
965 if (code->pad || code->index >= N_OV7670_FMTS) in ov7670_enum_mbus_code()
966 return -EINVAL; in ov7670_enum_mbus_code()
968 code->code = ov7670_formats[code->index].mbus_code; in ov7670_enum_mbus_code()
980 unsigned int n_win_sizes = info->devtype->n_win_sizes; in ov7670_try_fmt_internal()
984 if (ov7670_formats[index].mbus_code == fmt->code) in ov7670_try_fmt_internal()
989 fmt->code = ov7670_formats[0].mbus_code; in ov7670_try_fmt_internal()
996 fmt->field = V4L2_FIELD_NONE; in ov7670_try_fmt_internal()
1002 if (info->min_width || info->min_height) in ov7670_try_fmt_internal()
1004 wsize = info->devtype->win_sizes + i; in ov7670_try_fmt_internal()
1006 if (wsize->width < info->min_width || in ov7670_try_fmt_internal()
1007 wsize->height < info->min_height) { in ov7670_try_fmt_internal()
1016 for (wsize = info->devtype->win_sizes; in ov7670_try_fmt_internal()
1017 wsize < info->devtype->win_sizes + win_sizes_limit; wsize++) in ov7670_try_fmt_internal()
1018 if (fmt->width >= wsize->width && fmt->height >= wsize->height) in ov7670_try_fmt_internal()
1020 if (wsize >= info->devtype->win_sizes + win_sizes_limit) in ov7670_try_fmt_internal()
1021 wsize--; /* Take the smallest one */ in ov7670_try_fmt_internal()
1027 fmt->width = wsize->width; in ov7670_try_fmt_internal()
1028 fmt->height = wsize->height; in ov7670_try_fmt_internal()
1029 fmt->colorspace = ov7670_formats[index].colorspace; in ov7670_try_fmt_internal()
1031 info->format = *fmt; in ov7670_try_fmt_internal()
1039 struct ov7670_win_size *wsize = info->wsize; in ov7670_apply_fmt()
1046 * to set it absolutely here, as long as the format-specific in ov7670_apply_fmt()
1049 com7 = info->fmt->regs[0].value; in ov7670_apply_fmt()
1050 com7 |= wsize->com7_bit; in ov7670_apply_fmt()
1058 if (info->mbus_config & V4L2_MBUS_VSYNC_ACTIVE_LOW) in ov7670_apply_fmt()
1060 if (info->mbus_config & V4L2_MBUS_HSYNC_ACTIVE_LOW) in ov7670_apply_fmt()
1062 if (info->pclk_hb_disable) in ov7670_apply_fmt()
1071 ret = ov7670_write_array(sd, info->fmt->regs + 1); in ov7670_apply_fmt()
1075 ret = ov7670_set_hw(sd, wsize->hstart, wsize->hstop, wsize->vstart, in ov7670_apply_fmt()
1076 wsize->vstop); in ov7670_apply_fmt()
1080 if (wsize->regs) { in ov7670_apply_fmt()
1081 ret = ov7670_write_array(sd, wsize->regs); in ov7670_apply_fmt()
1096 ret = ov7670_write(sd, REG_CLKRC, info->clkrc); in ov7670_apply_fmt()
1116 if (format->pad) in ov7670_set_fmt()
1117 return -EINVAL; in ov7670_set_fmt()
1119 if (format->which == V4L2_SUBDEV_FORMAT_TRY) { in ov7670_set_fmt()
1120 ret = ov7670_try_fmt_internal(sd, &format->format, NULL, NULL); in ov7670_set_fmt()
1125 format->pad); in ov7670_set_fmt()
1126 *mbus_fmt = format->format; in ov7670_set_fmt()
1131 ret = ov7670_try_fmt_internal(sd, &format->format, &info->fmt, &info->wsize); in ov7670_set_fmt()
1138 * the frame format will be restored right after power-up. in ov7670_set_fmt()
1140 if (info->on) in ov7670_set_fmt()
1155 if (format->which == V4L2_SUBDEV_FORMAT_TRY) { in ov7670_get_fmt()
1158 format->format = *mbus_fmt; in ov7670_get_fmt()
1161 return -EINVAL; in ov7670_get_fmt()
1164 format->format = info->format; in ov7670_get_fmt()
1180 info->devtype->get_framerate(sd, &ival->interval); in ov7670_g_frame_interval()
1188 struct v4l2_fract *tpf = &ival->interval; in ov7670_s_frame_interval()
1192 return info->devtype->set_framerate(sd, tpf); in ov7670_s_frame_interval()
1209 unsigned int n_win_sizes = info->devtype->n_win_sizes; in ov7670_enum_frame_interval()
1212 if (fie->pad) in ov7670_enum_frame_interval()
1213 return -EINVAL; in ov7670_enum_frame_interval()
1214 if (fie->index >= ARRAY_SIZE(ov7670_frame_rates)) in ov7670_enum_frame_interval()
1215 return -EINVAL; in ov7670_enum_frame_interval()
1224 struct ov7670_win_size *win = &info->devtype->win_sizes[i]; in ov7670_enum_frame_interval()
1226 if (info->min_width && win->width < info->min_width) in ov7670_enum_frame_interval()
1228 if (info->min_height && win->height < info->min_height) in ov7670_enum_frame_interval()
1230 if (fie->width == win->width && fie->height == win->height) in ov7670_enum_frame_interval()
1234 return -EINVAL; in ov7670_enum_frame_interval()
1235 fie->interval.numerator = 1; in ov7670_enum_frame_interval()
1236 fie->interval.denominator = ov7670_frame_rates[fie->index]; in ov7670_enum_frame_interval()
1249 int num_valid = -1; in ov7670_enum_frame_size()
1250 __u32 index = fse->index; in ov7670_enum_frame_size()
1251 unsigned int n_win_sizes = info->devtype->n_win_sizes; in ov7670_enum_frame_size()
1253 if (fse->pad) in ov7670_enum_frame_size()
1254 return -EINVAL; in ov7670_enum_frame_size()
1261 struct ov7670_win_size *win = &info->devtype->win_sizes[i]; in ov7670_enum_frame_size()
1263 if (info->min_width && win->width < info->min_width) in ov7670_enum_frame_size()
1265 if (info->min_height && win->height < info->min_height) in ov7670_enum_frame_size()
1268 fse->min_width = fse->max_width = win->width; in ov7670_enum_frame_size()
1269 fse->min_height = fse->max_height = win->height; in ov7670_enum_frame_size()
1274 return -EINVAL; in ov7670_enum_frame_size()
1299 if (matrix[i] < -255) in ov7670_store_cmatrix()
1302 raw = (-1 * matrix[i]) & 0xff; in ov7670_store_cmatrix()
1320 * So here is a simple table of sine values, 0-90 degrees, in steps
1324 * carefully limited to -180 <= theta <= 180.
1340 theta = -theta; in ov7670_sine()
1341 chs = -1; in ov7670_sine()
1346 theta -= 90; in ov7670_sine()
1347 sine = 1000 - ov7670_sin_table[theta/SIN_STEP]; in ov7670_sine()
1354 theta = 90 - theta; in ov7670_cosine()
1356 theta -= 360; in ov7670_cosine()
1357 else if (theta < -180) in ov7670_cosine()
1373 matrix[i] = (info->fmt->cmatrix[i] * sat) >> 7; in ov7670_calc_cmatrix()
1387 matrix[3] = (matrix[3]*costh - matrix[0]*sinth)/1000; in ov7670_calc_cmatrix()
1388 matrix[4] = (matrix[4]*costh - matrix[1]*sinth)/1000; in ov7670_calc_cmatrix()
1389 matrix[5] = (matrix[5]*costh - matrix[2]*sinth)/1000; in ov7670_calc_cmatrix()
1413 return (128 - v) | 0x80; in ov7670_abs_to_sm()
1465 * GAIN is split between REG_GAIN and REG_VREF[7:6]. If one believes
1473 unsigned char gain; in ov7670_g_gain() local
1475 ret = ov7670_read(sd, REG_GAIN, &gain); in ov7670_g_gain()
1478 *value = gain; in ov7670_g_gain()
1562 "8-bar color bar",
1584 switch (ctrl->id) { in ov7670_g_volatile_ctrl()
1586 return ov7670_g_gain(sd, &info->gain->val); in ov7670_g_volatile_ctrl()
1588 return -EINVAL; in ov7670_g_volatile_ctrl()
1596 switch (ctrl->id) { in ov7670_s_ctrl()
1598 return ov7670_s_brightness(sd, ctrl->val); in ov7670_s_ctrl()
1600 return ov7670_s_contrast(sd, ctrl->val); in ov7670_s_ctrl()
1603 info->saturation->val, info->hue->val); in ov7670_s_ctrl()
1605 return ov7670_s_vflip(sd, ctrl->val); in ov7670_s_ctrl()
1607 return ov7670_s_hflip(sd, ctrl->val); in ov7670_s_ctrl()
1609 /* Only set manual gain if auto gain is not explicitly in ov7670_s_ctrl()
1611 if (!ctrl->val) { in ov7670_s_ctrl()
1612 /* ov7670_s_gain turns off auto gain */ in ov7670_s_ctrl()
1613 return ov7670_s_gain(sd, info->gain->val); in ov7670_s_ctrl()
1615 return ov7670_s_autogain(sd, ctrl->val); in ov7670_s_ctrl()
1619 if (ctrl->val == V4L2_EXPOSURE_MANUAL) { in ov7670_s_ctrl()
1621 return ov7670_s_exp(sd, info->exposure->val); in ov7670_s_ctrl()
1623 return ov7670_s_autoexp(sd, ctrl->val); in ov7670_s_ctrl()
1625 return ov7670_s_test_pattern(sd, ctrl->val); in ov7670_s_ctrl()
1627 return -EINVAL; in ov7670_s_ctrl()
1641 ret = ov7670_read(sd, reg->reg & 0xff, &val); in ov7670_g_register()
1642 reg->val = val; in ov7670_g_register()
1643 reg->size = 1; in ov7670_g_register()
1649 ov7670_write(sd, reg->reg & 0xff, reg->val & 0xff); in ov7670_s_register()
1658 if (info->on) in ov7670_power_on()
1661 clk_prepare_enable(info->clk); in ov7670_power_on()
1663 if (info->pwdn_gpio) in ov7670_power_on()
1664 gpiod_set_value(info->pwdn_gpio, 0); in ov7670_power_on()
1665 if (info->resetb_gpio) { in ov7670_power_on()
1666 gpiod_set_value(info->resetb_gpio, 1); in ov7670_power_on()
1668 gpiod_set_value(info->resetb_gpio, 0); in ov7670_power_on()
1670 if (info->pwdn_gpio || info->resetb_gpio || info->clk) in ov7670_power_on()
1673 info->on = true; in ov7670_power_on()
1680 if (!info->on) in ov7670_power_off()
1683 clk_disable_unprepare(info->clk); in ov7670_power_off()
1685 if (info->pwdn_gpio) in ov7670_power_off()
1686 gpiod_set_value(info->pwdn_gpio, 1); in ov7670_power_off()
1688 info->on = false; in ov7670_power_off()
1695 if (info->on == on) in ov7670_s_power()
1703 v4l2_ctrl_handler_setup(&info->hdl); in ov7670_s_power()
1716 format->width = info->devtype->win_sizes[0].width; in ov7670_get_default_format()
1717 format->height = info->devtype->win_sizes[0].height; in ov7670_get_default_format()
1718 format->colorspace = info->fmt->colorspace; in ov7670_get_default_format()
1719 format->code = info->fmt->mbus_code; in ov7670_get_default_format()
1720 format->field = V4L2_FIELD_NONE; in ov7670_get_default_format()
1727 v4l2_subdev_get_try_format(sd, fh->state, 0); in ov7670_open()
1735 /* ----------------------------------------------------------------------- */
1775 /* ----------------------------------------------------------------------- */
1794 info->pwdn_gpio = devm_gpiod_get_optional(&client->dev, "powerdown", in ov7670_init_gpio()
1796 if (IS_ERR(info->pwdn_gpio)) { in ov7670_init_gpio()
1797 dev_info(&client->dev, "can't get %s GPIO\n", "powerdown"); in ov7670_init_gpio()
1798 return PTR_ERR(info->pwdn_gpio); in ov7670_init_gpio()
1801 info->resetb_gpio = devm_gpiod_get_optional(&client->dev, "reset", in ov7670_init_gpio()
1803 if (IS_ERR(info->resetb_gpio)) { in ov7670_init_gpio()
1804 dev_info(&client->dev, "can't get %s GPIO\n", "reset"); in ov7670_init_gpio()
1805 return PTR_ERR(info->resetb_gpio); in ov7670_init_gpio()
1814 * ov7670_parse_dt() - Parse device tree to collect mbus configuration
1826 return -EINVAL; in ov7670_parse_dt()
1828 info->pclk_hb_disable = false; in ov7670_parse_dt()
1829 if (fwnode_property_present(fwnode, "ov7670,pclk-hb-disable")) in ov7670_parse_dt()
1830 info->pclk_hb_disable = true; in ov7670_parse_dt()
1834 return -EINVAL; in ov7670_parse_dt()
1843 return -EINVAL; in ov7670_parse_dt()
1845 info->mbus_config = bus_cfg.bus.parallel.flags; in ov7670_parse_dt()
1858 info = devm_kzalloc(&client->dev, sizeof(*info), GFP_KERNEL); in ov7670_probe()
1860 return -ENOMEM; in ov7670_probe()
1861 sd = &info->sd; in ov7670_probe()
1865 sd->internal_ops = &ov7670_subdev_internal_ops; in ov7670_probe()
1866 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; in ov7670_probe()
1869 info->clock_speed = 30; /* default: a guess */ in ov7670_probe()
1871 if (dev_fwnode(&client->dev)) { in ov7670_probe()
1872 ret = ov7670_parse_dt(&client->dev, info); in ov7670_probe()
1876 } else if (client->dev.platform_data) { in ov7670_probe()
1877 struct ov7670_config *config = client->dev.platform_data; in ov7670_probe()
1883 info->min_width = config->min_width; in ov7670_probe()
1884 info->min_height = config->min_height; in ov7670_probe()
1885 info->use_smbus = config->use_smbus; in ov7670_probe()
1887 if (config->clock_speed) in ov7670_probe()
1888 info->clock_speed = config->clock_speed; in ov7670_probe()
1890 if (config->pll_bypass) in ov7670_probe()
1891 info->pll_bypass = true; in ov7670_probe()
1893 if (config->pclk_hb_disable) in ov7670_probe()
1894 info->pclk_hb_disable = true; in ov7670_probe()
1897 info->clk = devm_clk_get_optional(&client->dev, "xclk"); in ov7670_probe()
1898 if (IS_ERR(info->clk)) in ov7670_probe()
1899 return PTR_ERR(info->clk); in ov7670_probe()
1907 if (info->clk) { in ov7670_probe()
1908 info->clock_speed = clk_get_rate(info->clk) / 1000000; in ov7670_probe()
1909 if (info->clock_speed < 10 || info->clock_speed > 48) { in ov7670_probe()
1910 ret = -EINVAL; in ov7670_probe()
1920 client->addr << 1, client->adapter->name); in ov7670_probe()
1924 client->addr << 1, client->adapter->name); in ov7670_probe()
1926 info->devtype = &ov7670_devdata[id->driver_data]; in ov7670_probe()
1927 info->fmt = &ov7670_formats[0]; in ov7670_probe()
1928 info->wsize = &info->devtype->win_sizes[0]; in ov7670_probe()
1930 ov7670_get_default_format(sd, &info->format); in ov7670_probe()
1932 info->clkrc = 0; in ov7670_probe()
1937 info->devtype->set_framerate(sd, &tpf); in ov7670_probe()
1939 v4l2_ctrl_handler_init(&info->hdl, 10); in ov7670_probe()
1940 v4l2_ctrl_new_std(&info->hdl, &ov7670_ctrl_ops, in ov7670_probe()
1942 v4l2_ctrl_new_std(&info->hdl, &ov7670_ctrl_ops, in ov7670_probe()
1944 v4l2_ctrl_new_std(&info->hdl, &ov7670_ctrl_ops, in ov7670_probe()
1946 v4l2_ctrl_new_std(&info->hdl, &ov7670_ctrl_ops, in ov7670_probe()
1948 info->saturation = v4l2_ctrl_new_std(&info->hdl, &ov7670_ctrl_ops, in ov7670_probe()
1950 info->hue = v4l2_ctrl_new_std(&info->hdl, &ov7670_ctrl_ops, in ov7670_probe()
1951 V4L2_CID_HUE, -180, 180, 5, 0); in ov7670_probe()
1952 info->gain = v4l2_ctrl_new_std(&info->hdl, &ov7670_ctrl_ops, in ov7670_probe()
1954 info->auto_gain = v4l2_ctrl_new_std(&info->hdl, &ov7670_ctrl_ops, in ov7670_probe()
1956 info->exposure = v4l2_ctrl_new_std(&info->hdl, &ov7670_ctrl_ops, in ov7670_probe()
1958 info->auto_exposure = v4l2_ctrl_new_std_menu(&info->hdl, &ov7670_ctrl_ops, in ov7670_probe()
1961 v4l2_ctrl_new_std_menu_items(&info->hdl, &ov7670_ctrl_ops, in ov7670_probe()
1963 ARRAY_SIZE(ov7670_test_pattern_menu) - 1, 0, 0, in ov7670_probe()
1965 sd->ctrl_handler = &info->hdl; in ov7670_probe()
1966 if (info->hdl.error) { in ov7670_probe()
1967 ret = info->hdl.error; in ov7670_probe()
1972 * We have checked empirically that hw allows to read back the gain in ov7670_probe()
1973 * value chosen by auto gain but that's not the case for auto exposure. in ov7670_probe()
1975 v4l2_ctrl_auto_cluster(2, &info->auto_gain, 0, true); in ov7670_probe()
1976 v4l2_ctrl_auto_cluster(2, &info->auto_exposure, in ov7670_probe()
1978 v4l2_ctrl_cluster(2, &info->saturation); in ov7670_probe()
1981 info->pad.flags = MEDIA_PAD_FL_SOURCE; in ov7670_probe()
1982 info->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; in ov7670_probe()
1983 ret = media_entity_pads_init(&info->sd.entity, 1, &info->pad); in ov7670_probe()
1988 v4l2_ctrl_handler_setup(&info->hdl); in ov7670_probe()
1990 ret = v4l2_async_register_subdev(&info->sd); in ov7670_probe()
1998 media_entity_cleanup(&info->sd.entity); in ov7670_probe()
2000 v4l2_ctrl_handler_free(&info->hdl); in ov7670_probe()
2012 v4l2_ctrl_handler_free(&info->hdl); in ov7670_remove()
2013 media_entity_cleanup(&info->sd.entity); in ov7670_remove()