Lines Matching +full:four +full:- +full:lane
1 // SPDX-License-Identifier: GPL-2.0
3 * imx274.c - IMX274 CMOS Image Sensor driver
23 #include <linux/v4l2-mediabus.h>
26 #include <media/v4l2-ctrls.h>
27 #include <media/v4l2-device.h>
28 #include <media/v4l2-fwnode.h>
29 #include <media/v4l2-subdev.h>
49 #define IMX274_GAIN_SHIFT_MASK ((1 << IMX274_GAIN_SHIFT) - 1)
59 / (2048 - IMX274_GAIN_REG_MAX))
76 * register SHR is limited to (SVR value + 1) x VMAX value - 4
167 * Adjustment (CSI-2)" in the datasheet)
168 * @min_SHR: Minimum SHR register value (see "Shutter Setting (CSI-2)" in the
172 * in Each Readout Drive Mode (CSI-2)" in the datasheet)
220 * All-pixel scan mode (10-bit)
222 * 3840x2160 resolution, raw10 data and mipi four lane output
260 * Horizontal/vertical 2/2-line binning
261 * (Horizontal and vertical weightedbinning, 10-bit)
263 * 1920x1080 resolution, raw10 data and mipi four lane output
303 * 1280x720 resolution, raw10 data and mipi four lane output
343 * 1280x540 resolution, raw10 data and mipi four lane output
534 * struct imx274_ctrls - imx274 ctrl structure
550 * struct stim274 - imx274 device structure
610 return &container_of(ctrl->handler, in ctrl_to_sd()
611 struct stimx274, ctrls.handler)->sd; in ctrl_to_sd()
631 struct regmap *regmap = priv->regmap; in imx274_write_table()
636 int range_start = -1; in imx274_write_table()
642 if ((next->addr != range_start + range_count) || in imx274_write_table()
643 (next->addr == IMX274_TABLE_END) || in imx274_write_table()
644 (next->addr == IMX274_TABLE_WAIT_MS) || in imx274_write_table()
659 range_start = -1; in imx274_write_table()
663 if (next->addr == IMX274_TABLE_END) in imx274_write_table()
666 if (next->addr == IMX274_TABLE_WAIT_MS) { in imx274_write_table()
667 msleep_range(next->val); in imx274_write_table()
672 val = next->val; in imx274_write_table()
674 if (range_start == -1) in imx274_write_table()
675 range_start = next->addr; in imx274_write_table()
686 err = regmap_write(priv->regmap, addr, val); in imx274_write_reg()
688 dev_err(&priv->client->dev, in imx274_write_reg()
692 dev_dbg(&priv->client->dev, in imx274_write_reg()
699 * imx274_read_mbreg - Read a multibyte register.
705 * consecutive, least-to-most significant.
718 err = regmap_bulk_read(priv->regmap, addr, &val_le, nbytes); in imx274_read_mbreg()
720 dev_err(&priv->client->dev, in imx274_read_mbreg()
725 dev_dbg(&priv->client->dev, in imx274_read_mbreg()
734 * imx274_write_mbreg - Write a multibyte register.
740 * consecutive, least-to-most significant.
750 err = regmap_bulk_write(priv->regmap, addr, &val_le, nbytes); in imx274_write_mbreg()
752 dev_err(&priv->client->dev, in imx274_write_mbreg()
756 dev_dbg(&priv->client->dev, in imx274_write_mbreg()
776 err = imx274_write_table(priv, priv->mode->init_regs); in imx274_mode_regs()
782 * imx274_start_stream - Function for starting stream per mode index
791 err = __v4l2_ctrl_handler_setup(&priv->ctrls.handler); in imx274_start_stream()
793 dev_err(&priv->client->dev, "Error %d setup controls\n", err); in imx274_start_stream()
798 * Refer to "Standby Cancel Sequence when using CSI-2" in in imx274_start_stream()
808 * Refer to "Standby Cancel Sequence when using CSI-2" in in imx274_start_stream()
821 * imx274_reset - Function called to reset the sensor
832 gpiod_set_value_cansleep(priv->reset_gpio, 0); in imx274_reset()
834 gpiod_set_value_cansleep(priv->reset_gpio, !!rst); in imx274_reset()
848 ret = clk_prepare_enable(imx274->inck); in imx274_power_on()
850 dev_err(&imx274->client->dev, in imx274_power_on()
855 ret = regulator_bulk_enable(IMX274_NUM_SUPPLIES, imx274->supplies); in imx274_power_on()
857 dev_err(&imx274->client->dev, in imx274_power_on()
868 clk_disable_unprepare(imx274->inck); in imx274_power_on()
880 regulator_bulk_disable(IMX274_NUM_SUPPLIES, imx274->supplies); in imx274_power_off()
882 clk_disable_unprepare(imx274->inck); in imx274_power_off()
892 imx274->supplies[i].supply = imx274_supply_names[i]; in imx274_regulators_get()
895 imx274->supplies); in imx274_regulators_get()
899 * imx274_s_ctrl - This is used to set the imx274 V4L2 controls
910 int ret = -EINVAL; in imx274_s_ctrl()
912 if (!pm_runtime_get_if_in_use(&imx274->client->dev)) in imx274_s_ctrl()
915 dev_dbg(&imx274->client->dev, in imx274_s_ctrl()
917 ctrl->name, ctrl->val); in imx274_s_ctrl()
919 switch (ctrl->id) { in imx274_s_ctrl()
921 dev_dbg(&imx274->client->dev, in imx274_s_ctrl()
923 ret = imx274_set_exposure(imx274, ctrl->val); in imx274_s_ctrl()
927 dev_dbg(&imx274->client->dev, in imx274_s_ctrl()
933 dev_dbg(&imx274->client->dev, in imx274_s_ctrl()
935 ret = imx274_set_vflip(imx274, ctrl->val); in imx274_s_ctrl()
939 dev_dbg(&imx274->client->dev, in imx274_s_ctrl()
941 ret = imx274_set_test_pattern(imx274, ctrl->val); in imx274_s_ctrl()
945 pm_runtime_put(&imx274->client->dev); in imx274_s_ctrl()
954 struct device *dev = &imx274->client->dev; in imx274_binning_goodness()
960 val -= goodness; in imx274_binning_goodness()
962 val -= goodness; in imx274_binning_goodness()
967 val -= goodness; in imx274_binning_goodness()
969 val -= goodness; in imx274_binning_goodness()
972 val -= abs(w - ask_w); in imx274_binning_goodness()
973 val -= abs(h - ask_h); in imx274_binning_goodness()
982 * __imx274_change_compose - Helper function to change binning and set both
995 * Must be called with imx274->lock locked.
1000 * @width: Input-output parameter: set to the desired width before
1002 * @height: Input-output parameter for height (see @width)
1013 struct device *dev = &imx274->client->dev; in __imx274_change_compose()
1024 cur_crop = &imx274->crop; in __imx274_change_compose()
1025 tgt_fmt = &imx274->format; in __imx274_change_compose()
1034 cur_crop->width / wratio, *width, in __imx274_change_compose()
1035 cur_crop->height / hratio, *height, in __imx274_change_compose()
1044 *width = cur_crop->width / best_mode->wbin_ratio; in __imx274_change_compose()
1045 *height = cur_crop->height / best_mode->hbin_ratio; in __imx274_change_compose()
1048 imx274->mode = best_mode; in __imx274_change_compose()
1051 __func__, best_mode->wbin_ratio, best_mode->hbin_ratio); in __imx274_change_compose()
1053 tgt_fmt->width = *width; in __imx274_change_compose()
1054 tgt_fmt->height = *height; in __imx274_change_compose()
1055 tgt_fmt->field = V4L2_FIELD_NONE; in __imx274_change_compose()
1061 * imx274_get_fmt - Get the pad format
1076 mutex_lock(&imx274->lock); in imx274_get_fmt()
1077 fmt->format = imx274->format; in imx274_get_fmt()
1078 mutex_unlock(&imx274->lock); in imx274_get_fmt()
1083 * imx274_set_fmt - This is used to set the pad format
1096 struct v4l2_mbus_framefmt *fmt = &format->format; in imx274_set_fmt()
1100 mutex_lock(&imx274->lock); in imx274_set_fmt()
1102 err = __imx274_change_compose(imx274, sd_state, format->which, in imx274_set_fmt()
1103 &fmt->width, &fmt->height, 0); in imx274_set_fmt()
1113 fmt->field = V4L2_FIELD_NONE; in imx274_set_fmt()
1114 if (format->which == V4L2_SUBDEV_FORMAT_TRY) in imx274_set_fmt()
1117 imx274->format = *fmt; in imx274_set_fmt()
1120 mutex_unlock(&imx274->lock); in imx274_set_fmt()
1134 if (sel->pad != 0) in imx274_get_selection()
1135 return -EINVAL; in imx274_get_selection()
1137 if (sel->target == V4L2_SEL_TGT_CROP_BOUNDS) { in imx274_get_selection()
1138 sel->r.left = 0; in imx274_get_selection()
1139 sel->r.top = 0; in imx274_get_selection()
1140 sel->r.width = IMX274_MAX_WIDTH; in imx274_get_selection()
1141 sel->r.height = IMX274_MAX_HEIGHT; in imx274_get_selection()
1145 if (sel->which == V4L2_SUBDEV_FORMAT_TRY) { in imx274_get_selection()
1149 src_crop = &imx274->crop; in imx274_get_selection()
1150 src_fmt = &imx274->format; in imx274_get_selection()
1153 mutex_lock(&imx274->lock); in imx274_get_selection()
1155 switch (sel->target) { in imx274_get_selection()
1157 sel->r = *src_crop; in imx274_get_selection()
1160 sel->r.top = 0; in imx274_get_selection()
1161 sel->r.left = 0; in imx274_get_selection()
1162 sel->r.width = src_crop->width; in imx274_get_selection()
1163 sel->r.height = src_crop->height; in imx274_get_selection()
1166 sel->r.top = 0; in imx274_get_selection()
1167 sel->r.left = 0; in imx274_get_selection()
1168 sel->r.width = src_fmt->width; in imx274_get_selection()
1169 sel->r.height = src_fmt->height; in imx274_get_selection()
1172 ret = -EINVAL; in imx274_get_selection()
1175 mutex_unlock(&imx274->lock); in imx274_get_selection()
1197 IMX274_ROUND(sel->r.width, h_step, sel->flags), in imx274_set_selection_crop()
1200 /* Constraint: HTRIMMING_END - HTRIMMING_START >= 144 */ in imx274_set_selection_crop()
1205 IMX274_ROUND(sel->r.left, h_step, 0), in imx274_set_selection_crop()
1206 IMX274_MAX_WIDTH - new_crop.width); in imx274_set_selection_crop()
1209 IMX274_ROUND(sel->r.height, 2, sel->flags), in imx274_set_selection_crop()
1212 new_crop.top = min_t(u32, IMX274_ROUND(sel->r.top, 2, 0), in imx274_set_selection_crop()
1213 IMX274_MAX_HEIGHT - new_crop.height); in imx274_set_selection_crop()
1215 sel->r = new_crop; in imx274_set_selection_crop()
1217 if (sel->which == V4L2_SUBDEV_FORMAT_TRY) in imx274_set_selection_crop()
1220 tgt_crop = &imx274->crop; in imx274_set_selection_crop()
1222 mutex_lock(&imx274->lock); in imx274_set_selection_crop()
1224 size_changed = (new_crop.width != tgt_crop->width || in imx274_set_selection_crop()
1225 new_crop.height != tgt_crop->height); in imx274_set_selection_crop()
1232 __imx274_change_compose(imx274, sd_state, sel->which, in imx274_set_selection_crop()
1234 sel->flags); in imx274_set_selection_crop()
1236 mutex_unlock(&imx274->lock); in imx274_set_selection_crop()
1247 if (sel->pad != 0) in imx274_set_selection()
1248 return -EINVAL; in imx274_set_selection()
1250 if (sel->target == V4L2_SEL_TGT_CROP) in imx274_set_selection()
1253 if (sel->target == V4L2_SEL_TGT_COMPOSE) { in imx274_set_selection()
1256 mutex_lock(&imx274->lock); in imx274_set_selection()
1257 err = __imx274_change_compose(imx274, sd_state, sel->which, in imx274_set_selection()
1258 &sel->r.width, &sel->r.height, in imx274_set_selection()
1259 sel->flags); in imx274_set_selection()
1260 mutex_unlock(&imx274->lock); in imx274_set_selection()
1264 * height in set->r, we still need to set top-left in imx274_set_selection()
1267 sel->r.top = 0; in imx274_set_selection()
1268 sel->r.left = 0; in imx274_set_selection()
1274 return -EINVAL; in imx274_set_selection()
1288 h_start = imx274->crop.left + 12; in imx274_apply_trimming()
1289 h_end = h_start + imx274->crop.width; in imx274_apply_trimming()
1294 hmax = max_t(u32, 260, (imx274->crop.width) / 16 + 23); in imx274_apply_trimming()
1297 v_pos = imx274->ctrls.vflip->cur.val ? in imx274_apply_trimming()
1298 (-imx274->crop.top / 2) : (imx274->crop.top / 2); in imx274_apply_trimming()
1299 v_cut = (IMX274_MAX_HEIGHT - imx274->crop.height) / 2; in imx274_apply_trimming()
1300 write_v_size = imx274->crop.height + 22; in imx274_apply_trimming()
1301 y_out_size = imx274->crop.height; in imx274_apply_trimming()
1340 if (fi->which != V4L2_SUBDEV_FORMAT_ACTIVE) in imx274_get_frame_interval()
1341 return -EINVAL; in imx274_get_frame_interval()
1343 fi->interval = imx274->frame_interval; in imx274_get_frame_interval()
1344 dev_dbg(&imx274->client->dev, "%s frame rate = %d / %d\n", in imx274_get_frame_interval()
1345 __func__, imx274->frame_interval.numerator, in imx274_get_frame_interval()
1346 imx274->frame_interval.denominator); in imx274_get_frame_interval()
1356 struct v4l2_ctrl *ctrl = imx274->ctrls.exposure; in imx274_set_frame_interval()
1364 if (fi->which != V4L2_SUBDEV_FORMAT_ACTIVE) in imx274_set_frame_interval()
1365 return -EINVAL; in imx274_set_frame_interval()
1367 ret = pm_runtime_resume_and_get(&imx274->client->dev); in imx274_set_frame_interval()
1371 mutex_lock(&imx274->lock); in imx274_set_frame_interval()
1372 ret = __imx274_set_frame_interval(imx274, fi->interval); in imx274_set_frame_interval()
1375 fi->interval = imx274->frame_interval; in imx274_set_frame_interval()
1382 max = fi->interval.numerator * 1000000 in imx274_set_frame_interval()
1383 / fi->interval.denominator; in imx274_set_frame_interval()
1387 dev_err(&imx274->client->dev, in imx274_set_frame_interval()
1393 imx274_set_exposure(imx274, ctrl->val); in imx274_set_frame_interval()
1395 dev_dbg(&imx274->client->dev, "set frame interval to %uus\n", in imx274_set_frame_interval()
1396 fi->interval.numerator * 1000000 in imx274_set_frame_interval()
1397 / fi->interval.denominator); in imx274_set_frame_interval()
1401 mutex_unlock(&imx274->lock); in imx274_set_frame_interval()
1402 pm_runtime_put(&imx274->client->dev); in imx274_set_frame_interval()
1408 * imx274_load_default - load default control values
1416 priv->frame_interval.numerator = 1; in imx274_load_default()
1417 priv->frame_interval.denominator = IMX274_DEF_FRAME_RATE; in imx274_load_default()
1418 priv->ctrls.exposure->val = 1000000 / IMX274_DEF_FRAME_RATE; in imx274_load_default()
1419 priv->ctrls.gain->val = IMX274_DEF_GAIN; in imx274_load_default()
1420 priv->ctrls.vflip->val = 0; in imx274_load_default()
1421 priv->ctrls.test_pattern->val = TEST_PATTERN_DISABLED; in imx274_load_default()
1425 * imx274_s_stream - It is used to start/stop the streaming.
1439 dev_dbg(&imx274->client->dev, "%s : %s, mode index = %td\n", __func__, in imx274_s_stream()
1441 imx274->mode - &imx274_modes[0]); in imx274_s_stream()
1443 mutex_lock(&imx274->lock); in imx274_s_stream()
1446 ret = pm_runtime_resume_and_get(&imx274->client->dev); in imx274_s_stream()
1448 mutex_unlock(&imx274->lock); in imx274_s_stream()
1468 imx274->frame_interval); in imx274_s_stream()
1482 pm_runtime_put(&imx274->client->dev); in imx274_s_stream()
1485 mutex_unlock(&imx274->lock); in imx274_s_stream()
1486 dev_dbg(&imx274->client->dev, "%s : Done\n", __func__); in imx274_s_stream()
1490 pm_runtime_put(&imx274->client->dev); in imx274_s_stream()
1491 mutex_unlock(&imx274->lock); in imx274_s_stream()
1492 dev_err(&imx274->client->dev, "s_stream failed\n"); in imx274_s_stream()
1497 * imx274_get_frame_length - Function for obtaining current frame length
1524 dev_err(&priv->client->dev, "%s error = %d\n", __func__, err); in imx274_get_frame_length()
1537 if (*frame_length < priv->mode->min_frame_len) in imx274_clamp_coarse_time()
1538 *frame_length = priv->mode->min_frame_len; in imx274_clamp_coarse_time()
1540 *val = *frame_length - *val; /* convert to raw shr */ in imx274_clamp_coarse_time()
1541 if (*val > *frame_length - IMX274_SHR_LIMIT_CONST) in imx274_clamp_coarse_time()
1542 *val = *frame_length - IMX274_SHR_LIMIT_CONST; in imx274_clamp_coarse_time()
1543 else if (*val < priv->mode->min_SHR) in imx274_clamp_coarse_time()
1544 *val = priv->mode->min_SHR; in imx274_clamp_coarse_time()
1550 * imx274_set_digital gain - Function called when setting digital gain
1565 reg_val--; in imx274_set_digital_gain()
1574 * imx274_set_gain - Function called when setting gain
1580 * The caller should hold the mutex lock imx274->lock if necessary
1589 gain = (u32)(ctrl->val); in imx274_set_gain()
1591 dev_dbg(&priv->client->dev, in imx274_set_gain()
1612 dev_dbg(&priv->client->dev, in imx274_set_gain()
1623 gain_reg = (u32)IMX274_GAIN_CONST - in imx274_set_gain()
1633 if (IMX274_GAIN_CONST - gain_reg == 0) { in imx274_set_gain()
1634 err = -EINVAL; in imx274_set_gain()
1639 ctrl->val = (IMX274_GAIN_CONST << IMX274_GAIN_SHIFT) in imx274_set_gain()
1640 / (IMX274_GAIN_CONST - gain_reg) * digital_gain; in imx274_set_gain()
1642 dev_dbg(&priv->client->dev, in imx274_set_gain()
1644 __func__, gain_reg, ctrl->val); in imx274_set_gain()
1649 dev_err(&priv->client->dev, "%s error = %d\n", __func__, err); in imx274_set_gain()
1654 * imx274_set_coarse_time - Function called when setting SHR value
1678 *val = frame_length - coarse_time; in imx274_set_coarse_time()
1682 dev_err(&priv->client->dev, "%s error = %d\n", __func__, err); in imx274_set_coarse_time()
1687 * imx274_set_exposure - Function called when setting exposure time
1689 * @val: Variable for exposure time, in the unit of micro-second
1692 * The caller should hold the mutex lock imx274->lock if necessary
1702 dev_dbg(&priv->client->dev, in imx274_set_exposure()
1712 err = -EINVAL; in imx274_set_exposure()
1717 - priv->mode->nocpiop) / hmax; in imx274_set_exposure()
1726 priv->ctrls.exposure->val = in imx274_set_exposure()
1727 (coarse_time * hmax + priv->mode->nocpiop) in imx274_set_exposure()
1730 dev_dbg(&priv->client->dev, in imx274_set_exposure()
1735 dev_err(&priv->client->dev, "%s error = %d\n", __func__, err); in imx274_set_exposure()
1741 * imx274_set_vflip - Function called when setting vertical flip
1748 * The caller should hold the mutex lock imx274->lock if necessary
1758 dev_err(&priv->client->dev, "VFLIP control error\n"); in imx274_set_vflip()
1762 dev_dbg(&priv->client->dev, in imx274_set_vflip()
1769 * imx274_set_test_pattern - Function called when setting test pattern
1784 err = imx274_write_reg(priv, IMX274_TEST_PATTERN_REG, val - 1); in imx274_set_test_pattern()
1788 err = -EINVAL; in imx274_set_test_pattern()
1792 dev_dbg(&priv->client->dev, in imx274_set_test_pattern()
1795 dev_err(&priv->client->dev, "%s error = %d\n", __func__, err); in imx274_set_test_pattern()
1801 * imx274_set_frame_length - Function called when setting frame length
1814 dev_dbg(&priv->client->dev, "%s : input length = %d\n", in imx274_set_frame_length()
1826 dev_err(&priv->client->dev, "%s error = %d\n", __func__, err); in imx274_set_frame_length()
1831 * __imx274_set_frame_interval - Function called when setting frame interval
1836 * The caller should hold the mutex lock imx274->lock if necessary
1848 dev_dbg(&priv->client->dev, "%s: input frame interval = %d / %d", in __imx274_set_frame_interval()
1861 if (req_frame_rate > priv->mode->max_fps) { in __imx274_set_frame_interval()
1863 frame_interval.denominator = priv->mode->max_fps; in __imx274_set_frame_interval()
1878 dev_dbg(&priv->client->dev, in __imx274_set_frame_interval()
1885 dev_dbg(&priv->client->dev, in __imx274_set_frame_interval()
1889 err = -EINVAL; in __imx274_set_frame_interval()
1901 priv->frame_interval = frame_interval; in __imx274_set_frame_interval()
1905 dev_err(&priv->client->dev, "%s error = %d\n", __func__, err); in __imx274_set_frame_interval()
1913 if (code->index > 0) in imx274_enum_mbus_code()
1914 return -EINVAL; in imx274_enum_mbus_code()
1917 code->code = MEDIA_BUS_FMT_SRGGB10_1X10; in imx274_enum_mbus_code()
1969 return -EINVAL; in imx274_fwnode_parse()
1974 if (ret == -ENXIO) { in imx274_fwnode_parse()
1986 return -EINVAL; in imx274_fwnode_parse()
1996 struct device *dev = &client->dev; in imx274_probe()
2002 return -ENOMEM; in imx274_probe()
2004 mutex_init(&imx274->lock); in imx274_probe()
2010 imx274->inck = devm_clk_get_optional(dev, "inck"); in imx274_probe()
2011 if (IS_ERR(imx274->inck)) in imx274_probe()
2012 return PTR_ERR(imx274->inck); in imx274_probe()
2021 imx274->mode = &imx274_modes[0]; in imx274_probe()
2022 imx274->crop.width = IMX274_MAX_WIDTH; in imx274_probe()
2023 imx274->crop.height = IMX274_MAX_HEIGHT; in imx274_probe()
2024 imx274->format.width = imx274->crop.width / imx274->mode->wbin_ratio; in imx274_probe()
2025 imx274->format.height = imx274->crop.height / imx274->mode->hbin_ratio; in imx274_probe()
2026 imx274->format.field = V4L2_FIELD_NONE; in imx274_probe()
2027 imx274->format.code = MEDIA_BUS_FMT_SRGGB10_1X10; in imx274_probe()
2028 imx274->format.colorspace = V4L2_COLORSPACE_SRGB; in imx274_probe()
2029 imx274->frame_interval.numerator = 1; in imx274_probe()
2030 imx274->frame_interval.denominator = IMX274_DEF_FRAME_RATE; in imx274_probe()
2033 imx274->regmap = devm_regmap_init_i2c(client, &imx274_regmap_config); in imx274_probe()
2034 if (IS_ERR(imx274->regmap)) { in imx274_probe()
2036 "regmap init failed: %ld\n", PTR_ERR(imx274->regmap)); in imx274_probe()
2037 ret = -ENODEV; in imx274_probe()
2042 imx274->client = client; in imx274_probe()
2043 sd = &imx274->sd; in imx274_probe()
2045 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; in imx274_probe()
2048 imx274->pad.flags = MEDIA_PAD_FL_SOURCE; in imx274_probe()
2049 sd->entity.function = MEDIA_ENT_F_CAM_SENSOR; in imx274_probe()
2050 ret = media_entity_pads_init(&sd->entity, 1, &imx274->pad); in imx274_probe()
2058 imx274->reset_gpio = devm_gpiod_get_optional(dev, "reset", in imx274_probe()
2060 if (IS_ERR(imx274->reset_gpio)) { in imx274_probe()
2061 ret = dev_err_probe(dev, PTR_ERR(imx274->reset_gpio), in imx274_probe()
2074 ret = v4l2_ctrl_handler_init(&imx274->ctrls.handler, 4); in imx274_probe()
2080 imx274->ctrls.handler.lock = &imx274->lock; in imx274_probe()
2083 imx274->ctrls.test_pattern = v4l2_ctrl_new_std_menu_items( in imx274_probe()
2084 &imx274->ctrls.handler, &imx274_ctrl_ops, in imx274_probe()
2086 ARRAY_SIZE(tp_qmenu) - 1, 0, 0, tp_qmenu); in imx274_probe()
2088 imx274->ctrls.gain = v4l2_ctrl_new_std( in imx274_probe()
2089 &imx274->ctrls.handler, in imx274_probe()
2095 imx274->ctrls.exposure = v4l2_ctrl_new_std( in imx274_probe()
2096 &imx274->ctrls.handler, in imx274_probe()
2102 imx274->ctrls.vflip = v4l2_ctrl_new_std( in imx274_probe()
2103 &imx274->ctrls.handler, in imx274_probe()
2107 imx274->sd.ctrl_handler = &imx274->ctrls.handler; in imx274_probe()
2108 if (imx274->ctrls.handler.error) { in imx274_probe()
2109 ret = imx274->ctrls.handler.error; in imx274_probe()
2132 v4l2_ctrl_handler_free(&imx274->ctrls.handler); in imx274_probe()
2136 media_entity_cleanup(&sd->entity); in imx274_probe()
2138 mutex_destroy(&imx274->lock); in imx274_probe()
2147 pm_runtime_disable(&client->dev); in imx274_remove()
2148 if (!pm_runtime_status_suspended(&client->dev)) in imx274_remove()
2149 imx274_power_off(&client->dev); in imx274_remove()
2150 pm_runtime_set_suspended(&client->dev); in imx274_remove()
2153 v4l2_ctrl_handler_free(&imx274->ctrls.handler); in imx274_remove()
2155 media_entity_cleanup(&sd->entity); in imx274_remove()
2156 mutex_destroy(&imx274->lock); in imx274_remove()