Lines Matching refs:rval
71 int rval; in smiapp_read_frame_fmt() local
76 rval = smiapp_read(sensor, SMIAPP_REG_U8_FRAME_FORMAT_MODEL_TYPE, in smiapp_read_frame_fmt()
78 if (rval) in smiapp_read_frame_fmt()
79 return rval; in smiapp_read_frame_fmt()
81 rval = smiapp_read(sensor, SMIAPP_REG_U8_FRAME_FORMAT_MODEL_SUBTYPE, in smiapp_read_frame_fmt()
83 if (rval) in smiapp_read_frame_fmt()
84 return rval; in smiapp_read_frame_fmt()
106 rval = smiapp_read( in smiapp_read_frame_fmt()
110 if (rval) in smiapp_read_frame_fmt()
111 return rval; in smiapp_read_frame_fmt()
120 rval = smiapp_read( in smiapp_read_frame_fmt()
124 if (rval) in smiapp_read_frame_fmt()
125 return rval; in smiapp_read_frame_fmt()
203 int rval; in smiapp_pll_configure() local
205 rval = smiapp_write( in smiapp_pll_configure()
207 if (rval < 0) in smiapp_pll_configure()
208 return rval; in smiapp_pll_configure()
210 rval = smiapp_write( in smiapp_pll_configure()
212 if (rval < 0) in smiapp_pll_configure()
213 return rval; in smiapp_pll_configure()
215 rval = smiapp_write( in smiapp_pll_configure()
217 if (rval < 0) in smiapp_pll_configure()
218 return rval; in smiapp_pll_configure()
220 rval = smiapp_write( in smiapp_pll_configure()
222 if (rval < 0) in smiapp_pll_configure()
223 return rval; in smiapp_pll_configure()
226 rval = smiapp_write( in smiapp_pll_configure()
229 if (rval < 0 || sensor->minfo.smiapp_profile == SMIAPP_PROFILE_0) in smiapp_pll_configure()
230 return rval; in smiapp_pll_configure()
232 rval = smiapp_write( in smiapp_pll_configure()
234 if (rval < 0) in smiapp_pll_configure()
235 return rval; in smiapp_pll_configure()
283 int rval; in smiapp_pll_update() local
292 rval = smiapp_pll_try(sensor, pll); in smiapp_pll_update()
293 if (rval < 0) in smiapp_pll_update()
294 return rval; in smiapp_pll_update()
421 int rval; in smiapp_set_ctrl() local
446 rval = smiapp_write(sensor, in smiapp_set_ctrl()
449 if (rval < 0) in smiapp_set_ctrl()
450 return rval; in smiapp_set_ctrl()
464 rval = smiapp_set_ctrl( in smiapp_set_ctrl()
466 if (rval < 0) in smiapp_set_ctrl()
467 return rval; in smiapp_set_ctrl()
532 int rval; in smiapp_init_controls() local
534 rval = v4l2_ctrl_handler_init(&sensor->pixel_array->ctrl_handler, 12); in smiapp_init_controls()
535 if (rval) in smiapp_init_controls()
536 return rval; in smiapp_init_controls()
595 rval = v4l2_ctrl_handler_init(&sensor->src->ctrl_handler, 0); in smiapp_init_controls()
596 if (rval) in smiapp_init_controls()
597 return rval; in smiapp_init_controls()
660 int rval; in smiapp_get_limits() local
663 rval = smiapp_read( in smiapp_get_limits()
665 if (rval) in smiapp_get_limits()
666 return rval; in smiapp_get_limits()
679 int rval; in smiapp_get_all_limits() local
682 rval = smiapp_get_limits(sensor, &i, 1); in smiapp_get_all_limits()
683 if (rval < 0) in smiapp_get_all_limits()
684 return rval; in smiapp_get_all_limits()
715 int rval; in smiapp_get_limits_binning() local
726 rval = smiapp_get_limits(sensor, limits, ARRAY_SIZE(limits)); in smiapp_get_limits_binning()
727 if (rval < 0) in smiapp_get_limits_binning()
728 return rval; in smiapp_get_limits_binning()
759 int rval; in smiapp_get_mbus_formats() local
761 rval = smiapp_read( in smiapp_get_mbus_formats()
763 if (rval) in smiapp_get_mbus_formats()
764 return rval; in smiapp_get_mbus_formats()
768 rval = smiapp_read(sensor, SMIAPP_REG_U8_PIXEL_ORDER, in smiapp_get_mbus_formats()
770 if (rval) in smiapp_get_mbus_formats()
771 return rval; in smiapp_get_mbus_formats()
798 rval = smiapp_read( in smiapp_get_mbus_formats()
801 if (rval) in smiapp_get_mbus_formats()
802 return rval; in smiapp_get_mbus_formats()
847 rval = smiapp_pll_try(sensor, pll); in smiapp_get_mbus_formats()
850 rval ? "not ok" : "ok"); in smiapp_get_mbus_formats()
851 if (rval) in smiapp_get_mbus_formats()
915 int rval; in smiapp_update_mode() local
932 rval = smiapp_write( in smiapp_update_mode()
934 if (rval < 0) in smiapp_update_mode()
935 return rval; in smiapp_update_mode()
939 rval = smiapp_write(sensor, SMIAPP_REG_U8_BINNING_MODE, binning_mode); in smiapp_update_mode()
940 if (rval < 0) in smiapp_update_mode()
941 return rval; in smiapp_update_mode()
944 rval = smiapp_get_limits_binning(sensor); in smiapp_update_mode()
945 if (rval < 0) in smiapp_update_mode()
946 return rval; in smiapp_update_mode()
948 rval = smiapp_pll_update(sensor); in smiapp_update_mode()
949 if (rval < 0) in smiapp_update_mode()
950 return rval; in smiapp_update_mode()
977 int rval = 0, rval2; in smiapp_read_nvm() local
981 rval = smiapp_write( in smiapp_read_nvm()
984 if (rval) in smiapp_read_nvm()
987 rval = smiapp_write(sensor, in smiapp_read_nvm()
991 if (rval) in smiapp_read_nvm()
995 rval = smiapp_read( in smiapp_read_nvm()
999 if (rval) in smiapp_read_nvm()
1006 rval = -ETIMEDOUT; in smiapp_read_nvm()
1013 rval = smiapp_read( in smiapp_read_nvm()
1017 if (rval) in smiapp_read_nvm()
1026 if (rval < 0) in smiapp_read_nvm()
1027 return rval; in smiapp_read_nvm()
1040 int rval; in smiapp_change_cci_addr() local
1045 rval = smiapp_write(sensor, in smiapp_change_cci_addr()
1048 if (rval) in smiapp_change_cci_addr()
1049 return rval; in smiapp_change_cci_addr()
1054 rval = smiapp_read(sensor, SMIAPP_REG_U8_CCI_ADDRESS_CONTROL, &val); in smiapp_change_cci_addr()
1055 if (rval) in smiapp_change_cci_addr()
1056 return rval; in smiapp_change_cci_addr()
1076 int rval; in smiapp_setup_flash_strobe() local
1160 rval = smiapp_write(sensor, SMIAPP_REG_U8_FLASH_MODE_RS, in smiapp_setup_flash_strobe()
1162 if (rval < 0) in smiapp_setup_flash_strobe()
1165 rval = smiapp_write(sensor, SMIAPP_REG_U8_FLASH_STROBE_ADJUSTMENT, in smiapp_setup_flash_strobe()
1167 if (rval < 0) in smiapp_setup_flash_strobe()
1170 rval = smiapp_write( in smiapp_setup_flash_strobe()
1173 if (rval < 0) in smiapp_setup_flash_strobe()
1176 rval = smiapp_write(sensor, SMIAPP_REG_U16_TFLASH_STROBE_DELAY_RS_CTRL, in smiapp_setup_flash_strobe()
1178 if (rval < 0) in smiapp_setup_flash_strobe()
1181 rval = smiapp_write(sensor, SMIAPP_REG_U16_FLASH_STROBE_START_POINT, in smiapp_setup_flash_strobe()
1183 if (rval < 0) in smiapp_setup_flash_strobe()
1186 rval = smiapp_write(sensor, SMIAPP_REG_U8_FLASH_TRIGGER_RS, in smiapp_setup_flash_strobe()
1192 return rval; in smiapp_setup_flash_strobe()
1203 int rval; in smiapp_power_on() local
1205 rval = regulator_enable(sensor->vana); in smiapp_power_on()
1206 if (rval) { in smiapp_power_on()
1208 return rval; in smiapp_power_on()
1212 rval = clk_prepare_enable(sensor->ext_clk); in smiapp_power_on()
1213 if (rval < 0) { in smiapp_power_on()
1236 rval = smiapp_change_cci_addr(sensor); in smiapp_power_on()
1237 if (rval) { in smiapp_power_on()
1243 rval = smiapp_write(sensor, SMIAPP_REG_U8_SOFTWARE_RESET, in smiapp_power_on()
1245 if (rval < 0) { in smiapp_power_on()
1251 rval = smiapp_change_cci_addr(sensor); in smiapp_power_on()
1252 if (rval) { in smiapp_power_on()
1258 rval = smiapp_write(sensor, SMIAPP_REG_U16_COMPRESSION_MODE, in smiapp_power_on()
1260 if (rval) { in smiapp_power_on()
1265 rval = smiapp_write( in smiapp_power_on()
1268 if (rval) { in smiapp_power_on()
1273 rval = smiapp_write(sensor, SMIAPP_REG_U8_CSI_LANE_MODE, in smiapp_power_on()
1275 if (rval) { in smiapp_power_on()
1280 rval = smiapp_write(sensor, SMIAPP_REG_U8_FAST_STANDBY_CTRL, in smiapp_power_on()
1282 if (rval) { in smiapp_power_on()
1287 rval = smiapp_write(sensor, SMIAPP_REG_U8_CSI_SIGNALLING_MODE, in smiapp_power_on()
1289 if (rval) { in smiapp_power_on()
1295 rval = smiapp_write(sensor, SMIAPP_REG_U8_DPHY_CTRL, in smiapp_power_on()
1297 if (rval < 0) in smiapp_power_on()
1298 return rval; in smiapp_power_on()
1300 rval = smiapp_call_quirk(sensor, post_poweron); in smiapp_power_on()
1301 if (rval) { in smiapp_power_on()
1310 rval = v4l2_ctrl_handler_setup( in smiapp_power_on()
1312 if (rval) in smiapp_power_on()
1315 rval = v4l2_ctrl_handler_setup(&sensor->src->ctrl_handler); in smiapp_power_on()
1316 if (rval) in smiapp_power_on()
1320 rval = smiapp_update_mode(sensor); in smiapp_power_on()
1322 if (rval < 0) in smiapp_power_on()
1333 return rval; in smiapp_power_on()
1389 int rval; in smiapp_start_streaming() local
1393 rval = smiapp_write(sensor, SMIAPP_REG_U16_CSI_DATA_FORMAT, in smiapp_start_streaming()
1396 if (rval) in smiapp_start_streaming()
1399 rval = smiapp_pll_configure(sensor); in smiapp_start_streaming()
1400 if (rval) in smiapp_start_streaming()
1404 rval = smiapp_write(sensor, SMIAPP_REG_U16_X_ADDR_START, in smiapp_start_streaming()
1406 if (rval < 0) in smiapp_start_streaming()
1409 rval = smiapp_write(sensor, SMIAPP_REG_U16_Y_ADDR_START, in smiapp_start_streaming()
1411 if (rval < 0) in smiapp_start_streaming()
1415 rval = smiapp_write( in smiapp_start_streaming()
1419 if (rval < 0) in smiapp_start_streaming()
1422 rval = smiapp_write( in smiapp_start_streaming()
1426 if (rval < 0) in smiapp_start_streaming()
1437 rval = smiapp_write( in smiapp_start_streaming()
1440 if (rval < 0) in smiapp_start_streaming()
1443 rval = smiapp_write( in smiapp_start_streaming()
1446 if (rval < 0) in smiapp_start_streaming()
1449 rval = smiapp_write( in smiapp_start_streaming()
1452 if (rval < 0) in smiapp_start_streaming()
1455 rval = smiapp_write( in smiapp_start_streaming()
1458 if (rval < 0) in smiapp_start_streaming()
1465 rval = smiapp_write(sensor, SMIAPP_REG_U16_SCALING_MODE, in smiapp_start_streaming()
1467 if (rval < 0) in smiapp_start_streaming()
1470 rval = smiapp_write(sensor, SMIAPP_REG_U16_SCALE_M, in smiapp_start_streaming()
1472 if (rval < 0) in smiapp_start_streaming()
1477 rval = smiapp_write(sensor, SMIAPP_REG_U16_X_OUTPUT_SIZE, in smiapp_start_streaming()
1479 if (rval < 0) in smiapp_start_streaming()
1481 rval = smiapp_write(sensor, SMIAPP_REG_U16_Y_OUTPUT_SIZE, in smiapp_start_streaming()
1483 if (rval < 0) in smiapp_start_streaming()
1491 rval = smiapp_setup_flash_strobe(sensor); in smiapp_start_streaming()
1492 if (rval) in smiapp_start_streaming()
1496 rval = smiapp_call_quirk(sensor, pre_streamon); in smiapp_start_streaming()
1497 if (rval) { in smiapp_start_streaming()
1502 rval = smiapp_write(sensor, SMIAPP_REG_U8_MODE_SELECT, in smiapp_start_streaming()
1508 return rval; in smiapp_start_streaming()
1514 int rval; in smiapp_stop_streaming() local
1517 rval = smiapp_write(sensor, SMIAPP_REG_U8_MODE_SELECT, in smiapp_stop_streaming()
1519 if (rval) in smiapp_stop_streaming()
1522 rval = smiapp_call_quirk(sensor, post_streamoff); in smiapp_stop_streaming()
1523 if (rval) in smiapp_stop_streaming()
1528 return rval; in smiapp_stop_streaming()
1538 int rval; in smiapp_set_stream() local
1545 rval = smiapp_start_streaming(sensor); in smiapp_set_stream()
1546 if (rval < 0) in smiapp_set_stream()
1549 rval = smiapp_stop_streaming(sensor); in smiapp_set_stream()
1553 return rval; in smiapp_set_stream()
1564 int rval = -EINVAL; in smiapp_enum_mbus_code() local
1576 rval = 0; in smiapp_enum_mbus_code()
1588 rval = 0; in smiapp_enum_mbus_code()
1596 return rval; in smiapp_enum_mbus_code()
1640 int rval; in smiapp_get_format() local
1643 rval = __smiapp_get_format(subdev, cfg, fmt); in smiapp_get_format()
1646 return rval; in smiapp_get_format()
1739 int rval; in smiapp_set_format_source() local
1741 rval = __smiapp_get_format(subdev, cfg, fmt); in smiapp_set_format_source()
1742 if (rval) in smiapp_set_format_source()
1743 return rval; in smiapp_set_format_source()
1793 int rval; in smiapp_set_format() local
1795 rval = smiapp_set_format_source(subdev, cfg, fmt); in smiapp_set_format()
1799 return rval; in smiapp_set_format()
2224 int rval; in smiapp_get_selection() local
2227 rval = __smiapp_get_selection(subdev, cfg, sel); in smiapp_get_selection()
2230 return rval; in smiapp_get_selection()
2351 int rval = 0; in smiapp_identify_module() local
2356 rval = smiapp_read_8only(sensor, SMIAPP_REG_U8_MANUFACTURER_ID, in smiapp_identify_module()
2358 if (!rval) in smiapp_identify_module()
2359 rval = smiapp_read_8only(sensor, SMIAPP_REG_U16_MODEL_ID, in smiapp_identify_module()
2361 if (!rval) in smiapp_identify_module()
2362 rval = smiapp_read_8only(sensor, in smiapp_identify_module()
2365 if (!rval) in smiapp_identify_module()
2366 rval = smiapp_read_8only(sensor, in smiapp_identify_module()
2369 if (!rval) in smiapp_identify_module()
2370 rval = smiapp_read_8only(sensor, in smiapp_identify_module()
2373 if (!rval) in smiapp_identify_module()
2374 rval = smiapp_read_8only(sensor, in smiapp_identify_module()
2377 if (!rval) in smiapp_identify_module()
2378 rval = smiapp_read_8only(sensor, SMIAPP_REG_U8_MODULE_DATE_DAY, in smiapp_identify_module()
2382 if (!rval) in smiapp_identify_module()
2383 rval = smiapp_read_8only(sensor, in smiapp_identify_module()
2386 if (!rval) in smiapp_identify_module()
2387 rval = smiapp_read_8only(sensor, in smiapp_identify_module()
2390 if (!rval) in smiapp_identify_module()
2391 rval = smiapp_read_8only(sensor, in smiapp_identify_module()
2394 if (!rval) in smiapp_identify_module()
2395 rval = smiapp_read_8only(sensor, in smiapp_identify_module()
2400 if (!rval) in smiapp_identify_module()
2401 rval = smiapp_read_8only(sensor, SMIAPP_REG_U8_SMIA_VERSION, in smiapp_identify_module()
2403 if (!rval) in smiapp_identify_module()
2404 rval = smiapp_read_8only(sensor, SMIAPP_REG_U8_SMIAPP_VERSION, in smiapp_identify_module()
2407 if (rval) { in smiapp_identify_module()
2487 int rval; in smiapp_register_subdevs() local
2496 rval = media_entity_pads_init(&this->sd.entity, in smiapp_register_subdevs()
2498 if (rval) { in smiapp_register_subdevs()
2501 return rval; in smiapp_register_subdevs()
2504 rval = v4l2_device_register_subdev(sensor->src->sd.v4l2_dev, in smiapp_register_subdevs()
2506 if (rval) { in smiapp_register_subdevs()
2509 return rval; in smiapp_register_subdevs()
2512 rval = media_create_pad_link(&this->sd.entity, in smiapp_register_subdevs()
2518 if (rval) { in smiapp_register_subdevs()
2521 return rval; in smiapp_register_subdevs()
2544 int rval; in smiapp_init() local
2559 rval = clk_set_rate(sensor->ext_clk, in smiapp_init()
2561 if (rval < 0) { in smiapp_init()
2565 return rval; in smiapp_init()
2573 rval = smiapp_power_on(sensor); in smiapp_init()
2574 if (rval) in smiapp_init()
2577 rval = smiapp_identify_module(sensor); in smiapp_init()
2578 if (rval) { in smiapp_init()
2579 rval = -ENODEV; in smiapp_init()
2583 rval = smiapp_get_all_limits(sensor); in smiapp_init()
2584 if (rval) { in smiapp_init()
2585 rval = -ENODEV; in smiapp_init()
2607 rval = smiapp_call_quirk(sensor, limits); in smiapp_init()
2608 if (rval) { in smiapp_init()
2616 rval = smiapp_read(sensor, in smiapp_init()
2618 if (rval < 0) { in smiapp_init()
2619 rval = -ENODEV; in smiapp_init()
2626 rval = smiapp_read( in smiapp_init()
2628 if (rval < 0) { in smiapp_init()
2629 rval = -ENODEV; in smiapp_init()
2645 rval = -ENOENT; in smiapp_init()
2656 rval = -ENOMEM; in smiapp_init()
2662 rval = -EBUSY; in smiapp_init()
2768 rval = smiapp_init_controls(sensor); in smiapp_init()
2769 if (rval < 0) in smiapp_init()
2772 rval = smiapp_call_quirk(sensor, init); in smiapp_init()
2773 if (rval) in smiapp_init()
2776 rval = smiapp_get_mbus_formats(sensor); in smiapp_init()
2777 if (rval) { in smiapp_init()
2778 rval = -ENODEV; in smiapp_init()
2782 rval = smiapp_init_late_controls(sensor); in smiapp_init()
2783 if (rval) { in smiapp_init()
2784 rval = -ENODEV; in smiapp_init()
2789 rval = smiapp_update_mode(sensor); in smiapp_init()
2791 if (rval) { in smiapp_init()
2808 return rval; in smiapp_init()
2815 int rval; in smiapp_registered() local
2818 rval = smiapp_init(sensor); in smiapp_registered()
2819 if (rval) in smiapp_registered()
2820 return rval; in smiapp_registered()
2823 rval = smiapp_register_subdevs(sensor); in smiapp_registered()
2824 if (rval) in smiapp_registered()
2827 return rval; in smiapp_registered()
2952 int rval; in smiapp_resume() local
2957 rval = smiapp_power_on(sensor); in smiapp_resume()
2958 if (rval) in smiapp_resume()
2959 return rval; in smiapp_resume()
2962 rval = smiapp_start_streaming(sensor); in smiapp_resume()
2964 return rval; in smiapp_resume()
2980 int rval; in smiapp_get_hwconfig() local
3013 rval = of_property_read_u32(dev->of_node, "clock-frequency", in smiapp_get_hwconfig()
3015 if (rval) { in smiapp_get_hwconfig()
3054 int rval; in smiapp_probe() local
3074 rval = media_entity_pads_init(&sensor->src->sd.entity, 2, in smiapp_probe()
3076 if (rval < 0) in smiapp_probe()
3077 return rval; in smiapp_probe()
3080 rval = smiapp_init(sensor); in smiapp_probe()
3081 if (rval) in smiapp_probe()
3085 rval = v4l2_async_register_subdev(&sensor->src->sd); in smiapp_probe()
3086 if (rval < 0) in smiapp_probe()
3094 return rval; in smiapp_probe()