Lines Matching refs:gc4663

120 struct gc4663 {  struct
161 #define to_gc4663(sd) container_of(sd, struct gc4663, subdev) argument
686 gc4663_find_best_fit(struct gc4663 *gc4663, struct v4l2_subdev_format *fmt) in gc4663_find_best_fit() argument
694 for (i = 0; i < gc4663->cfg_num; i++) { in gc4663_find_best_fit()
709 struct gc4663 *gc4663 = to_gc4663(sd); in gc4663_set_fmt() local
713 mutex_lock(&gc4663->mutex); in gc4663_set_fmt()
715 mode = gc4663_find_best_fit(gc4663, fmt); in gc4663_set_fmt()
724 mutex_unlock(&gc4663->mutex); in gc4663_set_fmt()
728 gc4663->cur_mode = mode; in gc4663_set_fmt()
730 __v4l2_ctrl_modify_range(gc4663->hblank, h_blank, in gc4663_set_fmt()
733 __v4l2_ctrl_modify_range(gc4663->vblank, vblank_def, in gc4663_set_fmt()
738 gc4663->cur_link_freq = 1; in gc4663_set_fmt()
739 gc4663->cur_pixel_rate = GC4663_PIXEL_RATE_HDR; in gc4663_set_fmt()
741 gc4663->cur_link_freq = 0; in gc4663_set_fmt()
742 gc4663->cur_pixel_rate = GC4663_PIXEL_RATE_LINEAR; in gc4663_set_fmt()
745 __v4l2_ctrl_s_ctrl_int64(gc4663->pixel_rate, in gc4663_set_fmt()
746 gc4663->cur_pixel_rate); in gc4663_set_fmt()
747 __v4l2_ctrl_s_ctrl(gc4663->link_freq, in gc4663_set_fmt()
748 gc4663->cur_link_freq); in gc4663_set_fmt()
749 gc4663->cur_vts = mode->vts_def; in gc4663_set_fmt()
751 mutex_unlock(&gc4663->mutex); in gc4663_set_fmt()
760 struct gc4663 *gc4663 = to_gc4663(sd); in gc4663_get_fmt() local
761 const struct gc4663_mode *mode = gc4663->cur_mode; in gc4663_get_fmt()
763 mutex_lock(&gc4663->mutex); in gc4663_get_fmt()
768 mutex_unlock(&gc4663->mutex); in gc4663_get_fmt()
777 mutex_unlock(&gc4663->mutex); in gc4663_get_fmt()
786 struct gc4663 *gc4663 = to_gc4663(sd); in gc4663_enum_mbus_code() local
790 code->code = gc4663->cur_mode->bus_fmt; in gc4663_enum_mbus_code()
799 struct gc4663 *gc4663 = to_gc4663(sd); in gc4663_enum_frame_sizes() local
801 if (fse->index >= gc4663->cfg_num) in gc4663_enum_frame_sizes()
815 static int gc4663_enable_test_pattern(struct gc4663 *gc4663, u32 pattern) in gc4663_enable_test_pattern() argument
824 return gc4663_write_reg(gc4663->client, GC4663_REG_TEST_PATTERN, in gc4663_enable_test_pattern()
828 static int gc4663_set_gain_reg_hdr(struct gc4663 *gc4663, u32 gain) in gc4663_set_gain_reg_hdr() argument
848 gc4663_write_reg(gc4663->client, 0x2b3, in gc4663_set_gain_reg_hdr()
850 gc4663_write_reg(gc4663->client, 0x2b4, in gc4663_set_gain_reg_hdr()
852 gc4663_write_reg(gc4663->client, 0x2b8, in gc4663_set_gain_reg_hdr()
854 gc4663_write_reg(gc4663->client, 0x2b9, in gc4663_set_gain_reg_hdr()
856 gc4663_write_reg(gc4663->client, 0x515, in gc4663_set_gain_reg_hdr()
858 gc4663_write_reg(gc4663->client, 0x519, in gc4663_set_gain_reg_hdr()
860 gc4663_write_reg(gc4663->client, 0x2d9, in gc4663_set_gain_reg_hdr()
863 gc4663_write_reg(gc4663->client, 0x20e, in gc4663_set_gain_reg_hdr()
865 gc4663_write_reg(gc4663->client, 0x20f, in gc4663_set_gain_reg_hdr()
870 static int gc4663_set_gain_reg(struct gc4663 *gc4663, u32 gain) in gc4663_set_gain_reg() argument
888 gc4663_write_reg(gc4663->client, 0x2b3, in gc4663_set_gain_reg()
890 gc4663_write_reg(gc4663->client, 0x2b4, in gc4663_set_gain_reg()
892 gc4663_write_reg(gc4663->client, 0x2b8, in gc4663_set_gain_reg()
894 gc4663_write_reg(gc4663->client, 0x2b9, in gc4663_set_gain_reg()
896 gc4663_write_reg(gc4663->client, 0x515, in gc4663_set_gain_reg()
898 gc4663_write_reg(gc4663->client, 0x519, in gc4663_set_gain_reg()
900 gc4663_write_reg(gc4663->client, 0x2d9, in gc4663_set_gain_reg()
904 gc4663_write_reg(gc4663->client, 0x20e, in gc4663_set_gain_reg()
906 gc4663_write_reg(gc4663->client, 0x20f, in gc4663_set_gain_reg()
917 static int gc4663_set_hdrae(struct gc4663 *gc4663, in gc4663_set_hdrae() argument
927 if (!gc4663->has_init_exp && !gc4663->streaming) { in gc4663_set_hdrae()
928 gc4663->init_hdrae_exp = *ae; in gc4663_set_hdrae()
929 gc4663->has_init_exp = true; in gc4663_set_hdrae()
930 dev_dbg(&gc4663->client->dev, "gc4663 don't stream, record exp for hdr!\n"); in gc4663_set_hdrae()
940 dev_dbg(&gc4663->client->dev, in gc4663_set_hdrae()
945 if (gc4663->cur_mode->hdr_mode == HDR_X2) in gc4663_set_hdrae()
956 if (s_exp_time > gc4663->cur_vts - 1492) { in gc4663_set_hdrae()
957 dev_err(&gc4663->client->dev, "the s_exp_time is too large.\n"); in gc4663_set_hdrae()
958 s_exp_time = gc4663->cur_vts - 1492; in gc4663_set_hdrae()
961 if (l_exp_time > gc4663->cur_vts - s_exp_time) { in gc4663_set_hdrae()
962 dev_err(&gc4663->client->dev, "the l_exp_time is too large.\n"); in gc4663_set_hdrae()
963 l_exp_time = gc4663->cur_vts - s_exp_time; in gc4663_set_hdrae()
979 ret |= gc4663_write_reg(gc4663->client, GC4663_REG_EXPOSURE_H, in gc4663_set_hdrae()
982 ret |= gc4663_write_reg(gc4663->client, GC4663_REG_EXPOSURE_L, in gc4663_set_hdrae()
985 ret |= gc4663_write_reg(gc4663->client, GC4663_REG_SEXPOSURE_H, in gc4663_set_hdrae()
988 ret |= gc4663_write_reg(gc4663->client, GC4663_REG_SEXPOSURE_L, in gc4663_set_hdrae()
992 ret |= gc4663_set_gain_reg_hdr(gc4663, gain); in gc4663_set_hdrae()
999 struct gc4663 *gc4663 = to_gc4663(sd); in gc4663_g_frame_interval() local
1000 const struct gc4663_mode *mode = gc4663->cur_mode; in gc4663_g_frame_interval()
1010 struct gc4663 *gc4663 = to_gc4663(sd); in gc4663_g_mbus_config() local
1011 const struct gc4663_mode *mode = gc4663->cur_mode; in gc4663_g_mbus_config()
1030 static void gc4663_get_module_inf(struct gc4663 *gc4663, in gc4663_get_module_inf() argument
1035 strlcpy(inf->base.module, gc4663->module_name, in gc4663_get_module_inf()
1037 strlcpy(inf->base.lens, gc4663->len_name, sizeof(inf->base.lens)); in gc4663_get_module_inf()
1040 static int gc4663_get_channel_info(struct gc4663 *gc4663, struct rkmodule_channel_info *ch_info) in gc4663_get_channel_info() argument
1044 ch_info->vc = gc4663->cur_mode->vc[ch_info->index]; in gc4663_get_channel_info()
1045 ch_info->width = gc4663->cur_mode->width; in gc4663_get_channel_info()
1046 ch_info->height = gc4663->cur_mode->height; in gc4663_get_channel_info()
1047 ch_info->bus_fmt = gc4663->cur_mode->bus_fmt; in gc4663_get_channel_info()
1053 struct gc4663 *gc4663 = to_gc4663(sd); in gc4663_ioctl() local
1062 gc4663_get_module_inf(gc4663, (struct rkmodule_inf *)arg); in gc4663_ioctl()
1067 hdr->hdr_mode = gc4663->cur_mode->hdr_mode; in gc4663_ioctl()
1071 w = gc4663->cur_mode->width; in gc4663_ioctl()
1072 h = gc4663->cur_mode->height; in gc4663_ioctl()
1073 for (i = 0; i < gc4663->cfg_num; i++) { in gc4663_ioctl()
1077 gc4663->cur_mode = &supported_modes[i]; in gc4663_ioctl()
1081 if (i == gc4663->cfg_num) { in gc4663_ioctl()
1082 dev_err(&gc4663->client->dev, in gc4663_ioctl()
1087 w = gc4663->cur_mode->hts_def - in gc4663_ioctl()
1088 gc4663->cur_mode->width; in gc4663_ioctl()
1089 h = gc4663->cur_mode->vts_def - in gc4663_ioctl()
1090 gc4663->cur_mode->height; in gc4663_ioctl()
1091 __v4l2_ctrl_modify_range(gc4663->hblank, w, w, 1, w); in gc4663_ioctl()
1092 __v4l2_ctrl_modify_range(gc4663->vblank, h, in gc4663_ioctl()
1094 gc4663->cur_mode->height, in gc4663_ioctl()
1096 if (gc4663->cur_mode->hdr_mode == HDR_X2) { in gc4663_ioctl()
1097 gc4663->cur_link_freq = 1; in gc4663_ioctl()
1098 gc4663->cur_pixel_rate = GC4663_PIXEL_RATE_HDR; in gc4663_ioctl()
1100 gc4663->cur_link_freq = 0; in gc4663_ioctl()
1101 gc4663->cur_pixel_rate = GC4663_PIXEL_RATE_LINEAR; in gc4663_ioctl()
1104 __v4l2_ctrl_s_ctrl_int64(gc4663->pixel_rate, in gc4663_ioctl()
1105 gc4663->cur_pixel_rate); in gc4663_ioctl()
1106 __v4l2_ctrl_s_ctrl(gc4663->link_freq, in gc4663_ioctl()
1107 gc4663->cur_link_freq); in gc4663_ioctl()
1108 gc4663->cur_vts = gc4663->cur_mode->vts_def; in gc4663_ioctl()
1112 ret = gc4663_set_hdrae(gc4663, arg); in gc4663_ioctl()
1117 ret = gc4663_write_reg(gc4663->client, GC4663_REG_CTRL_MODE, in gc4663_ioctl()
1120 ret = gc4663_write_reg(gc4663->client, GC4663_REG_CTRL_MODE, in gc4663_ioctl()
1125 ret = gc4663_get_channel_info(gc4663, ch_info); in gc4663_ioctl()
1252 static int __gc4663_start_stream(struct gc4663 *gc4663) in __gc4663_start_stream() argument
1256 ret = gc4663_write_array(gc4663->client, gc4663->cur_mode->reg_list); in __gc4663_start_stream()
1261 ret = __v4l2_ctrl_handler_setup(&gc4663->ctrl_handler); in __gc4663_start_stream()
1262 if (gc4663->has_init_exp && gc4663->cur_mode->hdr_mode != NO_HDR) { in __gc4663_start_stream()
1263 ret = gc4663_ioctl(&gc4663->subdev, PREISP_CMD_SET_HDRAE_EXP, in __gc4663_start_stream()
1264 &gc4663->init_hdrae_exp); in __gc4663_start_stream()
1266 dev_err(&gc4663->client->dev, in __gc4663_start_stream()
1274 ret |= gc4663_write_reg(gc4663->client, GC4663_REG_CTRL_MODE, in __gc4663_start_stream()
1276 if (gc4663->cur_mode->hdr_mode == NO_HDR) in __gc4663_start_stream()
1277 ret |= gc4663_write_array(gc4663->client, gc4663_linear_global_regs); in __gc4663_start_stream()
1281 static int __gc4663_stop_stream(struct gc4663 *gc4663) in __gc4663_stop_stream() argument
1283 gc4663->has_init_exp = false; in __gc4663_stop_stream()
1284 return gc4663_write_reg(gc4663->client, GC4663_REG_CTRL_MODE, in __gc4663_stop_stream()
1290 struct gc4663 *gc4663 = to_gc4663(sd); in gc4663_s_stream() local
1291 struct i2c_client *client = gc4663->client; in gc4663_s_stream()
1294 mutex_lock(&gc4663->mutex); in gc4663_s_stream()
1296 if (on == gc4663->streaming) in gc4663_s_stream()
1306 ret = __gc4663_start_stream(gc4663); in gc4663_s_stream()
1313 __gc4663_stop_stream(gc4663); in gc4663_s_stream()
1317 gc4663->streaming = on; in gc4663_s_stream()
1320 mutex_unlock(&gc4663->mutex); in gc4663_s_stream()
1327 struct gc4663 *gc4663 = to_gc4663(sd); in gc4663_s_power() local
1328 struct i2c_client *client = gc4663->client; in gc4663_s_power()
1331 mutex_lock(&gc4663->mutex); in gc4663_s_power()
1334 if (gc4663->power_on == !!on) in gc4663_s_power()
1344 ret = gc4663_write_array(gc4663->client, gc4663_global_regs); in gc4663_s_power()
1351 gc4663->power_on = true; in gc4663_s_power()
1354 gc4663->power_on = false; in gc4663_s_power()
1358 mutex_unlock(&gc4663->mutex); in gc4663_s_power()
1369 static int __gc4663_power_on(struct gc4663 *gc4663) in __gc4663_power_on() argument
1373 struct device *dev = &gc4663->client->dev; in __gc4663_power_on()
1375 if (!IS_ERR_OR_NULL(gc4663->pins_default)) { in __gc4663_power_on()
1376 ret = pinctrl_select_state(gc4663->pinctrl, in __gc4663_power_on()
1377 gc4663->pins_default); in __gc4663_power_on()
1381 ret = clk_set_rate(gc4663->xvclk, GC4663_XVCLK_FREQ); in __gc4663_power_on()
1384 if (clk_get_rate(gc4663->xvclk) != GC4663_XVCLK_FREQ) in __gc4663_power_on()
1386 ret = clk_prepare_enable(gc4663->xvclk); in __gc4663_power_on()
1391 if (!IS_ERR(gc4663->reset_gpio)) in __gc4663_power_on()
1392 gpiod_set_value_cansleep(gc4663->reset_gpio, 0); in __gc4663_power_on()
1394 if (!IS_ERR(gc4663->pwdn_gpio)) in __gc4663_power_on()
1395 gpiod_set_value_cansleep(gc4663->pwdn_gpio, 0); in __gc4663_power_on()
1398 ret = regulator_bulk_enable(GC4663_NUM_SUPPLIES, gc4663->supplies); in __gc4663_power_on()
1405 if (!IS_ERR(gc4663->pwren_gpio)) in __gc4663_power_on()
1406 gpiod_set_value_cansleep(gc4663->pwren_gpio, 1); in __gc4663_power_on()
1409 if (!IS_ERR(gc4663->pwdn_gpio)) in __gc4663_power_on()
1410 gpiod_set_value_cansleep(gc4663->pwdn_gpio, 1); in __gc4663_power_on()
1412 if (!IS_ERR(gc4663->reset_gpio)) in __gc4663_power_on()
1413 gpiod_set_value_cansleep(gc4663->reset_gpio, 1); in __gc4663_power_on()
1422 clk_disable_unprepare(gc4663->xvclk); in __gc4663_power_on()
1427 static void __gc4663_power_off(struct gc4663 *gc4663) in __gc4663_power_off() argument
1430 struct device *dev = &gc4663->client->dev; in __gc4663_power_off()
1432 if (!IS_ERR(gc4663->pwdn_gpio)) in __gc4663_power_off()
1433 gpiod_set_value_cansleep(gc4663->pwdn_gpio, 0); in __gc4663_power_off()
1434 clk_disable_unprepare(gc4663->xvclk); in __gc4663_power_off()
1435 if (!IS_ERR(gc4663->reset_gpio)) in __gc4663_power_off()
1436 gpiod_set_value_cansleep(gc4663->reset_gpio, 0); in __gc4663_power_off()
1437 if (!IS_ERR_OR_NULL(gc4663->pins_sleep)) { in __gc4663_power_off()
1438 ret = pinctrl_select_state(gc4663->pinctrl, in __gc4663_power_off()
1439 gc4663->pins_sleep); in __gc4663_power_off()
1443 regulator_bulk_disable(GC4663_NUM_SUPPLIES, gc4663->supplies); in __gc4663_power_off()
1444 if (!IS_ERR(gc4663->pwren_gpio)) in __gc4663_power_off()
1445 gpiod_set_value_cansleep(gc4663->pwren_gpio, 0); in __gc4663_power_off()
1452 struct gc4663 *gc4663 = to_gc4663(sd); in gc4663_runtime_resume() local
1454 return __gc4663_power_on(gc4663); in gc4663_runtime_resume()
1461 struct gc4663 *gc4663 = to_gc4663(sd); in gc4663_runtime_suspend() local
1463 __gc4663_power_off(gc4663); in gc4663_runtime_suspend()
1471 struct gc4663 *gc4663 = to_gc4663(sd); in gc4663_open() local
1476 mutex_lock(&gc4663->mutex); in gc4663_open()
1483 mutex_unlock(&gc4663->mutex); in gc4663_open()
1494 struct gc4663 *gc4663 = to_gc4663(sd); in gc4663_enum_frame_interval() local
1496 if (fie->index >= gc4663->cfg_num) in gc4663_enum_frame_interval()
1548 struct gc4663 *gc4663 = container_of(ctrl->handler, in gc4663_set_ctrl() local
1549 struct gc4663, ctrl_handler); in gc4663_set_ctrl()
1550 struct i2c_client *client = gc4663->client; in gc4663_set_ctrl()
1559 max = gc4663->cur_mode->height + ctrl->val - 4; in gc4663_set_ctrl()
1560 __v4l2_ctrl_modify_range(gc4663->exposure, in gc4663_set_ctrl()
1561 gc4663->exposure->minimum, in gc4663_set_ctrl()
1563 gc4663->exposure->step, in gc4663_set_ctrl()
1564 gc4663->exposure->default_value); in gc4663_set_ctrl()
1574 ret = gc4663_write_reg(gc4663->client, GC4663_REG_EXPOSURE_H, in gc4663_set_ctrl()
1577 ret |= gc4663_write_reg(gc4663->client, GC4663_REG_EXPOSURE_L, in gc4663_set_ctrl()
1582 ret = gc4663_set_gain_reg(gc4663, ctrl->val); in gc4663_set_ctrl()
1585 gc4663->cur_vts = ctrl->val + gc4663->cur_mode->height; in gc4663_set_ctrl()
1586 ret = gc4663_write_reg(gc4663->client, GC4663_REG_VTS_H, in gc4663_set_ctrl()
1588 gc4663->cur_vts >> 8); in gc4663_set_ctrl()
1589 ret |= gc4663_write_reg(gc4663->client, GC4663_REG_VTS_L, in gc4663_set_ctrl()
1591 gc4663->cur_vts & 0xff); in gc4663_set_ctrl()
1594 ret = gc4663_enable_test_pattern(gc4663, ctrl->val); in gc4663_set_ctrl()
1597 ret = gc4663_read_reg(gc4663->client, GC4663_FLIP_MIRROR_REG, in gc4663_set_ctrl()
1603 ret |= gc4663_write_reg(gc4663->client, GC4663_FLIP_MIRROR_REG, in gc4663_set_ctrl()
1607 ret = gc4663_read_reg(gc4663->client, GC4663_FLIP_MIRROR_REG, in gc4663_set_ctrl()
1613 ret |= gc4663_write_reg(gc4663->client, GC4663_FLIP_MIRROR_REG, in gc4663_set_ctrl()
1631 static int gc4663_initialize_controls(struct gc4663 *gc4663) in gc4663_initialize_controls() argument
1639 handler = &gc4663->ctrl_handler; in gc4663_initialize_controls()
1640 mode = gc4663->cur_mode; in gc4663_initialize_controls()
1644 handler->lock = &gc4663->mutex; in gc4663_initialize_controls()
1646 gc4663->link_freq = v4l2_ctrl_new_int_menu(handler, NULL, V4L2_CID_LINK_FREQ, in gc4663_initialize_controls()
1649 gc4663->cur_link_freq = 1; in gc4663_initialize_controls()
1650 gc4663->cur_pixel_rate = GC4663_PIXEL_RATE_HDR; in gc4663_initialize_controls()
1652 gc4663->cur_link_freq = 0; in gc4663_initialize_controls()
1653 gc4663->cur_pixel_rate = GC4663_PIXEL_RATE_LINEAR; in gc4663_initialize_controls()
1656 __v4l2_ctrl_s_ctrl(gc4663->link_freq, in gc4663_initialize_controls()
1657 gc4663->cur_link_freq); in gc4663_initialize_controls()
1659 gc4663->pixel_rate = v4l2_ctrl_new_std(handler, NULL, V4L2_CID_PIXEL_RATE, in gc4663_initialize_controls()
1663 gc4663->hblank = v4l2_ctrl_new_std(handler, NULL, V4L2_CID_HBLANK, in gc4663_initialize_controls()
1665 if (gc4663->hblank) in gc4663_initialize_controls()
1666 gc4663->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY; in gc4663_initialize_controls()
1669 gc4663->cur_vts = mode->vts_def; in gc4663_initialize_controls()
1670 gc4663->vblank = v4l2_ctrl_new_std(handler, &gc4663_ctrl_ops, in gc4663_initialize_controls()
1676 gc4663->exposure = v4l2_ctrl_new_std(handler, &gc4663_ctrl_ops, in gc4663_initialize_controls()
1683 gc4663->anal_gain = v4l2_ctrl_new_std(handler, &gc4663_ctrl_ops, in gc4663_initialize_controls()
1690 gc4663->test_pattern = in gc4663_initialize_controls()
1697 gc4663->h_flip = v4l2_ctrl_new_std(handler, &gc4663_ctrl_ops, in gc4663_initialize_controls()
1700 gc4663->v_flip = v4l2_ctrl_new_std(handler, &gc4663_ctrl_ops, in gc4663_initialize_controls()
1704 dev_err(&gc4663->client->dev, in gc4663_initialize_controls()
1709 gc4663->subdev.ctrl_handler = handler; in gc4663_initialize_controls()
1710 gc4663->has_init_exp = false; in gc4663_initialize_controls()
1720 static int gc4663_check_sensor_id(struct gc4663 *gc4663, in gc4663_check_sensor_id() argument
1723 struct device *dev = &gc4663->client->dev; in gc4663_check_sensor_id()
1743 static int gc4663_configure_regulators(struct gc4663 *gc4663) in gc4663_configure_regulators() argument
1748 gc4663->supplies[i].supply = gc4663_supply_names[i]; in gc4663_configure_regulators()
1750 return devm_regulator_bulk_get(&gc4663->client->dev, in gc4663_configure_regulators()
1752 gc4663->supplies); in gc4663_configure_regulators()
1760 struct gc4663 *gc4663; in gc4663_probe() local
1771 gc4663 = devm_kzalloc(dev, sizeof(*gc4663), GFP_KERNEL); in gc4663_probe()
1772 if (!gc4663) in gc4663_probe()
1777 &gc4663->module_index); in gc4663_probe()
1779 &gc4663->module_facing); in gc4663_probe()
1781 &gc4663->module_name); in gc4663_probe()
1783 &gc4663->len_name); in gc4663_probe()
1789 gc4663->client = client; in gc4663_probe()
1790 gc4663->cfg_num = ARRAY_SIZE(supported_modes); in gc4663_probe()
1791 for (i = 0; i < gc4663->cfg_num; i++) { in gc4663_probe()
1793 gc4663->cur_mode = &supported_modes[i]; in gc4663_probe()
1797 if (i == gc4663->cfg_num) in gc4663_probe()
1798 gc4663->cur_mode = &supported_modes[0]; in gc4663_probe()
1800 gc4663->xvclk = devm_clk_get(dev, "xvclk"); in gc4663_probe()
1801 if (IS_ERR(gc4663->xvclk)) { in gc4663_probe()
1806 gc4663->pwren_gpio = devm_gpiod_get(dev, "pwren", GPIOD_OUT_LOW); in gc4663_probe()
1807 if (IS_ERR(gc4663->pwren_gpio)) in gc4663_probe()
1810 gc4663->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); in gc4663_probe()
1811 if (IS_ERR(gc4663->reset_gpio)) in gc4663_probe()
1814 gc4663->pwdn_gpio = devm_gpiod_get(dev, "pwdn", GPIOD_OUT_LOW); in gc4663_probe()
1815 if (IS_ERR(gc4663->pwdn_gpio)) in gc4663_probe()
1818 gc4663->pinctrl = devm_pinctrl_get(dev); in gc4663_probe()
1819 if (!IS_ERR(gc4663->pinctrl)) { in gc4663_probe()
1820 gc4663->pins_default = in gc4663_probe()
1821 pinctrl_lookup_state(gc4663->pinctrl, in gc4663_probe()
1823 if (IS_ERR(gc4663->pins_default)) in gc4663_probe()
1826 gc4663->pins_sleep = in gc4663_probe()
1827 pinctrl_lookup_state(gc4663->pinctrl, in gc4663_probe()
1829 if (IS_ERR(gc4663->pins_sleep)) in gc4663_probe()
1835 ret = gc4663_configure_regulators(gc4663); in gc4663_probe()
1841 mutex_init(&gc4663->mutex); in gc4663_probe()
1843 sd = &gc4663->subdev; in gc4663_probe()
1845 ret = gc4663_initialize_controls(gc4663); in gc4663_probe()
1849 ret = __gc4663_power_on(gc4663); in gc4663_probe()
1855 ret = gc4663_check_sensor_id(gc4663, client); in gc4663_probe()
1865 gc4663->pad.flags = MEDIA_PAD_FL_SOURCE; in gc4663_probe()
1867 ret = media_entity_pads_init(&sd->entity, 1, &gc4663->pad); in gc4663_probe()
1873 if (strcmp(gc4663->module_facing, "back") == 0) in gc4663_probe()
1879 gc4663->module_index, facing, in gc4663_probe()
1898 __gc4663_power_off(gc4663); in gc4663_probe()
1900 v4l2_ctrl_handler_free(&gc4663->ctrl_handler); in gc4663_probe()
1902 mutex_destroy(&gc4663->mutex); in gc4663_probe()
1910 struct gc4663 *gc4663 = to_gc4663(sd); in gc4663_remove() local
1916 v4l2_ctrl_handler_free(&gc4663->ctrl_handler); in gc4663_remove()
1917 mutex_destroy(&gc4663->mutex); in gc4663_remove()
1921 __gc4663_power_off(gc4663); in gc4663_remove()