Lines Matching +full:autosuspend +full:- +full:period
1 // SPDX-License-Identifier: GPL-2.0
13 * Copyright (C) 2019-2020 Raspberry Pi (Trading) Ltd
32 #include <media/v4l2-cci.h>
33 #include <media/v4l2-ctrls.h>
34 #include <media/v4l2-device.h>
35 #include <media/v4l2-fwnode.h>
36 #include <media/v4l2-mediabus.h>
93 #define IMX283_HMAX_MAX (BIT(16) - 1)
97 #define IMX283_VMAX_MAX (BIT(16) - 1)
105 * Gain [dB] = -20log{(2048 - value [10:0]) /2048}
212 * Minimum horizontal timing in pixel-units
225 /* minimum V-timing in lines */
228 /* default H-timing */
231 /* default V-timing */
238 * Per-mode vertical crop constants used to calculate values
333 /* Horizontal / Vertical 2/2-line binning */
337 /* Horizontal / Vertical 3/3-line binning */
350 * New modes should make sure the offset period is complied.
610 u64 link_frequency = link_frequencies[__ffs(imx283->link_freq_bitmap)]; in imx283_pixel_rate()
611 unsigned int bpp = mode->bpp; in imx283_pixel_rate()
629 * can easily overflow this calculation, so pre-divide to simplify. in imx283_internal_clock()
648 * can easily overflow this calculation, so pre-divide to simplify. in imx283_iclk_to_pix()
667 /* Number of clocks per internal offset period */ in imx283_exposure()
668 offset = mode->mode == IMX283_MODE_0 ? 209 : 157; in imx283_exposure()
669 numerator = (imx283->vmax * (svr + 1) - shr) * imx283->hmax + offset; in imx283_exposure()
671 do_div(numerator, imx283->hmax); in imx283_exposure()
681 u64 min_shr = mode->min_shr; in imx283_exposure_limits()
683 u64 max_shr = (svr + 1) * imx283->vmax - 4; in imx283_exposure_limits()
685 max_shr = min(max_shr, BIT(16) - 1); in imx283_exposure_limits()
702 /* Number of clocks per internal offset period */ in imx283_shr()
703 offset = mode->mode == IMX283_MODE_0 ? 209 : 157; in imx283_shr()
704 temp = ((u64)exposure * imx283->hmax - offset); in imx283_shr()
705 do_div(temp, imx283->hmax); in imx283_shr()
707 return (imx283->vmax * (svr + 1) - temp); in imx283_shr()
735 return -EINVAL; in imx283_update_test_pattern()
738 return cci_write(imx283->cci, IMX283_REG_TPG_CTRL, 0x00, NULL); in imx283_update_test_pattern()
740 ret = cci_write(imx283->cci, IMX283_REG_TPG_PAT, in imx283_update_test_pattern()
745 return cci_write(imx283->cci, IMX283_REG_TPG_CTRL, in imx283_update_test_pattern()
751 struct imx283 *imx283 = container_of(ctrl->handler, struct imx283, in imx283_set_ctrl()
761 state = v4l2_subdev_get_locked_active_state(&imx283->sd); in imx283_set_ctrl()
764 get_mode_table(fmt->code, &mode_list, &num_modes); in imx283_set_ctrl()
766 fmt->width, fmt->height); in imx283_set_ctrl()
772 if (ctrl->id == V4L2_CID_VBLANK) { in imx283_set_ctrl()
776 imx283->vmax = mode->height + ctrl->val; in imx283_set_ctrl()
781 current_exposure = imx283->exposure->val; in imx283_set_ctrl()
785 __v4l2_ctrl_modify_range(imx283->exposure, min_exposure, in imx283_set_ctrl()
793 if (!pm_runtime_get_if_active(imx283->dev)) in imx283_set_ctrl()
796 switch (ctrl->id) { in imx283_set_ctrl()
798 shr = imx283_shr(imx283, mode, ctrl->val); in imx283_set_ctrl()
799 dev_dbg(imx283->dev, "V4L2_CID_EXPOSURE : %d - SHR: %lld\n", in imx283_set_ctrl()
800 ctrl->val, shr); in imx283_set_ctrl()
801 ret = cci_write(imx283->cci, IMX283_REG_SHR, shr, NULL); in imx283_set_ctrl()
806 imx283->hmax = imx283_internal_clock(pixel_rate, mode->width + ctrl->val); in imx283_set_ctrl()
807 dev_dbg(imx283->dev, "V4L2_CID_HBLANK : %d HMAX : %u\n", in imx283_set_ctrl()
808 ctrl->val, imx283->hmax); in imx283_set_ctrl()
809 ret = cci_write(imx283->cci, IMX283_REG_HMAX, imx283->hmax, NULL); in imx283_set_ctrl()
813 imx283->vmax = mode->height + ctrl->val; in imx283_set_ctrl()
814 dev_dbg(imx283->dev, "V4L2_CID_VBLANK : %d VMAX : %u\n", in imx283_set_ctrl()
815 ctrl->val, imx283->vmax); in imx283_set_ctrl()
816 ret = cci_write(imx283->cci, IMX283_REG_VMAX, imx283->vmax, NULL); in imx283_set_ctrl()
820 ret = cci_write(imx283->cci, IMX283_REG_ANALOG_GAIN, ctrl->val, NULL); in imx283_set_ctrl()
824 ret = cci_write(imx283->cci, IMX283_REG_DIGITAL_GAIN, ctrl->val, NULL); in imx283_set_ctrl()
832 if (ctrl->val) { in imx283_set_ctrl()
833 cci_write(imx283->cci, IMX283_REG_HTRIMMING, in imx283_set_ctrl()
836 cci_write(imx283->cci, IMX283_REG_HTRIMMING, in imx283_set_ctrl()
842 ret = imx283_update_test_pattern(imx283, ctrl->val); in imx283_set_ctrl()
846 dev_err(imx283->dev, "ctrl(id:0x%x, val:0x%x) is not handled\n", in imx283_set_ctrl()
847 ctrl->id, ctrl->val); in imx283_set_ctrl()
851 pm_runtime_put(imx283->dev); in imx283_set_ctrl()
864 if (code->index >= ARRAY_SIZE(imx283_mbus_codes)) in imx283_enum_mbus_code()
865 return -EINVAL; in imx283_enum_mbus_code()
867 code->code = imx283_mbus_codes[code->index]; in imx283_enum_mbus_code()
879 get_mode_table(fse->code, &mode_list, &num_modes); in imx283_enum_frame_size()
881 if (fse->index >= num_modes) in imx283_enum_frame_size()
882 return -EINVAL; in imx283_enum_frame_size()
884 fse->min_width = mode_list[fse->index].width; in imx283_enum_frame_size()
885 fse->max_width = fse->min_width; in imx283_enum_frame_size()
886 fse->min_height = mode_list[fse->index].height; in imx283_enum_frame_size()
887 fse->max_height = fse->min_height; in imx283_enum_frame_size()
896 format->width = mode->width; in imx283_update_image_pad_format()
897 format->height = mode->height; in imx283_update_image_pad_format()
898 format->field = V4L2_FIELD_NONE; in imx283_update_image_pad_format()
899 format->colorspace = V4L2_COLORSPACE_RAW; in imx283_update_image_pad_format()
900 format->ycbcr_enc = V4L2_YCBCR_ENC_601; in imx283_update_image_pad_format()
901 format->quantization = V4L2_QUANTIZATION_FULL_RANGE; in imx283_update_image_pad_format()
902 format->xfer_func = V4L2_XFER_FUNC_NONE; in imx283_update_image_pad_format()
917 format->code = MEDIA_BUS_FMT_SRGGB12_1X12; in imx283_init_state()
922 *crop = mode->crop; in imx283_init_state()
934 imx283->hmax = imx283_internal_clock(pixel_rate, mode->default_hmax); in imx283_set_framing_limits()
935 imx283->vmax = mode->default_vmax; in imx283_set_framing_limits()
941 min_hblank = mode->min_hmax - mode->width; in imx283_set_framing_limits()
942 max_hblank = imx283_iclk_to_pix(pixel_rate, IMX283_HMAX_MAX) - mode->width; in imx283_set_framing_limits()
943 def_hblank = mode->default_hmax - mode->width; in imx283_set_framing_limits()
944 __v4l2_ctrl_modify_range(imx283->hblank, min_hblank, max_hblank, 1, in imx283_set_framing_limits()
946 __v4l2_ctrl_s_ctrl(imx283->hblank, def_hblank); in imx283_set_framing_limits()
949 __v4l2_ctrl_modify_range(imx283->vblank, mode->min_vmax - mode->height, in imx283_set_framing_limits()
950 IMX283_VMAX_MAX - mode->height, 1, in imx283_set_framing_limits()
951 mode->default_vmax - mode->height); in imx283_set_framing_limits()
952 __v4l2_ctrl_s_ctrl(imx283->vblank, mode->default_vmax - mode->height); in imx283_set_framing_limits()
965 get_mode_table(fmt->format.code, &mode_list, &num_modes); in imx283_set_pad_format()
968 fmt->format.width, fmt->format.height); in imx283_set_pad_format()
970 fmt->format.width = mode->width; in imx283_set_pad_format()
971 fmt->format.height = mode->height; in imx283_set_pad_format()
972 fmt->format.field = V4L2_FIELD_NONE; in imx283_set_pad_format()
973 fmt->format.colorspace = V4L2_COLORSPACE_RAW; in imx283_set_pad_format()
974 fmt->format.ycbcr_enc = V4L2_YCBCR_ENC_601; in imx283_set_pad_format()
975 fmt->format.quantization = V4L2_QUANTIZATION_FULL_RANGE; in imx283_set_pad_format()
976 fmt->format.xfer_func = V4L2_XFER_FUNC_NONE; in imx283_set_pad_format()
980 if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) in imx283_set_pad_format()
983 *format = fmt->format; in imx283_set_pad_format()
993 cci_write(imx283->cci, IMX283_REG_STANDBY, in imx283_standby_cancel()
997 cci_multi_reg_write(imx283->cci, imx283->freq->regs, in imx283_standby_cancel()
998 imx283->freq->reg_count, &ret); in imx283_standby_cancel()
1000 dev_dbg(imx283->dev, "Using clk freq %ld MHz", in imx283_standby_cancel()
1001 imx283->freq->mhz / HZ_PER_MHZ); in imx283_standby_cancel()
1004 cci_write(imx283->cci, IMX283_REG_PLSTMG08, IMX283_PLSTMG08_VAL, &ret); in imx283_standby_cancel()
1005 cci_write(imx283->cci, IMX283_REG_PLSTMG02, IMX283_PLSTMG02_VAL, &ret); in imx283_standby_cancel()
1008 cci_write(imx283->cci, IMX283_REG_STBPL, IMX283_STBPL_NORMAL, &ret); in imx283_standby_cancel()
1011 link_freq_idx = __ffs(imx283->link_freq_bitmap); in imx283_standby_cancel()
1012 cci_multi_reg_write(imx283->cci, link_freq_reglist[link_freq_idx].regs, in imx283_standby_cancel()
1016 /* 1st Stabilisation period of 1 ms or more */ in imx283_standby_cancel()
1020 cci_write(imx283->cci, IMX283_REG_STANDBY, IMX283_ACTIVE, &ret); in imx283_standby_cancel()
1022 /* 2nd Stabilisation period of 19ms or more */ in imx283_standby_cancel()
1025 cci_write(imx283->cci, IMX283_REG_CLAMP, IMX283_CLPSQRST, &ret); in imx283_standby_cancel()
1026 cci_write(imx283->cci, IMX283_REG_XMSTA, 0, &ret); in imx283_standby_cancel()
1027 cci_write(imx283->cci, IMX283_REG_SYNCDRV, IMX283_SYNCDRV_XHS_XVS, &ret); in imx283_standby_cancel()
1048 get_mode_table(fmt->code, &mode_list, &num_modes); in imx283_start_streaming()
1050 fmt->width, fmt->height); in imx283_start_streaming()
1054 dev_err(imx283->dev, "failed to cancel standby\n"); in imx283_start_streaming()
1062 readout = &imx283_readout_modes[mode->mode]; in imx283_start_streaming()
1063 cci_write(imx283->cci, IMX283_REG_MDSEL1, readout->mdsel1, &ret); in imx283_start_streaming()
1064 cci_write(imx283->cci, IMX283_REG_MDSEL2, readout->mdsel2, &ret); in imx283_start_streaming()
1065 cci_write(imx283->cci, IMX283_REG_MDSEL3, in imx283_start_streaming()
1066 readout->mdsel3 | IMX283_MDSEL3_VCROP_EN, &ret); in imx283_start_streaming()
1067 cci_write(imx283->cci, IMX283_REG_MDSEL4, in imx283_start_streaming()
1068 readout->mdsel4 | IMX283_MDSEL4_VCROP_EN, &ret); in imx283_start_streaming()
1071 if (mode->mode == IMX283_MODE_1S) { in imx283_start_streaming()
1072 cci_write(imx283->cci, IMX283_REG_MDSEL7, 0x01, &ret); in imx283_start_streaming()
1073 cci_write(imx283->cci, IMX283_REG_MDSEL18, 0x1098, &ret); in imx283_start_streaming()
1077 dev_err(imx283->dev, "failed to set readout\n"); in imx283_start_streaming()
1081 /* Initialise SVR. Unsupported for now - Always 0 */ in imx283_start_streaming()
1082 cci_write(imx283->cci, IMX283_REG_SVR, 0x00, &ret); in imx283_start_streaming()
1084 dev_dbg(imx283->dev, "Mode: Size %d x %d\n", mode->width, mode->height); in imx283_start_streaming()
1085 dev_dbg(imx283->dev, "Analogue Crop (in the mode) %d,%d %dx%d\n", in imx283_start_streaming()
1086 mode->crop.left, in imx283_start_streaming()
1087 mode->crop.top, in imx283_start_streaming()
1088 mode->crop.width, in imx283_start_streaming()
1089 mode->crop.height); in imx283_start_streaming()
1091 y_out_size = mode->crop.height / mode->vbin_ratio; in imx283_start_streaming()
1092 write_v_size = y_out_size + mode->vertical_ob; in imx283_start_streaming()
1097 v_pos = imx283->vflip->val ? in imx283_start_streaming()
1098 ((-mode->crop.top / mode->vbin_ratio) / 2) + mode->vst : in imx283_start_streaming()
1099 ((mode->crop.top / mode->vbin_ratio) / 2) + mode->vst; in imx283_start_streaming()
1100 v_widcut = ((mode->veff - y_out_size) / 2) + mode->vct; in imx283_start_streaming()
1102 cci_write(imx283->cci, IMX283_REG_Y_OUT_SIZE, y_out_size, &ret); in imx283_start_streaming()
1103 cci_write(imx283->cci, IMX283_REG_WRITE_VSIZE, write_v_size, &ret); in imx283_start_streaming()
1104 cci_write(imx283->cci, IMX283_REG_VWIDCUT, v_widcut, &ret); in imx283_start_streaming()
1105 cci_write(imx283->cci, IMX283_REG_VWINPOS, v_pos, &ret); in imx283_start_streaming()
1107 cci_write(imx283->cci, IMX283_REG_OB_SIZE_V, mode->vertical_ob, &ret); in imx283_start_streaming()
1109 /* TODO: Validate mode->crop is fully contained within imx283_native_area */ in imx283_start_streaming()
1110 cci_write(imx283->cci, IMX283_REG_HTRIMMING_START, mode->crop.left, &ret); in imx283_start_streaming()
1111 cci_write(imx283->cci, IMX283_REG_HTRIMMING_END, in imx283_start_streaming()
1112 mode->crop.left + mode->crop.width, &ret); in imx283_start_streaming()
1115 cci_write(imx283->cci, IMX283_REG_EBD_X_OUT_SIZE, 0, &ret); in imx283_start_streaming()
1118 ret = __v4l2_ctrl_handler_setup(imx283->sd.ctrl_handler); in imx283_start_streaming()
1131 return -EINVAL; in imx283_enable_streams()
1133 ret = pm_runtime_get_sync(imx283->dev); in imx283_enable_streams()
1135 pm_runtime_put_noidle(imx283->dev); in imx283_enable_streams()
1146 pm_runtime_mark_last_busy(imx283->dev); in imx283_enable_streams()
1147 pm_runtime_put_autosuspend(imx283->dev); in imx283_enable_streams()
1160 return -EINVAL; in imx283_disable_streams()
1162 ret = cci_write(imx283->cci, IMX283_REG_STANDBY, IMX283_STBLOGIC, NULL); in imx283_disable_streams()
1164 dev_err(imx283->dev, "Failed to stop stream\n"); in imx283_disable_streams()
1166 pm_runtime_mark_last_busy(imx283->dev); in imx283_disable_streams()
1167 pm_runtime_put_autosuspend(imx283->dev); in imx283_disable_streams()
1178 imx283->supplies); in imx283_power_on()
1180 dev_err(imx283->dev, "failed to enable regulators\n"); in imx283_power_on()
1184 ret = clk_prepare_enable(imx283->xclk); in imx283_power_on()
1186 dev_err(imx283->dev, "failed to enable clock\n"); in imx283_power_on()
1190 gpiod_set_value_cansleep(imx283->reset_gpio, 0); in imx283_power_on()
1198 regulator_bulk_disable(ARRAY_SIZE(imx283_supply_name), imx283->supplies); in imx283_power_on()
1204 gpiod_set_value_cansleep(imx283->reset_gpio, 1); in imx283_power_off()
1205 regulator_bulk_disable(ARRAY_SIZE(imx283_supply_name), imx283->supplies); in imx283_power_off()
1206 clk_disable_unprepare(imx283->xclk); in imx283_power_off()
1234 imx283->supplies[i].supply = imx283_supply_name[i]; in imx283_get_regulators()
1236 return devm_regulator_bulk_get(imx283->dev, in imx283_get_regulators()
1238 imx283->supplies); in imx283_get_regulators()
1247 ret = cci_read(imx283->cci, IMX283_REG_CHIP_ID, &val, NULL); in imx283_identify_module()
1249 dev_err(imx283->dev, "failed to read chip id %x, with error %d\n", in imx283_identify_module()
1255 dev_err(imx283->dev, "chip id mismatch: %x!=%llx\n", in imx283_identify_module()
1257 return -EIO; in imx283_identify_module()
1267 switch (sel->target) { in imx283_get_selection()
1269 sel->r = *v4l2_subdev_state_get_crop(sd_state, 0); in imx283_get_selection()
1274 sel->r = imx283_native_area; in imx283_get_selection()
1279 sel->r = imx283_active_area; in imx283_get_selection()
1282 return -EINVAL; in imx283_get_selection()
1320 ctrl_hdlr = &imx283->ctrl_handler; in imx283_init_controls()
1338 __fls(imx283->link_freq_bitmap), in imx283_init_controls()
1339 __ffs(imx283->link_freq_bitmap), in imx283_init_controls()
1342 link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY; in imx283_init_controls()
1345 imx283->vblank = v4l2_ctrl_new_std(ctrl_hdlr, &imx283_ctrl_ops, in imx283_init_controls()
1347 mode->min_vmax - mode->height, in imx283_init_controls()
1349 mode->default_vmax - mode->height); in imx283_init_controls()
1351 min_hblank = mode->min_hmax - mode->width; in imx283_init_controls()
1352 max_hblank = imx283_iclk_to_pix(pixel_rate, IMX283_HMAX_MAX) - mode->width; in imx283_init_controls()
1353 def_hblank = mode->default_hmax - mode->width; in imx283_init_controls()
1354 imx283->hblank = v4l2_ctrl_new_std(ctrl_hdlr, &imx283_ctrl_ops, in imx283_init_controls()
1358 imx283->exposure = v4l2_ctrl_new_std(ctrl_hdlr, &imx283_ctrl_ops, in imx283_init_controls()
1373 imx283->vflip = v4l2_ctrl_new_std(ctrl_hdlr, &imx283_ctrl_ops, V4L2_CID_VFLIP, in imx283_init_controls()
1375 if (imx283->vflip) in imx283_init_controls()
1376 imx283->vflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT; in imx283_init_controls()
1380 ARRAY_SIZE(imx283_tpg_menu) - 1, in imx283_init_controls()
1383 if (ctrl_hdlr->error) { in imx283_init_controls()
1384 ret = ctrl_hdlr->error; in imx283_init_controls()
1385 dev_err(imx283->dev, "control init failed (%d)\n", ret); in imx283_init_controls()
1389 ret = v4l2_fwnode_device_parse(imx283->dev, &props); in imx283_init_controls()
1398 imx283->sd.ctrl_handler = ctrl_hdlr; in imx283_init_controls()
1400 mutex_lock(imx283->ctrl_handler.lock); in imx283_init_controls()
1405 mutex_unlock(imx283->ctrl_handler.lock); in imx283_init_controls()
1424 fwnode = dev_fwnode(imx283->dev); in imx283_parse_endpoint()
1427 dev_err(imx283->dev, "Failed to get next endpoint\n"); in imx283_parse_endpoint()
1428 return -ENXIO; in imx283_parse_endpoint()
1437 dev_err(imx283->dev, in imx283_parse_endpoint()
1440 ret = -EINVAL; in imx283_parse_endpoint()
1444 ret = v4l2_link_freq_to_bitmap(imx283->dev, bus_cfg.link_frequencies, in imx283_parse_endpoint()
1447 &imx283->link_freq_bitmap); in imx283_parse_endpoint()
1462 imx283 = devm_kzalloc(&client->dev, sizeof(*imx283), GFP_KERNEL); in imx283_probe()
1464 return -ENOMEM; in imx283_probe()
1466 imx283->dev = &client->dev; in imx283_probe()
1468 v4l2_i2c_subdev_init(&imx283->sd, client, &imx283_subdev_ops); in imx283_probe()
1470 imx283->cci = devm_cci_regmap_init_i2c(client, 16); in imx283_probe()
1471 if (IS_ERR(imx283->cci)) { in imx283_probe()
1472 ret = PTR_ERR(imx283->cci); in imx283_probe()
1473 dev_err(imx283->dev, "failed to initialize CCI: %d\n", ret); in imx283_probe()
1478 imx283->xclk = devm_clk_get(imx283->dev, NULL); in imx283_probe()
1479 if (IS_ERR(imx283->xclk)) { in imx283_probe()
1480 return dev_err_probe(imx283->dev, PTR_ERR(imx283->xclk), in imx283_probe()
1484 xclk_freq = clk_get_rate(imx283->xclk); in imx283_probe()
1487 imx283->freq = &imx283_frequencies[i]; in imx283_probe()
1491 if (!imx283->freq) { in imx283_probe()
1492 dev_err(imx283->dev, "xclk frequency unsupported: %d Hz\n", xclk_freq); in imx283_probe()
1493 return -EINVAL; in imx283_probe()
1498 return dev_err_probe(imx283->dev, ret, in imx283_probe()
1504 dev_err(imx283->dev, "failed to parse endpoint configuration\n"); in imx283_probe()
1509 imx283->reset_gpio = devm_gpiod_get_optional(imx283->dev, "reset", in imx283_probe()
1511 if (IS_ERR(imx283->reset_gpio)) in imx283_probe()
1512 return dev_err_probe(imx283->dev, PTR_ERR(imx283->reset_gpio), in imx283_probe()
1528 * Enable runtime PM with autosuspend. As the device has been powered in imx283_probe()
1532 pm_runtime_set_active(imx283->dev); in imx283_probe()
1533 pm_runtime_get_noresume(imx283->dev); in imx283_probe()
1534 pm_runtime_enable(imx283->dev); in imx283_probe()
1535 pm_runtime_set_autosuspend_delay(imx283->dev, 1000); in imx283_probe()
1536 pm_runtime_use_autosuspend(imx283->dev); in imx283_probe()
1544 imx283->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; in imx283_probe()
1545 imx283->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; in imx283_probe()
1546 imx283->sd.internal_ops = &imx283_internal_ops; in imx283_probe()
1549 imx283->pad.flags = MEDIA_PAD_FL_SOURCE; in imx283_probe()
1551 ret = media_entity_pads_init(&imx283->sd.entity, 1, &imx283->pad); in imx283_probe()
1553 dev_err(imx283->dev, "failed to init entity pads: %d\n", ret); in imx283_probe()
1557 imx283->sd.state_lock = imx283->ctrl_handler.lock; in imx283_probe()
1558 ret = v4l2_subdev_init_finalize(&imx283->sd); in imx283_probe()
1560 dev_err(imx283->dev, "subdev init error: %d\n", ret); in imx283_probe()
1564 ret = v4l2_async_register_subdev_sensor(&imx283->sd); in imx283_probe()
1566 dev_err(imx283->dev, "failed to register sensor sub-device: %d\n", ret); in imx283_probe()
1572 * autosuspend delay, turning the power off. in imx283_probe()
1574 pm_runtime_mark_last_busy(imx283->dev); in imx283_probe()
1575 pm_runtime_put_autosuspend(imx283->dev); in imx283_probe()
1580 v4l2_subdev_cleanup(&imx283->sd); in imx283_probe()
1583 media_entity_cleanup(&imx283->sd.entity); in imx283_probe()
1586 v4l2_ctrl_handler_free(imx283->sd.ctrl_handler); in imx283_probe()
1589 pm_runtime_disable(imx283->dev); in imx283_probe()
1590 pm_runtime_set_suspended(imx283->dev); in imx283_probe()
1603 v4l2_subdev_cleanup(&imx283->sd); in imx283_remove()
1604 media_entity_cleanup(&sd->entity); in imx283_remove()
1605 v4l2_ctrl_handler_free(imx283->sd.ctrl_handler); in imx283_remove()
1607 pm_runtime_disable(imx283->dev); in imx283_remove()
1608 if (!pm_runtime_status_suspended(imx283->dev)) in imx283_remove()
1610 pm_runtime_set_suspended(imx283->dev); in imx283_remove()