Lines Matching refs:ov7251

125 struct ov7251 {  struct
164 static inline struct ov7251 *to_ov7251(struct v4l2_subdev *sd) in to_ov7251() argument
166 return container_of(sd, struct ov7251, sd); in to_ov7251()
684 static int ov7251_regulators_enable(struct ov7251 *ov7251) in ov7251_regulators_enable() argument
692 ret = regulator_enable(ov7251->io_regulator); in ov7251_regulators_enable()
694 dev_err(ov7251->dev, "set io voltage failed\n"); in ov7251_regulators_enable()
698 ret = regulator_enable(ov7251->analog_regulator); in ov7251_regulators_enable()
700 dev_err(ov7251->dev, "set analog voltage failed\n"); in ov7251_regulators_enable()
704 ret = regulator_enable(ov7251->core_regulator); in ov7251_regulators_enable()
706 dev_err(ov7251->dev, "set core voltage failed\n"); in ov7251_regulators_enable()
713 regulator_disable(ov7251->analog_regulator); in ov7251_regulators_enable()
716 regulator_disable(ov7251->io_regulator); in ov7251_regulators_enable()
721 static void ov7251_regulators_disable(struct ov7251 *ov7251) in ov7251_regulators_disable() argument
725 ret = regulator_disable(ov7251->core_regulator); in ov7251_regulators_disable()
727 dev_err(ov7251->dev, "core regulator disable failed\n"); in ov7251_regulators_disable()
729 ret = regulator_disable(ov7251->analog_regulator); in ov7251_regulators_disable()
731 dev_err(ov7251->dev, "analog regulator disable failed\n"); in ov7251_regulators_disable()
733 ret = regulator_disable(ov7251->io_regulator); in ov7251_regulators_disable()
735 dev_err(ov7251->dev, "io regulator disable failed\n"); in ov7251_regulators_disable()
738 static int ov7251_write_reg(struct ov7251 *ov7251, u16 reg, u8 val) in ov7251_write_reg() argument
747 ret = i2c_master_send(ov7251->i2c_client, regbuf, 3); in ov7251_write_reg()
749 dev_err(ov7251->dev, "%s: write reg error %d: reg=%x, val=%x\n", in ov7251_write_reg()
757 static int ov7251_write_seq_regs(struct ov7251 *ov7251, u16 reg, u8 *val, in ov7251_write_seq_regs() argument
772 ret = i2c_master_send(ov7251->i2c_client, regbuf, nregbuf); in ov7251_write_seq_regs()
774 dev_err(ov7251->dev, in ov7251_write_seq_regs()
783 static int ov7251_read_reg(struct ov7251 *ov7251, u16 reg, u8 *val) in ov7251_read_reg() argument
791 ret = i2c_master_send(ov7251->i2c_client, regbuf, 2); in ov7251_read_reg()
793 dev_err(ov7251->dev, "%s: write reg error %d: reg=%x\n", in ov7251_read_reg()
798 ret = i2c_master_recv(ov7251->i2c_client, val, 1); in ov7251_read_reg()
800 dev_err(ov7251->dev, "%s: read reg error %d: reg=%x\n", in ov7251_read_reg()
808 static int ov7251_pll_configure(struct ov7251 *ov7251) in ov7251_pll_configure() argument
813 configs = ov7251->pll_cfgs; in ov7251_pll_configure()
815 ret = ov7251_write_reg(ov7251, OV7251_PLL1_PRE_DIV_REG, in ov7251_pll_configure()
816 configs->pll1[ov7251->link_freq_idx]->pre_div); in ov7251_pll_configure()
820 ret = ov7251_write_reg(ov7251, OV7251_PLL1_MULT_REG, in ov7251_pll_configure()
821 configs->pll1[ov7251->link_freq_idx]->mult); in ov7251_pll_configure()
824 ret = ov7251_write_reg(ov7251, OV7251_PLL1_DIVIDER_REG, in ov7251_pll_configure()
825 configs->pll1[ov7251->link_freq_idx]->div); in ov7251_pll_configure()
829 ret = ov7251_write_reg(ov7251, OV7251_PLL1_PIX_DIV_REG, in ov7251_pll_configure()
830 configs->pll1[ov7251->link_freq_idx]->pix_div); in ov7251_pll_configure()
834 ret = ov7251_write_reg(ov7251, OV7251_PLL1_MIPI_DIV_REG, in ov7251_pll_configure()
835 configs->pll1[ov7251->link_freq_idx]->mipi_div); in ov7251_pll_configure()
839 ret = ov7251_write_reg(ov7251, OV7251_PLL2_PRE_DIV_REG, in ov7251_pll_configure()
844 ret = ov7251_write_reg(ov7251, OV7251_PLL2_MULT_REG, in ov7251_pll_configure()
849 ret = ov7251_write_reg(ov7251, OV7251_PLL2_DIVIDER_REG, in ov7251_pll_configure()
854 ret = ov7251_write_reg(ov7251, OV7251_PLL2_SYS_DIV_REG, in ov7251_pll_configure()
859 ret = ov7251_write_reg(ov7251, OV7251_PLL2_ADC_DIV_REG, in ov7251_pll_configure()
865 static int ov7251_set_exposure(struct ov7251 *ov7251, s32 exposure) in ov7251_set_exposure() argument
875 return ov7251_write_seq_regs(ov7251, reg, val, 3); in ov7251_set_exposure()
878 static int ov7251_set_gain(struct ov7251 *ov7251, s32 gain) in ov7251_set_gain() argument
887 return ov7251_write_seq_regs(ov7251, reg, val, 2); in ov7251_set_gain()
890 static int ov7251_set_register_array(struct ov7251 *ov7251, in ov7251_set_register_array() argument
898 ret = ov7251_write_reg(ov7251, settings->reg, settings->val); in ov7251_set_register_array()
910 struct ov7251 *ov7251 = to_ov7251(sd); in ov7251_set_power_on() local
914 ret = ov7251_regulators_enable(ov7251); in ov7251_set_power_on()
918 ret = clk_prepare_enable(ov7251->xclk); in ov7251_set_power_on()
920 dev_err(ov7251->dev, "clk prepare enable failed\n"); in ov7251_set_power_on()
921 ov7251_regulators_disable(ov7251); in ov7251_set_power_on()
925 gpiod_set_value_cansleep(ov7251->enable_gpio, 1); in ov7251_set_power_on()
929 DIV_ROUND_UP(ov7251->xclk_freq, 1000)); in ov7251_set_power_on()
932 ret = ov7251_set_register_array(ov7251, in ov7251_set_power_on()
936 dev_err(ov7251->dev, "error during global init\n"); in ov7251_set_power_on()
937 gpiod_set_value_cansleep(ov7251->enable_gpio, 0); in ov7251_set_power_on()
938 clk_disable_unprepare(ov7251->xclk); in ov7251_set_power_on()
939 ov7251_regulators_disable(ov7251); in ov7251_set_power_on()
950 struct ov7251 *ov7251 = to_ov7251(sd); in ov7251_set_power_off() local
952 clk_disable_unprepare(ov7251->xclk); in ov7251_set_power_off()
953 gpiod_set_value_cansleep(ov7251->enable_gpio, 0); in ov7251_set_power_off()
954 ov7251_regulators_disable(ov7251); in ov7251_set_power_off()
959 static int ov7251_set_hflip(struct ov7251 *ov7251, s32 value) in ov7251_set_hflip() argument
961 u8 val = ov7251->timing_format2; in ov7251_set_hflip()
969 ret = ov7251_write_reg(ov7251, OV7251_TIMING_FORMAT2, val); in ov7251_set_hflip()
971 ov7251->timing_format2 = val; in ov7251_set_hflip()
976 static int ov7251_set_vflip(struct ov7251 *ov7251, s32 value) in ov7251_set_vflip() argument
978 u8 val = ov7251->timing_format1; in ov7251_set_vflip()
986 ret = ov7251_write_reg(ov7251, OV7251_TIMING_FORMAT1, val); in ov7251_set_vflip()
988 ov7251->timing_format1 = val; in ov7251_set_vflip()
993 static int ov7251_set_test_pattern(struct ov7251 *ov7251, s32 value) in ov7251_set_test_pattern() argument
995 u8 val = ov7251->pre_isp_00; in ov7251_set_test_pattern()
1003 ret = ov7251_write_reg(ov7251, OV7251_PRE_ISP_00, val); in ov7251_set_test_pattern()
1005 ov7251->pre_isp_00 = val; in ov7251_set_test_pattern()
1015 static int ov7251_vts_configure(struct ov7251 *ov7251, s32 vblank) in ov7251_vts_configure() argument
1019 vts[0] = ((ov7251->current_mode->height + vblank) & 0xff00) >> 8; in ov7251_vts_configure()
1020 vts[1] = ((ov7251->current_mode->height + vblank) & 0x00ff); in ov7251_vts_configure()
1022 return ov7251_write_seq_regs(ov7251, OV7251_TIMING_VTS_REG, vts, 2); in ov7251_vts_configure()
1027 struct ov7251 *ov7251 = container_of(ctrl->handler, in ov7251_s_ctrl() local
1028 struct ov7251, ctrls); in ov7251_s_ctrl()
1035 exposure_max = ov7251->current_mode->height + ctrl->val - in ov7251_s_ctrl()
1037 __v4l2_ctrl_modify_range(ov7251->exposure, in ov7251_s_ctrl()
1038 ov7251->exposure->minimum, in ov7251_s_ctrl()
1040 ov7251->exposure->step, in ov7251_s_ctrl()
1041 min(ov7251->exposure->val, in ov7251_s_ctrl()
1047 if (!pm_runtime_get_if_in_use(ov7251->dev)) in ov7251_s_ctrl()
1052 ret = ov7251_set_exposure(ov7251, ctrl->val); in ov7251_s_ctrl()
1055 ret = ov7251_set_gain(ov7251, ctrl->val); in ov7251_s_ctrl()
1058 ret = ov7251_set_test_pattern(ov7251, ctrl->val); in ov7251_s_ctrl()
1061 ret = ov7251_set_hflip(ov7251, ctrl->val); in ov7251_s_ctrl()
1064 ret = ov7251_set_vflip(ov7251, ctrl->val); in ov7251_s_ctrl()
1067 ret = ov7251_vts_configure(ov7251, ctrl->val); in ov7251_s_ctrl()
1074 pm_runtime_put(ov7251->dev); in ov7251_s_ctrl()
1135 __ov7251_get_pad_format(struct ov7251 *ov7251, in __ov7251_get_pad_format() argument
1144 return &ov7251->fmt; in __ov7251_get_pad_format()
1154 struct ov7251 *ov7251 = to_ov7251(sd); in ov7251_get_format() local
1156 mutex_lock(&ov7251->lock); in ov7251_get_format()
1157 format->format = *__ov7251_get_pad_format(ov7251, sd_state, in ov7251_get_format()
1160 mutex_unlock(&ov7251->lock); in ov7251_get_format()
1166 __ov7251_get_pad_crop(struct ov7251 *ov7251, in __ov7251_get_pad_crop() argument
1174 return &ov7251->crop; in __ov7251_get_pad_crop()
1186 ov7251_find_mode_by_ival(struct ov7251 *ov7251, struct v4l2_fract *timeperframe) in ov7251_find_mode_by_ival() argument
1188 const struct ov7251_mode_info *mode = ov7251->current_mode; in ov7251_find_mode_by_ival()
1218 struct ov7251 *ov7251 = to_ov7251(sd); in ov7251_set_format() local
1225 mutex_lock(&ov7251->lock); in ov7251_set_format()
1227 __crop = __ov7251_get_pad_crop(ov7251, sd_state, format->pad, in ov7251_set_format()
1239 ret = __v4l2_ctrl_modify_range(ov7251->exposure, in ov7251_set_format()
1245 ret = __v4l2_ctrl_s_ctrl(ov7251->exposure, in ov7251_set_format()
1250 ret = __v4l2_ctrl_s_ctrl(ov7251->gain, 16); in ov7251_set_format()
1256 ret = __v4l2_ctrl_modify_range(ov7251->vblank, in ov7251_set_format()
1262 ov7251->current_mode = new_mode; in ov7251_set_format()
1265 __format = __ov7251_get_pad_format(ov7251, sd_state, format->pad, in ov7251_set_format()
1280 mutex_unlock(&ov7251->lock); in ov7251_set_format()
1306 struct ov7251 *ov7251 = to_ov7251(sd); in ov7251_get_selection() local
1311 mutex_lock(&ov7251->lock); in ov7251_get_selection()
1312 sel->r = *__ov7251_get_pad_crop(ov7251, sd_state, sel->pad, in ov7251_get_selection()
1314 mutex_unlock(&ov7251->lock); in ov7251_get_selection()
1337 struct ov7251 *ov7251 = to_ov7251(subdev); in ov7251_s_stream() local
1340 mutex_lock(&ov7251->lock); in ov7251_s_stream()
1343 ret = pm_runtime_resume_and_get(ov7251->dev); in ov7251_s_stream()
1345 mutex_unlock(&ov7251->lock); in ov7251_s_stream()
1349 ret = ov7251_pll_configure(ov7251); in ov7251_s_stream()
1351 dev_err(ov7251->dev, "error configuring PLLs\n"); in ov7251_s_stream()
1355 ret = ov7251_set_register_array(ov7251, in ov7251_s_stream()
1356 ov7251->current_mode->data, in ov7251_s_stream()
1357 ov7251->current_mode->data_size); in ov7251_s_stream()
1359 dev_err(ov7251->dev, "could not set mode %dx%d\n", in ov7251_s_stream()
1360 ov7251->current_mode->width, in ov7251_s_stream()
1361 ov7251->current_mode->height); in ov7251_s_stream()
1364 ret = __v4l2_ctrl_handler_setup(&ov7251->ctrls); in ov7251_s_stream()
1366 dev_err(ov7251->dev, "could not sync v4l2 controls\n"); in ov7251_s_stream()
1369 ret = ov7251_write_reg(ov7251, OV7251_SC_MODE_SELECT, in ov7251_s_stream()
1374 ret = ov7251_write_reg(ov7251, OV7251_SC_MODE_SELECT, in ov7251_s_stream()
1376 pm_runtime_put(ov7251->dev); in ov7251_s_stream()
1379 mutex_unlock(&ov7251->lock); in ov7251_s_stream()
1383 pm_runtime_put(ov7251->dev); in ov7251_s_stream()
1384 mutex_unlock(&ov7251->lock); in ov7251_s_stream()
1392 struct ov7251 *ov7251 = to_ov7251(subdev); in ov7251_get_frame_interval() local
1401 mutex_lock(&ov7251->lock); in ov7251_get_frame_interval()
1402 fi->interval = ov7251->current_mode->timeperframe; in ov7251_get_frame_interval()
1403 mutex_unlock(&ov7251->lock); in ov7251_get_frame_interval()
1412 struct ov7251 *ov7251 = to_ov7251(subdev); in ov7251_set_frame_interval() local
1423 mutex_lock(&ov7251->lock); in ov7251_set_frame_interval()
1424 new_mode = ov7251_find_mode_by_ival(ov7251, &fi->interval); in ov7251_set_frame_interval()
1426 if (new_mode != ov7251->current_mode) { in ov7251_set_frame_interval()
1427 ret = __v4l2_ctrl_modify_range(ov7251->exposure, in ov7251_set_frame_interval()
1433 ret = __v4l2_ctrl_s_ctrl(ov7251->exposure, in ov7251_set_frame_interval()
1438 ret = __v4l2_ctrl_s_ctrl(ov7251->gain, 16); in ov7251_set_frame_interval()
1442 ov7251->current_mode = new_mode; in ov7251_set_frame_interval()
1445 fi->interval = ov7251->current_mode->timeperframe; in ov7251_set_frame_interval()
1448 mutex_unlock(&ov7251->lock); in ov7251_set_frame_interval()
1477 static int ov7251_check_hwcfg(struct ov7251 *ov7251) in ov7251_check_hwcfg() argument
1479 struct fwnode_handle *fwnode = dev_fwnode(ov7251->dev); in ov7251_check_hwcfg()
1494 return dev_err_probe(ov7251->dev, ret, in ov7251_check_hwcfg()
1498 ret = dev_err_probe(ov7251->dev, -EINVAL, in ov7251_check_hwcfg()
1513 ret = dev_err_probe(ov7251->dev, -EINVAL, in ov7251_check_hwcfg()
1518 ov7251->link_freq_idx = i; in ov7251_check_hwcfg()
1526 static int ov7251_detect_chip(struct ov7251 *ov7251) in ov7251_detect_chip() argument
1531 ret = ov7251_read_reg(ov7251, OV7251_CHIP_ID_HIGH, &chip_id_high); in ov7251_detect_chip()
1533 return dev_err_probe(ov7251->dev, -ENODEV, in ov7251_detect_chip()
1536 ret = ov7251_read_reg(ov7251, OV7251_CHIP_ID_LOW, &chip_id_low); in ov7251_detect_chip()
1538 return dev_err_probe(ov7251->dev, -ENODEV, in ov7251_detect_chip()
1541 ret = ov7251_read_reg(ov7251, OV7251_SC_GP_IO_IN1, &chip_rev); in ov7251_detect_chip()
1543 return dev_err_probe(ov7251->dev, -ENODEV, in ov7251_detect_chip()
1547 dev_info(ov7251->dev, in ov7251_detect_chip()
1554 ov7251->i2c_client->addr); in ov7251_detect_chip()
1559 static int ov7251_init_ctrls(struct ov7251 *ov7251) in ov7251_init_ctrls() argument
1565 v4l2_ctrl_handler_init(&ov7251->ctrls, 7); in ov7251_init_ctrls()
1566 ov7251->ctrls.lock = &ov7251->lock; in ov7251_init_ctrls()
1568 v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops, in ov7251_init_ctrls()
1570 v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops, in ov7251_init_ctrls()
1572 ov7251->exposure = v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops, in ov7251_init_ctrls()
1574 ov7251->gain = v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops, in ov7251_init_ctrls()
1576 v4l2_ctrl_new_std_menu_items(&ov7251->ctrls, &ov7251_ctrl_ops, in ov7251_init_ctrls()
1581 pixel_rate = pixel_rates[ov7251->link_freq_idx]; in ov7251_init_ctrls()
1582 ov7251->pixel_clock = v4l2_ctrl_new_std(&ov7251->ctrls, in ov7251_init_ctrls()
1587 ov7251->link_freq = v4l2_ctrl_new_int_menu(&ov7251->ctrls, in ov7251_init_ctrls()
1591 ov7251->link_freq_idx, in ov7251_init_ctrls()
1593 if (ov7251->link_freq) in ov7251_init_ctrls()
1594 ov7251->link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY; in ov7251_init_ctrls()
1595 if (ov7251->pixel_clock) in ov7251_init_ctrls()
1596 ov7251->pixel_clock->flags |= V4L2_CTRL_FLAG_READ_ONLY; in ov7251_init_ctrls()
1598 hblank = OV7251_FIXED_PPL - ov7251->current_mode->width; in ov7251_init_ctrls()
1599 ov7251->hblank = v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops, in ov7251_init_ctrls()
1602 if (ov7251->hblank) in ov7251_init_ctrls()
1603 ov7251->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY; in ov7251_init_ctrls()
1605 vblank_max = OV7251_TIMING_MAX_VTS - ov7251->current_mode->height; in ov7251_init_ctrls()
1606 vblank_def = ov7251->current_mode->vts - ov7251->current_mode->height; in ov7251_init_ctrls()
1607 ov7251->vblank = v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops, in ov7251_init_ctrls()
1612 ov7251->sd.ctrl_handler = &ov7251->ctrls; in ov7251_init_ctrls()
1614 if (ov7251->ctrls.error) { in ov7251_init_ctrls()
1615 v4l2_ctrl_handler_free(&ov7251->ctrls); in ov7251_init_ctrls()
1616 return ov7251->ctrls.error; in ov7251_init_ctrls()
1625 struct ov7251 *ov7251; in ov7251_probe() local
1630 ov7251 = devm_kzalloc(dev, sizeof(struct ov7251), GFP_KERNEL); in ov7251_probe()
1631 if (!ov7251) in ov7251_probe()
1634 ov7251->i2c_client = client; in ov7251_probe()
1635 ov7251->dev = dev; in ov7251_probe()
1637 ret = ov7251_check_hwcfg(ov7251); in ov7251_probe()
1642 ov7251->xclk = devm_clk_get_optional(dev, NULL); in ov7251_probe()
1643 if (IS_ERR(ov7251->xclk)) in ov7251_probe()
1644 return dev_err_probe(dev, PTR_ERR(ov7251->xclk), in ov7251_probe()
1654 if (ret && !ov7251->xclk) in ov7251_probe()
1657 clk_rate = clk_get_rate(ov7251->xclk); in ov7251_probe()
1658 ov7251->xclk_freq = clk_rate ? clk_rate : rate; in ov7251_probe()
1660 if (ov7251->xclk_freq == 0) in ov7251_probe()
1663 if (!ret && ov7251->xclk) { in ov7251_probe()
1664 ret = clk_set_rate(ov7251->xclk, rate); in ov7251_probe()
1671 if (ov7251->xclk_freq == supported_xclk_rates[i]) in ov7251_probe()
1677 ov7251->xclk_freq); in ov7251_probe()
1679 ov7251->pll_cfgs = ov7251_pll_cfgs[i]; in ov7251_probe()
1681 ov7251->io_regulator = devm_regulator_get(dev, "vdddo"); in ov7251_probe()
1682 if (IS_ERR(ov7251->io_regulator)) { in ov7251_probe()
1684 return PTR_ERR(ov7251->io_regulator); in ov7251_probe()
1687 ov7251->core_regulator = devm_regulator_get(dev, "vddd"); in ov7251_probe()
1688 if (IS_ERR(ov7251->core_regulator)) { in ov7251_probe()
1690 return PTR_ERR(ov7251->core_regulator); in ov7251_probe()
1693 ov7251->analog_regulator = devm_regulator_get(dev, "vdda"); in ov7251_probe()
1694 if (IS_ERR(ov7251->analog_regulator)) { in ov7251_probe()
1696 return PTR_ERR(ov7251->analog_regulator); in ov7251_probe()
1699 ov7251->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_HIGH); in ov7251_probe()
1700 if (IS_ERR(ov7251->enable_gpio)) { in ov7251_probe()
1702 return PTR_ERR(ov7251->enable_gpio); in ov7251_probe()
1705 mutex_init(&ov7251->lock); in ov7251_probe()
1707 ov7251->current_mode = &ov7251_mode_info_data[0]; in ov7251_probe()
1708 ret = ov7251_init_ctrls(ov7251); in ov7251_probe()
1714 v4l2_i2c_subdev_init(&ov7251->sd, client, &ov7251_subdev_ops); in ov7251_probe()
1715 ov7251->sd.internal_ops = &ov7251_internal_ops; in ov7251_probe()
1716 ov7251->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; in ov7251_probe()
1717 ov7251->pad.flags = MEDIA_PAD_FL_SOURCE; in ov7251_probe()
1718 ov7251->sd.dev = &client->dev; in ov7251_probe()
1719 ov7251->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; in ov7251_probe()
1721 ret = media_entity_pads_init(&ov7251->sd.entity, 1, &ov7251->pad); in ov7251_probe()
1727 ret = ov7251_set_power_on(ov7251->dev); in ov7251_probe()
1731 ret = ov7251_detect_chip(ov7251); in ov7251_probe()
1739 ret = ov7251_read_reg(ov7251, OV7251_PRE_ISP_00, in ov7251_probe()
1740 &ov7251->pre_isp_00); in ov7251_probe()
1747 ret = ov7251_read_reg(ov7251, OV7251_TIMING_FORMAT1, in ov7251_probe()
1748 &ov7251->timing_format1); in ov7251_probe()
1755 ret = ov7251_read_reg(ov7251, OV7251_TIMING_FORMAT2, in ov7251_probe()
1756 &ov7251->timing_format2); in ov7251_probe()
1767 ret = v4l2_async_register_subdev(&ov7251->sd); in ov7251_probe()
1773 ov7251_init_state(&ov7251->sd, NULL); in ov7251_probe()
1778 pm_runtime_disable(ov7251->dev); in ov7251_probe()
1779 pm_runtime_put_noidle(ov7251->dev); in ov7251_probe()
1781 ov7251_set_power_off(ov7251->dev); in ov7251_probe()
1783 media_entity_cleanup(&ov7251->sd.entity); in ov7251_probe()
1785 v4l2_ctrl_handler_free(&ov7251->ctrls); in ov7251_probe()
1787 mutex_destroy(&ov7251->lock); in ov7251_probe()
1795 struct ov7251 *ov7251 = to_ov7251(sd); in ov7251_remove() local
1797 v4l2_async_unregister_subdev(&ov7251->sd); in ov7251_remove()
1798 media_entity_cleanup(&ov7251->sd.entity); in ov7251_remove()
1799 v4l2_ctrl_handler_free(&ov7251->ctrls); in ov7251_remove()
1800 mutex_destroy(&ov7251->lock); in ov7251_remove()
1802 pm_runtime_disable(ov7251->dev); in ov7251_remove()
1803 if (!pm_runtime_status_suspended(ov7251->dev)) in ov7251_remove()
1804 ov7251_set_power_off(ov7251->dev); in ov7251_remove()
1805 pm_runtime_set_suspended(ov7251->dev); in ov7251_remove()