Lines Matching +full:sd +full:- +full:lines
1 // SPDX-License-Identifier: GPL-2.0-only
16 #include <media/v4l2-ctrls.h>
17 #include <media/v4l2-event.h>
18 #include <media/v4l2-fwnode.h>
19 #include <media/v4l2-subdev.h>
33 /* Lines per frame */
104 * struct ov9282_reg - ov9282 sensor register
114 * struct ov9282_reg_list - ov9282 sensor register list
124 * struct ov9282_mode - ov9282 sensor mode structure
127 * @hblank_min: Minimum horizontal blanking in lines for non-continuous[0] and
129 * @vblank: Vertical blanking in lines
130 * @vblank_min: Minimum vertical blanking in lines
131 * @vblank_max: Maximum vertical blanking in lines
133 * @crop: on-sensor cropping for this mode
149 * struct ov9282 - ov9282 sensor device structure
151 * @sd: V4L2 sub-device
163 * @vblank: Vertical blanking in lines
172 struct v4l2_subdev sd; member
404 * Note that this mode takes the top 720 lines from the
439 * to_ov9282() - ov9282 V4L2 sub-device to ov9282 device.
440 * @subdev: pointer to ov9282 V4L2 sub-device
446 return container_of(subdev, struct ov9282, sd); in to_ov9282()
450 * ov9282_read_reg() - Read registers.
460 struct i2c_client *client = v4l2_get_subdevdata(&ov9282->sd); in ov9282_read_reg()
467 return -EINVAL; in ov9282_read_reg()
472 msgs[0].addr = client->addr; in ov9282_read_reg()
478 msgs[1].addr = client->addr; in ov9282_read_reg()
481 msgs[1].buf = &data_buf[4 - len]; in ov9282_read_reg()
483 ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); in ov9282_read_reg()
485 return -EIO; in ov9282_read_reg()
493 * ov9282_write_reg() - Write register
503 struct i2c_client *client = v4l2_get_subdevdata(&ov9282->sd); in ov9282_write_reg()
507 return -EINVAL; in ov9282_write_reg()
510 put_unaligned_be32(val << (8 * (4 - len)), buf + 2); in ov9282_write_reg()
512 return -EIO; in ov9282_write_reg()
518 * ov9282_write_regs() - Write a list of registers
541 * ov9282_update_controls() - Update control ranges based on streaming mode
556 ret = __v4l2_ctrl_s_ctrl(ov9282->link_freq_ctrl, mode->link_freq_idx); in ov9282_update_controls()
560 pixel_rate = (fmt->format.code == MEDIA_BUS_FMT_Y10_1X10) ? in ov9282_update_controls()
562 ret = __v4l2_ctrl_modify_range(ov9282->pixel_rate, pixel_rate, in ov9282_update_controls()
567 hblank_min = mode->hblank_min[ov9282->noncontinuous_clock ? 0 : 1]; in ov9282_update_controls()
568 ret = __v4l2_ctrl_modify_range(ov9282->hblank_ctrl, hblank_min, in ov9282_update_controls()
569 OV9282_TIMING_HTS_MAX - mode->width, 1, in ov9282_update_controls()
574 return __v4l2_ctrl_modify_range(ov9282->vblank_ctrl, mode->vblank_min, in ov9282_update_controls()
575 mode->vblank_max, 1, mode->vblank); in ov9282_update_controls()
579 * ov9282_update_exp_gain() - Set updated exposure and gain
590 dev_dbg(ov9282->dev, "Set exp %u, analog gain %u", in ov9282_update_exp_gain()
644 * ov9282_set_ctrl() - Set subdevice control
648 * - V4L2_CID_VBLANK
649 * - cluster controls:
650 * - V4L2_CID_ANALOGUE_GAIN
651 * - V4L2_CID_EXPOSURE
658 container_of(ctrl->handler, struct ov9282, ctrl_handler); in ov9282_set_ctrl()
664 switch (ctrl->id) { in ov9282_set_ctrl()
666 ov9282->vblank = ov9282->vblank_ctrl->val; in ov9282_set_ctrl()
668 dev_dbg(ov9282->dev, "Received vblank %u, new lpfr %u", in ov9282_set_ctrl()
669 ov9282->vblank, in ov9282_set_ctrl()
670 ov9282->vblank + ov9282->cur_mode->height); in ov9282_set_ctrl()
672 ret = __v4l2_ctrl_modify_range(ov9282->exp_ctrl, in ov9282_set_ctrl()
674 ov9282->vblank + in ov9282_set_ctrl()
675 ov9282->cur_mode->height - in ov9282_set_ctrl()
682 if (!pm_runtime_get_if_in_use(ov9282->dev)) in ov9282_set_ctrl()
685 switch (ctrl->id) { in ov9282_set_ctrl()
687 exposure = ctrl->val; in ov9282_set_ctrl()
688 analog_gain = ov9282->again_ctrl->val; in ov9282_set_ctrl()
690 dev_dbg(ov9282->dev, "Received exp %u, analog gain %u", in ov9282_set_ctrl()
696 lpfr = ov9282->vblank + ov9282->cur_mode->height; in ov9282_set_ctrl()
700 ret = ov9282_set_ctrl_hflip(ov9282, ctrl->val); in ov9282_set_ctrl()
703 ret = ov9282_set_ctrl_vflip(ov9282, ctrl->val); in ov9282_set_ctrl()
707 (ctrl->val + ov9282->cur_mode->width) >> 1); in ov9282_set_ctrl()
710 dev_err(ov9282->dev, "Invalid control %d", ctrl->id); in ov9282_set_ctrl()
711 ret = -EINVAL; in ov9282_set_ctrl()
714 pm_runtime_put(ov9282->dev); in ov9282_set_ctrl()
725 * ov9282_enum_mbus_code() - Enumerate V4L2 sub-device mbus codes
726 * @sd: pointer to ov9282 V4L2 sub-device structure
727 * @sd_state: V4L2 sub-device configuration
728 * @code: V4L2 sub-device code enumeration need to be filled
732 static int ov9282_enum_mbus_code(struct v4l2_subdev *sd, in ov9282_enum_mbus_code() argument
736 switch (code->index) { in ov9282_enum_mbus_code()
738 code->code = MEDIA_BUS_FMT_Y10_1X10; in ov9282_enum_mbus_code()
741 code->code = MEDIA_BUS_FMT_Y8_1X8; in ov9282_enum_mbus_code()
744 return -EINVAL; in ov9282_enum_mbus_code()
751 * ov9282_enum_frame_size() - Enumerate V4L2 sub-device frame sizes
752 * @sd: pointer to ov9282 V4L2 sub-device structure
753 * @sd_state: V4L2 sub-device configuration
754 * @fsize: V4L2 sub-device size enumeration need to be filled
758 static int ov9282_enum_frame_size(struct v4l2_subdev *sd, in ov9282_enum_frame_size() argument
762 if (fsize->index >= ARRAY_SIZE(supported_modes)) in ov9282_enum_frame_size()
763 return -EINVAL; in ov9282_enum_frame_size()
765 if (fsize->code != MEDIA_BUS_FMT_Y10_1X10 && in ov9282_enum_frame_size()
766 fsize->code != MEDIA_BUS_FMT_Y8_1X8) in ov9282_enum_frame_size()
767 return -EINVAL; in ov9282_enum_frame_size()
769 fsize->min_width = supported_modes[fsize->index].width; in ov9282_enum_frame_size()
770 fsize->max_width = fsize->min_width; in ov9282_enum_frame_size()
771 fsize->min_height = supported_modes[fsize->index].height; in ov9282_enum_frame_size()
772 fsize->max_height = fsize->min_height; in ov9282_enum_frame_size()
778 * ov9282_fill_pad_format() - Fill subdevice pad format
783 * @fmt: V4L2 sub-device format need to be filled
790 fmt->format.width = mode->width; in ov9282_fill_pad_format()
791 fmt->format.height = mode->height; in ov9282_fill_pad_format()
792 fmt->format.code = code; in ov9282_fill_pad_format()
793 fmt->format.field = V4L2_FIELD_NONE; in ov9282_fill_pad_format()
794 fmt->format.colorspace = V4L2_COLORSPACE_RAW; in ov9282_fill_pad_format()
795 fmt->format.ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT; in ov9282_fill_pad_format()
796 fmt->format.quantization = V4L2_QUANTIZATION_DEFAULT; in ov9282_fill_pad_format()
797 fmt->format.xfer_func = V4L2_XFER_FUNC_NONE; in ov9282_fill_pad_format()
801 * ov9282_get_pad_format() - Get subdevice pad format
802 * @sd: pointer to ov9282 V4L2 sub-device structure
803 * @sd_state: V4L2 sub-device configuration
804 * @fmt: V4L2 sub-device format need to be set
808 static int ov9282_get_pad_format(struct v4l2_subdev *sd, in ov9282_get_pad_format() argument
812 struct ov9282 *ov9282 = to_ov9282(sd); in ov9282_get_pad_format()
814 mutex_lock(&ov9282->mutex); in ov9282_get_pad_format()
816 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { in ov9282_get_pad_format()
819 framefmt = v4l2_subdev_get_try_format(sd, sd_state, fmt->pad); in ov9282_get_pad_format()
820 fmt->format = *framefmt; in ov9282_get_pad_format()
822 ov9282_fill_pad_format(ov9282, ov9282->cur_mode, ov9282->code, in ov9282_get_pad_format()
826 mutex_unlock(&ov9282->mutex); in ov9282_get_pad_format()
832 * ov9282_set_pad_format() - Set subdevice pad format
833 * @sd: pointer to ov9282 V4L2 sub-device structure
834 * @sd_state: V4L2 sub-device configuration
835 * @fmt: V4L2 sub-device format need to be set
839 static int ov9282_set_pad_format(struct v4l2_subdev *sd, in ov9282_set_pad_format() argument
843 struct ov9282 *ov9282 = to_ov9282(sd); in ov9282_set_pad_format()
848 mutex_lock(&ov9282->mutex); in ov9282_set_pad_format()
853 fmt->format.width, in ov9282_set_pad_format()
854 fmt->format.height); in ov9282_set_pad_format()
855 if (fmt->format.code == MEDIA_BUS_FMT_Y8_1X8) in ov9282_set_pad_format()
862 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { in ov9282_set_pad_format()
865 framefmt = v4l2_subdev_get_try_format(sd, sd_state, fmt->pad); in ov9282_set_pad_format()
866 *framefmt = fmt->format; in ov9282_set_pad_format()
870 ov9282->cur_mode = mode; in ov9282_set_pad_format()
871 ov9282->code = code; in ov9282_set_pad_format()
875 mutex_unlock(&ov9282->mutex); in ov9282_set_pad_format()
881 * ov9282_init_pad_cfg() - Initialize sub-device pad configuration
882 * @sd: pointer to ov9282 V4L2 sub-device structure
883 * @sd_state: V4L2 sub-device configuration
887 static int ov9282_init_pad_cfg(struct v4l2_subdev *sd, in ov9282_init_pad_cfg() argument
890 struct ov9282 *ov9282 = to_ov9282(sd); in ov9282_init_pad_cfg()
895 ov9282->code, &fmt); in ov9282_init_pad_cfg()
897 return ov9282_set_pad_format(sd, sd_state, &fmt); in ov9282_init_pad_cfg()
907 return v4l2_subdev_get_try_crop(&ov9282->sd, sd_state, pad); in __ov9282_get_pad_crop()
909 return &ov9282->cur_mode->crop; in __ov9282_get_pad_crop()
915 static int ov9282_get_selection(struct v4l2_subdev *sd, in ov9282_get_selection() argument
919 switch (sel->target) { in ov9282_get_selection()
921 struct ov9282 *ov9282 = to_ov9282(sd); in ov9282_get_selection()
923 mutex_lock(&ov9282->mutex); in ov9282_get_selection()
924 sel->r = *__ov9282_get_pad_crop(ov9282, sd_state, sel->pad, in ov9282_get_selection()
925 sel->which); in ov9282_get_selection()
926 mutex_unlock(&ov9282->mutex); in ov9282_get_selection()
932 sel->r.top = 0; in ov9282_get_selection()
933 sel->r.left = 0; in ov9282_get_selection()
934 sel->r.width = OV9282_NATIVE_WIDTH; in ov9282_get_selection()
935 sel->r.height = OV9282_NATIVE_HEIGHT; in ov9282_get_selection()
941 sel->r.top = OV9282_PIXEL_ARRAY_TOP; in ov9282_get_selection()
942 sel->r.left = OV9282_PIXEL_ARRAY_LEFT; in ov9282_get_selection()
943 sel->r.width = OV9282_PIXEL_ARRAY_WIDTH; in ov9282_get_selection()
944 sel->r.height = OV9282_PIXEL_ARRAY_HEIGHT; in ov9282_get_selection()
949 return -EINVAL; in ov9282_get_selection()
953 * ov9282_start_streaming() - Start sensor stream
977 dev_err(ov9282->dev, "fail to write common registers"); in ov9282_start_streaming()
981 bitdepth_index = ov9282->code == MEDIA_BUS_FMT_Y10_1X10 ? 0 : 1; in ov9282_start_streaming()
984 dev_err(ov9282->dev, "fail to write bitdepth regs"); in ov9282_start_streaming()
989 reg_list = &ov9282->cur_mode->reg_list; in ov9282_start_streaming()
990 ret = ov9282_write_regs(ov9282, reg_list->regs, reg_list->num_of_regs); in ov9282_start_streaming()
992 dev_err(ov9282->dev, "fail to write initial registers"); in ov9282_start_streaming()
997 ret = __v4l2_ctrl_handler_setup(ov9282->sd.ctrl_handler); in ov9282_start_streaming()
999 dev_err(ov9282->dev, "fail to setup handler"); in ov9282_start_streaming()
1007 dev_err(ov9282->dev, "fail to start streaming"); in ov9282_start_streaming()
1015 * ov9282_stop_streaming() - Stop sensor stream
1027 * ov9282_set_stream() - Enable sensor streaming
1028 * @sd: pointer to ov9282 subdevice
1033 static int ov9282_set_stream(struct v4l2_subdev *sd, int enable) in ov9282_set_stream() argument
1035 struct ov9282 *ov9282 = to_ov9282(sd); in ov9282_set_stream()
1038 mutex_lock(&ov9282->mutex); in ov9282_set_stream()
1040 if (ov9282->streaming == enable) { in ov9282_set_stream()
1041 mutex_unlock(&ov9282->mutex); in ov9282_set_stream()
1046 ret = pm_runtime_resume_and_get(ov9282->dev); in ov9282_set_stream()
1055 pm_runtime_put(ov9282->dev); in ov9282_set_stream()
1058 ov9282->streaming = enable; in ov9282_set_stream()
1060 mutex_unlock(&ov9282->mutex); in ov9282_set_stream()
1065 pm_runtime_put(ov9282->dev); in ov9282_set_stream()
1067 mutex_unlock(&ov9282->mutex); in ov9282_set_stream()
1073 * ov9282_detect() - Detect ov9282 sensor
1076 * Return: 0 if successful, -EIO if sensor id does not match
1088 dev_err(ov9282->dev, "chip id mismatch: %x!=%x", in ov9282_detect()
1090 return -ENXIO; in ov9282_detect()
1101 ov9282->supplies[i].supply = ov9282_supply_names[i]; in ov9282_configure_regulators()
1103 return devm_regulator_bulk_get(ov9282->dev, in ov9282_configure_regulators()
1105 ov9282->supplies); in ov9282_configure_regulators()
1109 * ov9282_parse_hw_config() - Parse HW configuration and check if supported
1116 struct fwnode_handle *fwnode = dev_fwnode(ov9282->dev); in ov9282_parse_hw_config()
1126 return -ENXIO; in ov9282_parse_hw_config()
1129 ov9282->reset_gpio = devm_gpiod_get_optional(ov9282->dev, "reset", in ov9282_parse_hw_config()
1131 if (IS_ERR(ov9282->reset_gpio)) { in ov9282_parse_hw_config()
1132 dev_err(ov9282->dev, "failed to get reset gpio %ld", in ov9282_parse_hw_config()
1133 PTR_ERR(ov9282->reset_gpio)); in ov9282_parse_hw_config()
1134 return PTR_ERR(ov9282->reset_gpio); in ov9282_parse_hw_config()
1138 ov9282->inclk = devm_clk_get(ov9282->dev, NULL); in ov9282_parse_hw_config()
1139 if (IS_ERR(ov9282->inclk)) { in ov9282_parse_hw_config()
1140 dev_err(ov9282->dev, "could not get inclk"); in ov9282_parse_hw_config()
1141 return PTR_ERR(ov9282->inclk); in ov9282_parse_hw_config()
1146 return dev_err_probe(ov9282->dev, ret, in ov9282_parse_hw_config()
1149 rate = clk_get_rate(ov9282->inclk); in ov9282_parse_hw_config()
1151 dev_err(ov9282->dev, "inclk frequency mismatch"); in ov9282_parse_hw_config()
1152 return -EINVAL; in ov9282_parse_hw_config()
1157 return -ENXIO; in ov9282_parse_hw_config()
1164 ov9282->noncontinuous_clock = in ov9282_parse_hw_config()
1168 dev_err(ov9282->dev, in ov9282_parse_hw_config()
1171 ret = -EINVAL; in ov9282_parse_hw_config()
1176 dev_err(ov9282->dev, "no link frequencies defined"); in ov9282_parse_hw_config()
1177 ret = -EINVAL; in ov9282_parse_hw_config()
1185 ret = -EINVAL; in ov9282_parse_hw_config()
1219 * ov9282_power_on() - Sensor power on sequence
1226 struct v4l2_subdev *sd = dev_get_drvdata(dev); in ov9282_power_on() local
1227 struct ov9282 *ov9282 = to_ov9282(sd); in ov9282_power_on()
1230 ret = regulator_bulk_enable(OV9282_NUM_SUPPLIES, ov9282->supplies); in ov9282_power_on()
1238 gpiod_set_value_cansleep(ov9282->reset_gpio, 1); in ov9282_power_on()
1240 ret = clk_prepare_enable(ov9282->inclk); in ov9282_power_on()
1242 dev_err(ov9282->dev, "fail to enable inclk"); in ov9282_power_on()
1249 ov9282->noncontinuous_clock ? in ov9282_power_on()
1252 dev_err(ov9282->dev, "fail to write MIPI_CTRL00"); in ov9282_power_on()
1259 clk_disable_unprepare(ov9282->inclk); in ov9282_power_on()
1261 gpiod_set_value_cansleep(ov9282->reset_gpio, 0); in ov9282_power_on()
1263 regulator_bulk_disable(OV9282_NUM_SUPPLIES, ov9282->supplies); in ov9282_power_on()
1269 * ov9282_power_off() - Sensor power off sequence
1276 struct v4l2_subdev *sd = dev_get_drvdata(dev); in ov9282_power_off() local
1277 struct ov9282 *ov9282 = to_ov9282(sd); in ov9282_power_off()
1279 gpiod_set_value_cansleep(ov9282->reset_gpio, 0); in ov9282_power_off()
1281 clk_disable_unprepare(ov9282->inclk); in ov9282_power_off()
1283 regulator_bulk_disable(OV9282_NUM_SUPPLIES, ov9282->supplies); in ov9282_power_off()
1289 * ov9282_init_controls() - Initialize sensor subdevice controls
1296 struct v4l2_ctrl_handler *ctrl_hdlr = &ov9282->ctrl_handler; in ov9282_init_controls()
1297 const struct ov9282_mode *mode = ov9282->cur_mode; in ov9282_init_controls()
1308 ctrl_hdlr->lock = &ov9282->mutex; in ov9282_init_controls()
1311 lpfr = mode->vblank + mode->height; in ov9282_init_controls()
1312 ov9282->exp_ctrl = v4l2_ctrl_new_std(ctrl_hdlr, in ov9282_init_controls()
1316 lpfr - OV9282_EXPOSURE_OFFSET, in ov9282_init_controls()
1320 ov9282->again_ctrl = v4l2_ctrl_new_std(ctrl_hdlr, in ov9282_init_controls()
1328 v4l2_ctrl_cluster(2, &ov9282->exp_ctrl); in ov9282_init_controls()
1330 ov9282->vblank_ctrl = v4l2_ctrl_new_std(ctrl_hdlr, in ov9282_init_controls()
1333 mode->vblank_min, in ov9282_init_controls()
1334 mode->vblank_max, in ov9282_init_controls()
1335 1, mode->vblank); in ov9282_init_controls()
1344 ov9282->pixel_rate = v4l2_ctrl_new_std(ctrl_hdlr, &ov9282_ctrl_ops, in ov9282_init_controls()
1350 ov9282->link_freq_ctrl = v4l2_ctrl_new_int_menu(ctrl_hdlr, in ov9282_init_controls()
1353 ARRAY_SIZE(link_freq) - in ov9282_init_controls()
1355 mode->link_freq_idx, in ov9282_init_controls()
1357 if (ov9282->link_freq_ctrl) in ov9282_init_controls()
1358 ov9282->link_freq_ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY; in ov9282_init_controls()
1360 hblank_min = mode->hblank_min[ov9282->noncontinuous_clock ? 0 : 1]; in ov9282_init_controls()
1361 ov9282->hblank_ctrl = v4l2_ctrl_new_std(ctrl_hdlr, in ov9282_init_controls()
1365 OV9282_TIMING_HTS_MAX - mode->width, in ov9282_init_controls()
1368 ret = v4l2_fwnode_device_parse(ov9282->dev, &props); in ov9282_init_controls()
1370 /* Failure sets ctrl_hdlr->error, which we check afterwards anyway */ in ov9282_init_controls()
1375 if (ctrl_hdlr->error || ret) { in ov9282_init_controls()
1376 dev_err(ov9282->dev, "control init failed: %d", in ov9282_init_controls()
1377 ctrl_hdlr->error); in ov9282_init_controls()
1379 return ctrl_hdlr->error; in ov9282_init_controls()
1382 ov9282->sd.ctrl_handler = ctrl_hdlr; in ov9282_init_controls()
1388 * ov9282_probe() - I2C client device binding
1398 ov9282 = devm_kzalloc(&client->dev, sizeof(*ov9282), GFP_KERNEL); in ov9282_probe()
1400 return -ENOMEM; in ov9282_probe()
1402 ov9282->dev = &client->dev; in ov9282_probe()
1405 v4l2_i2c_subdev_init(&ov9282->sd, client, &ov9282_subdev_ops); in ov9282_probe()
1406 v4l2_i2c_subdev_set_name(&ov9282->sd, client, in ov9282_probe()
1407 device_get_match_data(ov9282->dev), NULL); in ov9282_probe()
1411 dev_err(ov9282->dev, "HW configuration is not supported"); in ov9282_probe()
1415 mutex_init(&ov9282->mutex); in ov9282_probe()
1417 ret = ov9282_power_on(ov9282->dev); in ov9282_probe()
1419 dev_err(ov9282->dev, "failed to power-on the sensor"); in ov9282_probe()
1426 dev_err(ov9282->dev, "failed to find sensor: %d", ret); in ov9282_probe()
1431 ov9282->cur_mode = &supported_modes[DEFAULT_MODE]; in ov9282_probe()
1432 ov9282->code = MEDIA_BUS_FMT_Y10_1X10; in ov9282_probe()
1433 ov9282->vblank = ov9282->cur_mode->vblank; in ov9282_probe()
1437 dev_err(ov9282->dev, "failed to init controls: %d", ret); in ov9282_probe()
1442 ov9282->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | in ov9282_probe()
1444 ov9282->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; in ov9282_probe()
1447 ov9282->pad.flags = MEDIA_PAD_FL_SOURCE; in ov9282_probe()
1448 ret = media_entity_pads_init(&ov9282->sd.entity, 1, &ov9282->pad); in ov9282_probe()
1450 dev_err(ov9282->dev, "failed to init entity pads: %d", ret); in ov9282_probe()
1454 ret = v4l2_async_register_subdev_sensor(&ov9282->sd); in ov9282_probe()
1456 dev_err(ov9282->dev, in ov9282_probe()
1461 pm_runtime_set_active(ov9282->dev); in ov9282_probe()
1462 pm_runtime_enable(ov9282->dev); in ov9282_probe()
1463 pm_runtime_idle(ov9282->dev); in ov9282_probe()
1468 media_entity_cleanup(&ov9282->sd.entity); in ov9282_probe()
1470 v4l2_ctrl_handler_free(ov9282->sd.ctrl_handler); in ov9282_probe()
1472 ov9282_power_off(ov9282->dev); in ov9282_probe()
1474 mutex_destroy(&ov9282->mutex); in ov9282_probe()
1480 * ov9282_remove() - I2C client device unbinding
1487 struct v4l2_subdev *sd = i2c_get_clientdata(client); in ov9282_remove() local
1488 struct ov9282 *ov9282 = to_ov9282(sd); in ov9282_remove()
1490 v4l2_async_unregister_subdev(sd); in ov9282_remove()
1491 media_entity_cleanup(&sd->entity); in ov9282_remove()
1492 v4l2_ctrl_handler_free(sd->ctrl_handler); in ov9282_remove()
1494 pm_runtime_disable(&client->dev); in ov9282_remove()
1495 if (!pm_runtime_status_suspended(&client->dev)) in ov9282_remove()
1496 ov9282_power_off(&client->dev); in ov9282_remove()
1497 pm_runtime_set_suspended(&client->dev); in ov9282_remove()
1499 mutex_destroy(&ov9282->mutex); in ov9282_remove()