Lines Matching refs:sc4238
137 struct sc4238 { struct
180 #define to_sc4238(sd) container_of(sd, struct sc4238, subdev) argument
1433 static int __sc4238_power_on(struct sc4238 *sc4238);
1522 sc4238_find_best_fit(struct sc4238 *sc4238, struct v4l2_subdev_format *fmt) in sc4238_find_best_fit() argument
1530 for (i = 0; i < sc4238->cfg_num; i++) { in sc4238_find_best_fit()
1546 struct sc4238 *sc4238 = to_sc4238(sd); in sc4238_set_fmt() local
1550 mutex_lock(&sc4238->mutex); in sc4238_set_fmt()
1552 mode = sc4238_find_best_fit(sc4238, fmt); in sc4238_set_fmt()
1561 mutex_unlock(&sc4238->mutex); in sc4238_set_fmt()
1565 sc4238->cur_mode = mode; in sc4238_set_fmt()
1567 __v4l2_ctrl_modify_range(sc4238->hblank, h_blank, in sc4238_set_fmt()
1570 __v4l2_ctrl_modify_range(sc4238->vblank, vblank_def, in sc4238_set_fmt()
1573 __v4l2_ctrl_s_ctrl_int64(sc4238->pixel_rate, in sc4238_set_fmt()
1575 __v4l2_ctrl_s_ctrl(sc4238->link_freq, in sc4238_set_fmt()
1577 sc4238->cur_fps = mode->max_fps; in sc4238_set_fmt()
1578 sc4238->cur_vts = mode->vts_def; in sc4238_set_fmt()
1581 mutex_unlock(&sc4238->mutex); in sc4238_set_fmt()
1590 struct sc4238 *sc4238 = to_sc4238(sd); in sc4238_get_fmt() local
1591 const struct sc4238_mode *mode = sc4238->cur_mode; in sc4238_get_fmt()
1593 mutex_lock(&sc4238->mutex); in sc4238_get_fmt()
1598 mutex_unlock(&sc4238->mutex); in sc4238_get_fmt()
1611 mutex_unlock(&sc4238->mutex); in sc4238_get_fmt()
1620 struct sc4238 *sc4238 = to_sc4238(sd); in sc4238_enum_mbus_code() local
1624 code->code = sc4238->cur_mode->bus_fmt; in sc4238_enum_mbus_code()
1633 struct sc4238 *sc4238 = to_sc4238(sd); in sc4238_enum_frame_sizes() local
1635 if (fse->index >= sc4238->cfg_num) in sc4238_enum_frame_sizes()
1649 static int sc4238_enable_test_pattern(struct sc4238 *sc4238, u32 pattern) in sc4238_enable_test_pattern() argument
1654 ret = sc4238_read_reg(sc4238->client, SC4238_REG_TEST_PATTERN, in sc4238_enable_test_pattern()
1661 ret |= sc4238_write_reg(sc4238->client, SC4238_REG_TEST_PATTERN, in sc4238_enable_test_pattern()
1669 struct sc4238 *sc4238 = to_sc4238(sd); in sc4238_g_frame_interval() local
1670 const struct sc4238_mode *mode = sc4238->cur_mode; in sc4238_g_frame_interval()
1672 if (sc4238->streaming) in sc4238_g_frame_interval()
1673 fi->interval = sc4238->cur_fps; in sc4238_g_frame_interval()
1683 struct sc4238 *sc4238 = to_sc4238(sd); in sc4238_g_mbus_config() local
1684 const struct sc4238_mode *mode = sc4238->cur_mode; in sc4238_g_mbus_config()
1703 static void sc4238_get_module_inf(struct sc4238 *sc4238, in sc4238_get_module_inf() argument
1708 strlcpy(inf->base.module, sc4238->module_name, in sc4238_get_module_inf()
1710 strlcpy(inf->base.lens, sc4238->len_name, sizeof(inf->base.lens)); in sc4238_get_module_inf()
1713 static int sc4238_get_gain_reg(struct sc4238 *sc4238, u32 total_gain, in sc4238_get_gain_reg() argument
1720 dev_err(&sc4238->client->dev, in sc4238_get_gain_reg()
1764 dev_dbg(&sc4238->client->dev, in sc4238_get_gain_reg()
1770 static int sc4238_set_hdrae(struct sc4238 *sc4238, in sc4238_set_hdrae() argument
1781 if (!sc4238->has_init_exp && !sc4238->streaming) { in sc4238_set_hdrae()
1782 sc4238->init_hdrae_exp = *ae; in sc4238_set_hdrae()
1783 sc4238->has_init_exp = true; in sc4238_set_hdrae()
1784 dev_info(&sc4238->client->dev, "sc4238 don't stream, record exp for hdr!\n"); in sc4238_set_hdrae()
1794 dev_dbg(&sc4238->client->dev, in sc4238_set_hdrae()
1800 if (sc4238->cur_mode->hdr_mode == HDR_X2) { in sc4238_set_hdrae()
1809 dev_err(&sc4238->client->dev, in sc4238_set_hdrae()
1817 max_exp_l = sc4238->cur_vts - rhs1 - 9; in sc4238_set_hdrae()
1820 dev_err(&sc4238->client->dev, in sc4238_set_hdrae()
1825 ret = sc4238_get_gain_reg(sc4238, l_a_gain, in sc4238_set_hdrae()
1831 dev_dbg(&sc4238->client->dev, in sc4238_set_hdrae()
1833 ret |= sc4238_write_reg(sc4238->client, in sc4238_set_hdrae()
1838 ret |= sc4238_write_reg(sc4238->client, in sc4238_set_hdrae()
1842 ret |= sc4238_write_reg(sc4238->client, in sc4238_set_hdrae()
1847 ret |= sc4238_write_reg(sc4238->client, in sc4238_set_hdrae()
1851 ret |= sc4238_write_reg(sc4238->client, in sc4238_set_hdrae()
1855 ret |= sc4238_write_reg(sc4238->client, in sc4238_set_hdrae()
1859 ret |= sc4238_write_reg(sc4238->client, in sc4238_set_hdrae()
1863 ret |= sc4238_write_reg(sc4238->client, in sc4238_set_hdrae()
1867 ret |= sc4238_write_reg(sc4238->client, in sc4238_set_hdrae()
1871 ret |= sc4238_write_reg(sc4238->client, in sc4238_set_hdrae()
1875 ret |= sc4238_write_reg(sc4238->client, in sc4238_set_hdrae()
1883 static int sc4238_get_channel_info(struct sc4238 *sc4238, struct rkmodule_channel_info *ch_info) in sc4238_get_channel_info() argument
1887 ch_info->vc = sc4238->cur_mode->vc[ch_info->index]; in sc4238_get_channel_info()
1888 ch_info->width = sc4238->cur_mode->width; in sc4238_get_channel_info()
1889 ch_info->height = sc4238->cur_mode->height; in sc4238_get_channel_info()
1890 ch_info->bus_fmt = sc4238->cur_mode->bus_fmt; in sc4238_get_channel_info()
1896 struct sc4238 *sc4238 = to_sc4238(sd); in sc4238_ioctl() local
1905 return sc4238_set_hdrae(sc4238, arg); in sc4238_ioctl()
1908 w = sc4238->cur_mode->width; in sc4238_ioctl()
1909 h = sc4238->cur_mode->height; in sc4238_ioctl()
1911 dev_info(&sc4238->client->dev, in sc4238_ioctl()
1914 for (i = 0; i < sc4238->cfg_num; i++) { in sc4238_ioctl()
1918 sc4238->cur_mode = &supported_modes[i]; in sc4238_ioctl()
1922 if (i == sc4238->cfg_num) { in sc4238_ioctl()
1923 dev_err(&sc4238->client->dev, in sc4238_ioctl()
1928 w = sc4238->cur_mode->hts_def - sc4238->cur_mode->width; in sc4238_ioctl()
1929 h = sc4238->cur_mode->vts_def - sc4238->cur_mode->height; in sc4238_ioctl()
1930 __v4l2_ctrl_modify_range(sc4238->hblank, w, w, 1, w); in sc4238_ioctl()
1931 __v4l2_ctrl_modify_range(sc4238->vblank, h, in sc4238_ioctl()
1932 SC4238_VTS_MAX - sc4238->cur_mode->height, in sc4238_ioctl()
1934 sc4238->cur_fps = sc4238->cur_mode->max_fps; in sc4238_ioctl()
1935 sc4238->cur_vts = sc4238->cur_mode->vts_def; in sc4238_ioctl()
1936 dev_info(&sc4238->client->dev, in sc4238_ioctl()
1938 sc4238->cur_mode->hdr_mode); in sc4238_ioctl()
1942 sc4238_get_module_inf(sc4238, (struct rkmodule_inf *)arg); in sc4238_ioctl()
1947 hdr_cfg->hdr_mode = sc4238->cur_mode->hdr_mode; in sc4238_ioctl()
1954 ret = sc4238_write_reg(sc4238->client, SC4238_REG_CTRL_MODE, in sc4238_ioctl()
1957 ret = sc4238_write_reg(sc4238->client, SC4238_REG_CTRL_MODE, in sc4238_ioctl()
1962 ret = sc4238_get_channel_info(sc4238, ch_info); in sc4238_ioctl()
2089 static int __sc4238_start_stream(struct sc4238 *sc4238) in __sc4238_start_stream() argument
2093 ret = sc4238_write_array(sc4238->client, sc4238->cur_mode->reg_list); in __sc4238_start_stream()
2098 ret = __v4l2_ctrl_handler_setup(&sc4238->ctrl_handler); in __sc4238_start_stream()
2101 if (sc4238->has_init_exp && sc4238->cur_mode->hdr_mode != NO_HDR) { in __sc4238_start_stream()
2102 ret = sc4238_ioctl(&sc4238->subdev, PREISP_CMD_SET_HDRAE_EXP, in __sc4238_start_stream()
2103 &sc4238->init_hdrae_exp); in __sc4238_start_stream()
2105 dev_err(&sc4238->client->dev, in __sc4238_start_stream()
2110 return sc4238_write_reg(sc4238->client, SC4238_REG_CTRL_MODE, in __sc4238_start_stream()
2114 static int __sc4238_stop_stream(struct sc4238 *sc4238) in __sc4238_stop_stream() argument
2116 sc4238->has_init_exp = false; in __sc4238_stop_stream()
2117 if (sc4238->is_thunderboot) in __sc4238_stop_stream()
2118 sc4238->is_first_streamoff = true; in __sc4238_stop_stream()
2119 return sc4238_write_reg(sc4238->client, SC4238_REG_CTRL_MODE, in __sc4238_stop_stream()
2125 struct sc4238 *sc4238 = to_sc4238(sd); in sc4238_s_stream() local
2126 struct i2c_client *client = sc4238->client; in sc4238_s_stream()
2131 sc4238->cur_mode->width, in sc4238_s_stream()
2132 sc4238->cur_mode->height, in sc4238_s_stream()
2133 DIV_ROUND_CLOSEST(sc4238->cur_mode->max_fps.denominator, in sc4238_s_stream()
2134 sc4238->cur_mode->max_fps.numerator), in sc4238_s_stream()
2135 sc4238->cur_mode->hdr_mode); in sc4238_s_stream()
2137 mutex_lock(&sc4238->mutex); in sc4238_s_stream()
2139 if (on == sc4238->streaming) in sc4238_s_stream()
2143 if (sc4238->is_thunderboot && rkisp_tb_get_state() == RKISP_TB_NG) { in sc4238_s_stream()
2144 sc4238->is_thunderboot = false; in sc4238_s_stream()
2145 __sc4238_power_on(sc4238); in sc4238_s_stream()
2153 ret = __sc4238_start_stream(sc4238); in sc4238_s_stream()
2160 __sc4238_stop_stream(sc4238); in sc4238_s_stream()
2164 sc4238->streaming = on; in sc4238_s_stream()
2167 mutex_unlock(&sc4238->mutex); in sc4238_s_stream()
2174 struct sc4238 *sc4238 = to_sc4238(sd); in sc4238_s_power() local
2175 struct i2c_client *client = sc4238->client; in sc4238_s_power()
2178 mutex_lock(&sc4238->mutex); in sc4238_s_power()
2181 if (sc4238->power_on == !!on) in sc4238_s_power()
2191 ret = sc4238_write_array(sc4238->client, sc4238_global_regs); in sc4238_s_power()
2198 sc4238->power_on = true; in sc4238_s_power()
2201 sc4238->power_on = false; in sc4238_s_power()
2205 mutex_unlock(&sc4238->mutex); in sc4238_s_power()
2216 static int __sc4238_power_on(struct sc4238 *sc4238) in __sc4238_power_on() argument
2220 struct device *dev = &sc4238->client->dev; in __sc4238_power_on()
2222 if (sc4238->is_thunderboot) in __sc4238_power_on()
2225 if (!IS_ERR_OR_NULL(sc4238->pins_default)) { in __sc4238_power_on()
2226 ret = pinctrl_select_state(sc4238->pinctrl, in __sc4238_power_on()
2227 sc4238->pins_default); in __sc4238_power_on()
2231 ret = clk_set_rate(sc4238->xvclk, SC4238_XVCLK_FREQ); in __sc4238_power_on()
2234 if (clk_get_rate(sc4238->xvclk) != SC4238_XVCLK_FREQ) in __sc4238_power_on()
2236 ret = clk_prepare_enable(sc4238->xvclk); in __sc4238_power_on()
2241 if (!IS_ERR(sc4238->reset_gpio)) in __sc4238_power_on()
2242 gpiod_set_value_cansleep(sc4238->reset_gpio, 1); in __sc4238_power_on()
2244 ret = regulator_bulk_enable(SC4238_NUM_SUPPLIES, sc4238->supplies); in __sc4238_power_on()
2250 if (!IS_ERR(sc4238->reset_gpio)) in __sc4238_power_on()
2251 gpiod_set_value_cansleep(sc4238->reset_gpio, 0); in __sc4238_power_on()
2254 if (!IS_ERR(sc4238->pwdn_gpio)) in __sc4238_power_on()
2255 gpiod_set_value_cansleep(sc4238->pwdn_gpio, 1); in __sc4238_power_on()
2260 if (!IS_ERR(sc4238->reset_gpio)) in __sc4238_power_on()
2272 clk_disable_unprepare(sc4238->xvclk); in __sc4238_power_on()
2277 static void __sc4238_power_off(struct sc4238 *sc4238) in __sc4238_power_off() argument
2280 struct device *dev = &sc4238->client->dev; in __sc4238_power_off()
2282 if (sc4238->is_thunderboot) { in __sc4238_power_off()
2283 if (sc4238->is_first_streamoff) { in __sc4238_power_off()
2284 sc4238->is_thunderboot = false; in __sc4238_power_off()
2285 sc4238->is_first_streamoff = false; in __sc4238_power_off()
2291 if (!IS_ERR(sc4238->pwdn_gpio)) in __sc4238_power_off()
2292 gpiod_set_value_cansleep(sc4238->pwdn_gpio, 0); in __sc4238_power_off()
2294 clk_disable_unprepare(sc4238->xvclk); in __sc4238_power_off()
2296 if (!IS_ERR(sc4238->reset_gpio)) in __sc4238_power_off()
2297 gpiod_set_value_cansleep(sc4238->reset_gpio, 0); in __sc4238_power_off()
2298 if (!IS_ERR_OR_NULL(sc4238->pins_sleep)) { in __sc4238_power_off()
2299 ret = pinctrl_select_state(sc4238->pinctrl, in __sc4238_power_off()
2300 sc4238->pins_sleep); in __sc4238_power_off()
2305 if (sc4238->is_thunderboot_ng) { in __sc4238_power_off()
2306 sc4238->is_thunderboot_ng = false; in __sc4238_power_off()
2307 regulator_bulk_disable(SC4238_NUM_SUPPLIES, sc4238->supplies); in __sc4238_power_off()
2315 struct sc4238 *sc4238 = to_sc4238(sd); in sc4238_runtime_resume() local
2317 return __sc4238_power_on(sc4238); in sc4238_runtime_resume()
2324 struct sc4238 *sc4238 = to_sc4238(sd); in sc4238_runtime_suspend() local
2326 __sc4238_power_off(sc4238); in sc4238_runtime_suspend()
2334 struct sc4238 *sc4238 = to_sc4238(sd); in sc4238_open() local
2339 mutex_lock(&sc4238->mutex); in sc4238_open()
2346 mutex_unlock(&sc4238->mutex); in sc4238_open()
2357 struct sc4238 *sc4238 = to_sc4238(sd); in sc4238_enum_frame_interval() local
2359 if (fie->index >= sc4238->cfg_num) in sc4238_enum_frame_interval()
2409 static void sc4238_modify_fps_info(struct sc4238 *sc4238) in sc4238_modify_fps_info() argument
2411 const struct sc4238_mode *mode = sc4238->cur_mode; in sc4238_modify_fps_info()
2413 sc4238->cur_fps.denominator = mode->max_fps.denominator * mode->vts_def / in sc4238_modify_fps_info()
2414 sc4238->cur_vts; in sc4238_modify_fps_info()
2419 struct sc4238 *sc4238 = container_of(ctrl->handler, in sc4238_set_ctrl() local
2420 struct sc4238, ctrl_handler); in sc4238_set_ctrl()
2421 struct i2c_client *client = sc4238->client; in sc4238_set_ctrl()
2437 max = sc4238->cur_mode->height + ctrl->val - 5; in sc4238_set_ctrl()
2438 __v4l2_ctrl_modify_range(sc4238->exposure, in sc4238_set_ctrl()
2439 sc4238->exposure->minimum, max, in sc4238_set_ctrl()
2440 sc4238->exposure->step, in sc4238_set_ctrl()
2441 sc4238->exposure->default_value); in sc4238_set_ctrl()
2451 ret = sc4238_write_reg(sc4238->client, in sc4238_set_ctrl()
2459 ret = sc4238_get_gain_reg(sc4238, ctrl->val, in sc4238_set_ctrl()
2462 ret |= sc4238_write_reg(sc4238->client, in sc4238_set_ctrl()
2466 ret |= sc4238_write_reg(sc4238->client, in sc4238_set_ctrl()
2470 ret |= sc4238_write_reg(sc4238->client, in sc4238_set_ctrl()
2474 ret |= sc4238_write_reg(sc4238->client, in sc4238_set_ctrl()
2482 ret = sc4238_write_reg(sc4238->client, SC4238_REG_VTS_H, in sc4238_set_ctrl()
2484 ctrl->val + sc4238->cur_mode->height); in sc4238_set_ctrl()
2486 sc4238->cur_vts = ctrl->val + sc4238->cur_mode->height; in sc4238_set_ctrl()
2487 sc4238_modify_fps_info(sc4238); in sc4238_set_ctrl()
2492 ret = sc4238_enable_test_pattern(sc4238, ctrl->val); in sc4238_set_ctrl()
2495 ret = sc4238_read_reg(sc4238->client, SC4238_FLIP_REG, in sc4238_set_ctrl()
2502 ret |= sc4238_write_reg(sc4238->client, SC4238_FLIP_REG, in sc4238_set_ctrl()
2506 sc4238->flip = val; in sc4238_set_ctrl()
2509 ret = sc4238_read_reg(sc4238->client, SC4238_FLIP_REG, in sc4238_set_ctrl()
2516 ret |= sc4238_write_reg(sc4238->client, SC4238_FLIP_REG, in sc4238_set_ctrl()
2520 sc4238->flip = val; in sc4238_set_ctrl()
2537 static int sc4238_initialize_controls(struct sc4238 *sc4238) in sc4238_initialize_controls() argument
2547 dev_info(&sc4238->client->dev, "%s(%d)", __func__, __LINE__); in sc4238_initialize_controls()
2549 handler = &sc4238->ctrl_handler; in sc4238_initialize_controls()
2550 mode = sc4238->cur_mode; in sc4238_initialize_controls()
2554 handler->lock = &sc4238->mutex; in sc4238_initialize_controls()
2556 sc4238->link_freq = v4l2_ctrl_new_int_menu(handler, NULL, in sc4238_initialize_controls()
2560 if (sc4238->cur_mode->bus_fmt == MEDIA_BUS_FMT_SBGGR10_1X10) { in sc4238_initialize_controls()
2569 sc4238->pixel_rate = v4l2_ctrl_new_std(handler, NULL, in sc4238_initialize_controls()
2574 __v4l2_ctrl_s_ctrl(sc4238->link_freq, in sc4238_initialize_controls()
2578 sc4238->hblank = v4l2_ctrl_new_std(handler, NULL, V4L2_CID_HBLANK, in sc4238_initialize_controls()
2580 if (sc4238->hblank) in sc4238_initialize_controls()
2581 sc4238->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY; in sc4238_initialize_controls()
2584 sc4238->vblank = v4l2_ctrl_new_std(handler, &sc4238_ctrl_ops, in sc4238_initialize_controls()
2591 sc4238->exposure = v4l2_ctrl_new_std(handler, &sc4238_ctrl_ops, in sc4238_initialize_controls()
2596 sc4238->anal_gain = v4l2_ctrl_new_std(handler, &sc4238_ctrl_ops, in sc4238_initialize_controls()
2601 sc4238->test_pattern = v4l2_ctrl_new_std_menu_items(handler, in sc4238_initialize_controls()
2606 sc4238->h_flip = v4l2_ctrl_new_std(handler, &sc4238_ctrl_ops, in sc4238_initialize_controls()
2609 sc4238->v_flip = v4l2_ctrl_new_std(handler, &sc4238_ctrl_ops, in sc4238_initialize_controls()
2611 sc4238->flip = 0; in sc4238_initialize_controls()
2614 dev_err(&sc4238->client->dev, in sc4238_initialize_controls()
2619 sc4238->subdev.ctrl_handler = handler; in sc4238_initialize_controls()
2620 sc4238->has_init_exp = false; in sc4238_initialize_controls()
2621 sc4238->cur_fps = mode->max_fps; in sc4238_initialize_controls()
2622 sc4238->cur_vts = mode->vts_def; in sc4238_initialize_controls()
2632 static int sc4238_check_sensor_id(struct sc4238 *sc4238, in sc4238_check_sensor_id() argument
2635 struct device *dev = &sc4238->client->dev; in sc4238_check_sensor_id()
2639 if (sc4238->is_thunderboot) { in sc4238_check_sensor_id()
2656 static int sc4238_configure_regulators(struct sc4238 *sc4238) in sc4238_configure_regulators() argument
2661 sc4238->supplies[i].supply = sc4238_supply_names[i]; in sc4238_configure_regulators()
2663 return devm_regulator_bulk_get(&sc4238->client->dev, in sc4238_configure_regulators()
2665 sc4238->supplies); in sc4238_configure_regulators()
2673 struct sc4238 *sc4238; in sc4238_probe() local
2684 sc4238 = devm_kzalloc(dev, sizeof(*sc4238), GFP_KERNEL); in sc4238_probe()
2685 if (!sc4238) in sc4238_probe()
2689 &sc4238->module_index); in sc4238_probe()
2691 &sc4238->module_facing); in sc4238_probe()
2693 &sc4238->module_name); in sc4238_probe()
2695 &sc4238->len_name); in sc4238_probe()
2701 sc4238->is_thunderboot = IS_ENABLED(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP); in sc4238_probe()
2708 sc4238->cfg_num = ARRAY_SIZE(supported_modes); in sc4238_probe()
2709 for (i = 0; i < sc4238->cfg_num; i++) { in sc4238_probe()
2711 sc4238->cur_mode = &supported_modes[i]; in sc4238_probe()
2715 if (sc4238->cur_mode == NULL) in sc4238_probe()
2716 sc4238->cur_mode = &supported_modes[0]; in sc4238_probe()
2717 sc4238->client = client; in sc4238_probe()
2719 sc4238->xvclk = devm_clk_get(dev, "xvclk"); in sc4238_probe()
2720 if (IS_ERR(sc4238->xvclk)) { in sc4238_probe()
2725 sc4238->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); in sc4238_probe()
2726 if (IS_ERR(sc4238->reset_gpio)) in sc4238_probe()
2729 sc4238->pwdn_gpio = devm_gpiod_get(dev, "pwdn", GPIOD_OUT_LOW); in sc4238_probe()
2730 if (IS_ERR(sc4238->pwdn_gpio)) in sc4238_probe()
2733 sc4238->pinctrl = devm_pinctrl_get(dev); in sc4238_probe()
2734 if (!IS_ERR(sc4238->pinctrl)) { in sc4238_probe()
2735 sc4238->pins_default = in sc4238_probe()
2736 pinctrl_lookup_state(sc4238->pinctrl, in sc4238_probe()
2738 if (IS_ERR(sc4238->pins_default)) in sc4238_probe()
2741 sc4238->pins_sleep = in sc4238_probe()
2742 pinctrl_lookup_state(sc4238->pinctrl, in sc4238_probe()
2744 if (IS_ERR(sc4238->pins_sleep)) in sc4238_probe()
2750 ret = sc4238_configure_regulators(sc4238); in sc4238_probe()
2756 mutex_init(&sc4238->mutex); in sc4238_probe()
2758 sd = &sc4238->subdev; in sc4238_probe()
2760 ret = sc4238_initialize_controls(sc4238); in sc4238_probe()
2764 ret = __sc4238_power_on(sc4238); in sc4238_probe()
2768 ret = sc4238_check_sensor_id(sc4238, client); in sc4238_probe()
2777 sc4238->pad.flags = MEDIA_PAD_FL_SOURCE; in sc4238_probe()
2779 ret = media_entity_pads_init(&sd->entity, 1, &sc4238->pad); in sc4238_probe()
2785 if (strcmp(sc4238->module_facing, "back") == 0) in sc4238_probe()
2791 sc4238->module_index, facing, in sc4238_probe()
2809 __sc4238_power_off(sc4238); in sc4238_probe()
2811 v4l2_ctrl_handler_free(&sc4238->ctrl_handler); in sc4238_probe()
2813 mutex_destroy(&sc4238->mutex); in sc4238_probe()
2821 struct sc4238 *sc4238 = to_sc4238(sd); in sc4238_remove() local
2827 v4l2_ctrl_handler_free(&sc4238->ctrl_handler); in sc4238_remove()
2828 mutex_destroy(&sc4238->mutex); in sc4238_remove()
2832 __sc4238_power_off(sc4238); in sc4238_remove()