Lines Matching refs:rval

377 	int rval;
379 rval = ccs_write(sensor, VT_PIX_CLK_DIV, pll->vt_bk.pix_clk_div);
380 if (rval < 0)
381 return rval;
383 rval = ccs_write(sensor, VT_SYS_CLK_DIV, pll->vt_bk.sys_clk_div);
384 if (rval < 0)
385 return rval;
387 rval = ccs_write(sensor, PRE_PLL_CLK_DIV, pll->vt_fr.pre_pll_clk_div);
388 if (rval < 0)
389 return rval;
391 rval = ccs_write(sensor, PLL_MULTIPLIER, pll->vt_fr.pll_multiplier);
392 if (rval < 0)
393 return rval;
398 rval = ccs_write(sensor, REQUESTED_LINK_RATE,
405 if (rval < 0)
406 return rval;
412 rval = ccs_write(sensor, OP_PIX_CLK_DIV, pll->op_bk.pix_clk_div);
413 if (rval < 0)
414 return rval;
416 rval = ccs_write(sensor, OP_SYS_CLK_DIV, pll->op_bk.sys_clk_div);
417 if (rval < 0)
418 return rval;
423 rval = ccs_write(sensor, PLL_MODE, CCS_PLL_MODE_DUAL);
424 if (rval < 0)
425 return rval;
427 rval = ccs_write(sensor, OP_PRE_PLL_CLK_DIV,
429 if (rval < 0)
430 return rval;
489 int rval;
498 rval = ccs_pll_try(sensor, pll);
499 if (rval < 0)
500 return rval;
628 int rval;
652 rval = ccs_set_ctrl(sensor->exposure);
653 if (rval < 0)
654 return rval;
662 rval = ccs_pll_update(sensor);
663 if (rval)
664 return rval;
683 rval = ccs_write(sensor, ANALOG_GAIN_CODE_GLOBAL, ctrl->val);
688 rval = ccs_write(sensor, ANALOG_LINEAR_GAIN_GLOBAL, ctrl->val);
693 rval = ccs_write(sensor, ANALOG_EXPONENTIAL_GAIN_GLOBAL,
701 rval = ccs_write(sensor, DIGITAL_GAIN_GLOBAL,
706 rval = ccs_write_addr(sensor,
709 if (rval)
712 rval = ccs_write_addr(sensor,
715 if (rval)
718 rval = ccs_write_addr(sensor,
721 if (rval)
724 rval = ccs_write_addr(sensor,
730 rval = ccs_write(sensor, COARSE_INTEGRATION_TIME, ctrl->val);
735 rval = ccs_write(sensor, IMAGE_ORIENTATION, orient);
739 rval = ccs_write(sensor, FRAME_LENGTH_LINES,
744 rval = ccs_write(sensor, LINE_LENGTH_PCK,
749 rval = ccs_write(sensor, TEST_PATTERN_MODE, ctrl->val);
753 rval = ccs_write(sensor, TEST_DATA_RED, ctrl->val);
757 rval = ccs_write(sensor, TEST_DATA_GREENR, ctrl->val);
761 rval = ccs_write(sensor, TEST_DATA_BLUE, ctrl->val);
765 rval = ccs_write(sensor, TEST_DATA_GREENB, ctrl->val);
769 rval = ccs_write(sensor, SHADING_CORRECTION_EN,
773 if (!rval && sensor->luminance_level)
778 rval = ccs_write(sensor, LUMINANCE_CORRECTION_LEVEL, ctrl->val);
783 rval = 0;
787 rval = -EINVAL;
795 return rval;
806 int rval;
808 rval = v4l2_ctrl_handler_init(&sensor->pixel_array->ctrl_handler, 19);
809 if (rval)
810 return rval;
814 rval = v4l2_fwnode_device_parse(&client->dev, &props);
815 if (rval)
816 return rval;
818 rval = v4l2_ctrl_new_fwnode_properties(&sensor->pixel_array->ctrl_handler,
820 if (rval)
821 return rval;
1003 rval = v4l2_ctrl_handler_init(&sensor->src->ctrl_handler, 0);
1004 if (rval)
1005 return rval;
1067 int rval;
1073 rval = ccs_read(sensor, PIXEL_ORDER, &pixel_order);
1074 if (rval)
1075 return rval;
1163 rval = ccs_pll_try(sensor, pll);
1166 rval ? "not ok" : "ok");
1167 if (rval)
1239 int rval;
1241 rval = ccs_pll_update(sensor);
1242 if (rval < 0)
1243 return rval;
1269 int rval;
1274 rval = ccs_write(sensor, DATA_TRANSFER_IF_1_PAGE_SELECT, p);
1275 if (rval)
1276 return rval;
1278 rval = ccs_write(sensor, DATA_TRANSFER_IF_1_CTRL,
1280 if (rval)
1281 return rval;
1283 rval = ccs_read(sensor, DATA_TRANSFER_IF_1_STATUS, &s);
1284 if (rval)
1285 return rval;
1298 rval = ccs_read(sensor, DATA_TRANSFER_IF_1_STATUS, &s);
1299 if (rval)
1300 return rval;
1310 rval = ccs_read(sensor, DATA_TRANSFER_IF_1_DATA(i), &v);
1311 if (rval)
1312 return rval;
1325 int rval = 0, rval2;
1328 && !rval; p++) {
1329 rval = ccs_read_nvm_page(sensor, p, nvm, &status);
1333 if (rval == -ENODATA &&
1335 rval = 0;
1338 if (rval < 0)
1339 return rval;
1352 int rval;
1357 rval = ccs_write(sensor, CCI_ADDRESS_CTRL,
1359 if (rval)
1360 return rval;
1365 rval = ccs_read(sensor, CCI_ADDRESS_CTRL, &val);
1366 if (rval)
1367 return rval;
1387 int rval;
1471 rval = ccs_write(sensor, FLASH_MODE_RS, strobe_setup->mode);
1472 if (rval < 0)
1475 rval = ccs_write(sensor, FLASH_STROBE_ADJUSTMENT, strobe_adjustment);
1476 if (rval < 0)
1479 rval = ccs_write(sensor, TFLASH_STROBE_WIDTH_HIGH_RS_CTRL,
1481 if (rval < 0)
1484 rval = ccs_write(sensor, TFLASH_STROBE_DELAY_RS_CTRL,
1486 if (rval < 0)
1489 rval = ccs_write(sensor, FLASH_STROBE_START_POINT,
1491 if (rval < 0)
1494 rval = ccs_write(sensor, FLASH_TRIGGER_RS, strobe_setup->trigger);
1499 return rval;
1508 int rval;
1510 rval = ccs_write_data_regs(sensor,
1513 if (rval)
1514 return rval;
1554 int rval;
1556 rval = regulator_bulk_enable(ARRAY_SIZE(ccs_regulators),
1558 if (rval) {
1560 return rval;
1566 rval = clk_prepare_enable(sensor->ext_clk);
1567 if (rval < 0) {
1598 rval = ccs_write(sensor, SOFTWARE_RESET, CCS_SOFTWARE_RESET_ON);
1599 if (rval < 0) {
1605 rval = ccs_read(sensor, SOFTWARE_RESET, &reset);
1606 reset = !rval && reset == CCS_SOFTWARE_RESET_OFF;
1615 rval = -EIO;
1621 rval = ccs_change_cci_addr(sensor);
1622 if (rval) {
1628 rval = ccs_write(sensor, COMPRESSION_MODE,
1630 if (rval) {
1635 rval = ccs_write(sensor, EXTCLK_FREQUENCY_MHZ,
1637 if (rval) {
1642 rval = ccs_write(sensor, CSI_LANE_MODE, sensor->hwcfg.lanes - 1);
1643 if (rval) {
1648 rval = ccs_write(sensor, FAST_STANDBY_CTRL,
1650 if (rval) {
1655 rval = ccs_write(sensor, CSI_SIGNALING_MODE,
1657 if (rval) {
1662 rval = ccs_update_phy_ctrl(sensor);
1663 if (rval < 0)
1666 rval = ccs_write_msr_regs(sensor);
1667 if (rval)
1670 rval = ccs_call_quirk(sensor, post_poweron);
1671 if (rval) {
1687 return rval;
1726 int rval;
1730 rval = ccs_write(sensor, CSI_DATA_FORMAT,
1733 if (rval)
1745 rval = ccs_write(sensor, BINNING_TYPE, binning_type);
1746 if (rval < 0)
1751 rval = ccs_write(sensor, BINNING_MODE, binning_mode);
1752 if (rval < 0)
1756 rval = ccs_pll_configure(sensor);
1757 if (rval)
1761 rval = ccs_write(sensor, X_ADDR_START, sensor->pa_src.left);
1762 if (rval < 0)
1765 rval = ccs_write(sensor, Y_ADDR_START, sensor->pa_src.top);
1766 if (rval < 0)
1770 rval = ccs_write(sensor, X_ADDR_END,
1772 if (rval < 0)
1775 rval = ccs_write(sensor, Y_ADDR_END,
1777 if (rval < 0)
1788 rval = ccs_write(sensor, DIGITAL_CROP_X_OFFSET,
1790 if (rval < 0)
1793 rval = ccs_write(sensor, DIGITAL_CROP_Y_OFFSET,
1795 if (rval < 0)
1798 rval = ccs_write(sensor, DIGITAL_CROP_IMAGE_WIDTH,
1800 if (rval < 0)
1803 rval = ccs_write(sensor, DIGITAL_CROP_IMAGE_HEIGHT,
1805 if (rval < 0)
1812 rval = ccs_write(sensor, SCALING_MODE, sensor->scaling_mode);
1813 if (rval < 0)
1816 rval = ccs_write(sensor, SCALE_M, sensor->scale_m);
1817 if (rval < 0)
1822 rval = ccs_write(sensor, X_OUTPUT_SIZE, sensor->src_src.width);
1823 if (rval < 0)
1825 rval = ccs_write(sensor, Y_OUTPUT_SIZE, sensor->src_src.height);
1826 if (rval < 0)
1834 rval = ccs_setup_flash_strobe(sensor);
1835 if (rval)
1839 rval = ccs_call_quirk(sensor, pre_streamon);
1840 if (rval) {
1845 rval = ccs_write(sensor, MODE_SELECT, CCS_MODE_SELECT_STREAMING);
1850 return rval;
1856 int rval;
1859 rval = ccs_write(sensor, MODE_SELECT, CCS_MODE_SELECT_SOFTWARE_STANDBY);
1860 if (rval)
1863 rval = ccs_call_quirk(sensor, post_streamoff);
1864 if (rval)
1869 return rval;
1879 int rval;
1886 rval = pm_runtime_get_sync(&client->dev);
1887 if (rval < 0)
1891 if (rval == 1 && !sensor->handler_setup_needed)
1897 rval = v4l2_ctrl_handler_setup(&sensor->pixel_array->ctrl_handler);
1898 if (rval)
1901 rval = v4l2_ctrl_handler_setup(&sensor->src->ctrl_handler);
1902 if (rval)
1909 return rval;
1916 int rval;
1927 rval = ccs_pm_get_init(sensor);
1928 if (rval)
1929 return rval;
1933 rval = ccs_start_streaming(sensor);
1934 if (rval < 0) {
1940 return rval;
1947 int rval;
1966 rval = ccs_pm_get_init(sensor);
1967 if (rval)
1968 return rval;
1971 rval = ccs_write(sensor, MANUAL_LP_CTRL,
1973 if (rval)
1977 return rval;
1996 int rval = -EINVAL;
2008 rval = 0;
2020 rval = 0;
2028 return rval;
2056 int rval;
2059 rval = __ccs_get_format(subdev, sd_state, fmt);
2062 return rval;
2147 int rval;
2149 rval = __ccs_get_format(subdev, sd_state, fmt);
2150 if (rval)
2151 return rval;
2201 int rval;
2203 rval = ccs_set_format_source(subdev, sd_state, fmt);
2207 return rval;
2668 int rval;
2673 rval = ccs_pm_get_init(sensor);
2674 if (rval < 0)
2677 rval = ccs_read_nvm(sensor, buf, PAGE_SIZE);
2678 if (rval < 0) {
2691 return rval;
2723 int rval = 0;
2726 rval = ccs_read(sensor, MODULE_MANUFACTURER_ID,
2728 if (!rval && !minfo->mipi_manufacturer_id)
2729 rval = ccs_read_addr(sensor, SMIAPP_REG_U8_MANUFACTURER_ID,
2731 if (!rval)
2732 rval = ccs_read(sensor, MODULE_MODEL_ID, &minfo->model_id);
2733 if (!rval)
2734 rval = ccs_read(sensor, MODULE_REVISION_NUMBER_MAJOR, &rev);
2735 if (!rval) {
2736 rval = ccs_read(sensor, MODULE_REVISION_NUMBER_MINOR,
2740 if (!rval)
2741 rval = ccs_read(sensor, MODULE_DATE_YEAR, &minfo->module_year);
2742 if (!rval)
2743 rval = ccs_read(sensor, MODULE_DATE_MONTH,
2745 if (!rval)
2746 rval = ccs_read(sensor, MODULE_DATE_DAY, &minfo->module_day);
2749 if (!rval)
2750 rval = ccs_read(sensor, SENSOR_MANUFACTURER_ID,
2752 if (!rval && !minfo->sensor_mipi_manufacturer_id)
2753 rval = ccs_read(sensor, SENSOR_MANUFACTURER_ID,
2755 if (!rval)
2756 rval = ccs_read(sensor, SENSOR_MODEL_ID,
2758 if (!rval)
2759 rval = ccs_read(sensor, SENSOR_REVISION_NUMBER,
2761 if (!rval && !minfo->sensor_revision_number)
2762 rval = ccs_read(sensor, SENSOR_REVISION_NUMBER_16,
2764 if (!rval)
2765 rval = ccs_read(sensor, SENSOR_FIRMWARE_VERSION,
2769 if (!rval)
2770 rval = ccs_read(sensor, MIPI_CCS_VERSION, &minfo->ccs_version);
2771 if (!rval && !minfo->ccs_version)
2772 rval = ccs_read_addr(sensor, SMIAPP_REG_U8_SMIA_VERSION,
2774 if (!rval && !minfo->ccs_version)
2775 rval = ccs_read_addr(sensor, SMIAPP_REG_U8_SMIAPP_VERSION,
2778 if (rval) {
2878 int rval;
2883 rval = v4l2_device_register_subdev(sensor->src->sd.v4l2_dev, &ssd->sd);
2884 if (rval) {
2886 return rval;
2889 rval = media_create_pad_link(&ssd->sd.entity, source_pad,
2892 if (rval) {
2895 return rval;
2913 int rval;
2916 rval = ccs_register_subdev(sensor, sensor->binner,
2921 if (rval < 0)
2922 return rval;
2925 rval = ccs_register_subdev(sensor, sensor->pixel_array, sensor->binner,
2929 if (rval)
2937 return rval;
2963 int rval;
2992 rval = media_entity_pads_init(&ssd->sd.entity, ssd->npads, ssd->pads);
2993 if (rval) {
2995 return rval;
2998 rval = __v4l2_subdev_init_finalize(&ssd->sd, lock_name, lock_key);
2999 if (rval) {
3001 return rval;
3095 int rval;
3106 rval = v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg);
3107 if (rval)
3128 rval = -EINVAL;
3132 rval = fwnode_property_read_u32(dev_fwnode(dev), "clock-frequency",
3134 if (rval)
3142 rval = -EINVAL;
3150 rval = -ENOMEM;
3168 return rval;
3218 int rval;
3224 rval = ccs_get_hwconfig(sensor, &client->dev);
3225 if (rval)
3226 return rval;
3243 rval = devm_regulator_bulk_get(&client->dev, ARRAY_SIZE(ccs_regulators),
3245 if (rval) {
3247 return rval;
3264 rval = clk_set_rate(sensor->ext_clk,
3266 if (rval < 0) {
3270 return rval;
3317 rval = ccs_power_on(&client->dev);
3318 if (rval < 0)
3319 return rval;
3323 rval = ccs_identify_module(sensor);
3324 if (rval) {
3325 rval = -ENODEV;
3329 rval = ccs_firmware_name(client, sensor, filename, sizeof(filename),
3331 if (rval >= sizeof(filename)) {
3332 rval = -ENOMEM;
3336 rval = request_firmware(&fw, filename, &client->dev);
3337 if (!rval) {
3345 rval = ccs_firmware_name(client, sensor, filename,
3347 if (rval >= sizeof(filename)) {
3348 rval = -ENOMEM;
3352 rval = request_firmware(&fw, filename, &client->dev);
3353 if (!rval) {
3360 rval = ccs_read_all_limits(sensor);
3361 if (rval)
3364 rval = ccs_read_frame_fmt(sensor);
3365 if (rval) {
3366 rval = -ENODEV;
3370 rval = ccs_update_phy_ctrl(sensor);
3371 if (rval < 0)
3374 rval = ccs_call_quirk(sensor, limits);
3375 if (rval) {
3403 rval = -ENOENT;
3412 rval = -EBUSY;
3476 rval = ccs_read(sensor, PLL_MODE, &v);
3477 if (rval)
3496 rval = ccs_get_mbus_formats(sensor);
3497 if (rval) {
3498 rval = -ENODEV;
3502 rval = ccs_init_subdev(sensor, sensor->scaler, " scaler", 2,
3505 if (rval)
3507 rval = ccs_init_subdev(sensor, sensor->binner, " binner", 2,
3510 if (rval)
3512 rval = ccs_init_subdev(sensor, sensor->pixel_array, " pixel_array", 1,
3515 if (rval)
3518 rval = ccs_init_controls(sensor);
3519 if (rval < 0)
3522 rval = ccs_call_quirk(sensor, init);
3523 if (rval)
3526 rval = ccs_init_late_controls(sensor);
3527 if (rval) {
3528 rval = -ENODEV;
3533 rval = ccs_pll_blanking_update(sensor);
3535 if (rval) {
3544 rval = ccs_write_msr_regs(sensor);
3545 if (rval)
3552 rval = v4l2_async_register_subdev_sensor(&sensor->src->sd);
3553 if (rval < 0)
3582 return rval;