Lines Matching refs:err

314 	int err;  in tc358746_write()  local
319 err = regmap_bulk_write(tc358746->regmap, reg, &val, count); in tc358746_write()
320 if (err) in tc358746_write()
322 "Failed to write reg:0x%04x err:%d\n", reg, err); in tc358746_write()
324 return err; in tc358746_write()
330 int err; in tc358746_read() local
336 err = regmap_bulk_read(tc358746->regmap, reg, val, count); in tc358746_read()
337 if (err) in tc358746_read()
339 "Failed to read reg:0x%04x err:%d\n", reg, err); in tc358746_read()
341 return err; in tc358746_read()
348 int err; in tc358746_update_bits() local
350 err = tc358746_read(tc358746, reg, &orig); in tc358746_update_bits()
351 if (err) in tc358746_update_bits()
352 return err; in tc358746_update_bits()
372 int err; in tc358746_sw_reset() local
374 err = tc358746_set_bits(tc358746, SYSCTL_REG, SRESET); in tc358746_sw_reset()
375 if (err) in tc358746_sw_reset()
376 return err; in tc358746_sw_reset()
390 int err; in tc358746_apply_pll_config() local
392 err = tc358746_read(tc358746, PLLCTL1_REG, &val); in tc358746_apply_pll_config()
393 if (err) in tc358746_apply_pll_config()
394 return err; in tc358746_apply_pll_config()
403 err = tc358746_update_bits(tc358746, PLLCTL0_REG, mask, val); in tc358746_apply_pll_config()
404 if (err) in tc358746_apply_pll_config()
405 return err; in tc358746_apply_pll_config()
409 err = tc358746_update_bits(tc358746, PLLCTL1_REG, mask, val); in tc358746_apply_pll_config()
410 if (err) in tc358746_apply_pll_config()
411 return err; in tc358746_apply_pll_config()
426 int err; in tc358746_apply_misc_config() local
436 err = tc358746_write(tc358746, DATAFMT_REG, val); in tc358746_apply_misc_config()
437 if (err) in tc358746_apply_misc_config()
442 err = tc358746_update_bits(tc358746, CONFCTL_REG, PDATAF_MASK, val); in tc358746_apply_misc_config()
443 if (err) in tc358746_apply_misc_config()
448 err = tc358746_write(tc358746, FIFOCTL_REG, val); in tc358746_apply_misc_config()
449 if (err) in tc358746_apply_misc_config()
455 err = tc358746_write(tc358746, WORDCNT_REG, val); in tc358746_apply_misc_config()
460 return err; in tc358746_apply_misc_config()
491 int err; in tc358746_apply_dphy_config() local
500 err = tc358746_write(tc358746, LINEINITCNT_REG, val); in tc358746_apply_dphy_config()
501 if (err) in tc358746_apply_dphy_config()
502 return err; in tc358746_apply_dphy_config()
507 err = tc358746_write(tc358746, LPTXTIMECNT_REG, val); in tc358746_apply_dphy_config()
508 if (err) in tc358746_apply_dphy_config()
509 return err; in tc358746_apply_dphy_config()
517 err = tc358746_write(tc358746, TCLK_HEADERCNT_REG, in tc358746_apply_dphy_config()
519 if (err) in tc358746_apply_dphy_config()
520 return err; in tc358746_apply_dphy_config()
524 err = tc358746_write(tc358746, TCLK_TRAILCNT_REG, val); in tc358746_apply_dphy_config()
525 if (err) in tc358746_apply_dphy_config()
526 return err; in tc358746_apply_dphy_config()
534 err = tc358746_write(tc358746, THS_HEADERCNT_REG, in tc358746_apply_dphy_config()
536 if (err) in tc358746_apply_dphy_config()
537 return err; in tc358746_apply_dphy_config()
543 err = tc358746_write(tc358746, TWAKEUP_REG, val); in tc358746_apply_dphy_config()
544 if (err) in tc358746_apply_dphy_config()
545 return err; in tc358746_apply_dphy_config()
549 err = tc358746_write(tc358746, TCLK_POSTCNT_REG, val); in tc358746_apply_dphy_config()
550 if (err) in tc358746_apply_dphy_config()
551 return err; in tc358746_apply_dphy_config()
555 err = tc358746_write(tc358746, THS_TRAILCNT_REG, val); in tc358746_apply_dphy_config()
556 if (err) in tc358746_apply_dphy_config()
557 return err; in tc358746_apply_dphy_config()
571 int err; in tc358746_enable_csi_lanes() local
573 err = tc358746_update_bits(tc358746, CONFCTL_REG, DATALANE_MASK, in tc358746_enable_csi_lanes()
575 if (err) in tc358746_enable_csi_lanes()
576 return err; in tc358746_enable_csi_lanes()
581 err = tc358746_write(tc358746, CLW_CNTRL_REG, val); in tc358746_enable_csi_lanes()
582 if (err) in tc358746_enable_csi_lanes()
583 return err; in tc358746_enable_csi_lanes()
591 err = tc358746_write(tc358746, reg, val); in tc358746_enable_csi_lanes()
592 if (err) in tc358746_enable_csi_lanes()
593 return err; in tc358746_enable_csi_lanes()
614 int err; in tc358746_enable_csi_module() local
624 err = tc358746_write(tc358746, STARTCNTRL_REG, START); in tc358746_enable_csi_module()
625 if (err) in tc358746_enable_csi_module()
626 return err; in tc358746_enable_csi_module()
628 err = tc358746_write(tc358746, CSI_START_REG, STRT); in tc358746_enable_csi_module()
629 if (err) in tc358746_enable_csi_module()
630 return err; in tc358746_enable_csi_module()
641 int err; in tc358746_enable_parallel_port() local
644 err = tc358746_write(tc358746, PP_MISC_REG, 0); in tc358746_enable_parallel_port()
645 if (err) in tc358746_enable_parallel_port()
646 return err; in tc358746_enable_parallel_port()
651 err = tc358746_set_bits(tc358746, PP_MISC_REG, FRMSTOP); in tc358746_enable_parallel_port()
652 if (err) in tc358746_enable_parallel_port()
653 return err; in tc358746_enable_parallel_port()
655 err = tc358746_clear_bits(tc358746, CONFCTL_REG, PPEN); in tc358746_enable_parallel_port()
656 if (err) in tc358746_enable_parallel_port()
657 return err; in tc358746_enable_parallel_port()
675 int err; in tc358746_s_stream() local
684 err = pm_runtime_resume_and_get(sd->dev); in tc358746_s_stream()
685 if (err) in tc358746_s_stream()
686 return err; in tc358746_s_stream()
688 err = tc358746_apply_dphy_config(tc358746); in tc358746_s_stream()
689 if (err) in tc358746_s_stream()
692 err = tc358746_apply_misc_config(tc358746); in tc358746_s_stream()
693 if (err) in tc358746_s_stream()
696 err = tc358746_enable_csi_lanes(tc358746, 1); in tc358746_s_stream()
697 if (err) in tc358746_s_stream()
700 err = tc358746_enable_csi_module(tc358746, 1); in tc358746_s_stream()
701 if (err) in tc358746_s_stream()
704 err = tc358746_enable_parallel_port(tc358746, 1); in tc358746_s_stream()
705 if (err) in tc358746_s_stream()
708 err = v4l2_subdev_call(src, video, s_stream, 1); in tc358746_s_stream()
709 if (err) in tc358746_s_stream()
718 return err; in tc358746_s_stream()
725 err = tc358746_enable_csi_lanes(tc358746, 0); in tc358746_s_stream()
726 if (err) in tc358746_s_stream()
727 return err; in tc358746_s_stream()
729 err = tc358746_enable_csi_module(tc358746, 0); in tc358746_s_stream()
730 if (err) in tc358746_s_stream()
731 return err; in tc358746_s_stream()
733 err = tc358746_enable_parallel_port(tc358746, 0); in tc358746_s_stream()
734 if (err) in tc358746_s_stream()
735 return err; in tc358746_s_stream()
897 int err; in tc358746_link_validate() local
899 err = v4l2_subdev_link_validate_default(sd, link, source_fmt, sink_fmt); in tc358746_link_validate()
900 if (err) in tc358746_link_validate()
901 return err; in tc358746_link_validate()
992 int err; in tc358746_g_register() local
1000 err = tc358746_read(tc358746, reg->reg, &val); in tc358746_g_register()
1006 return err; in tc358746_g_register()
1061 int err; in tc358746_mclk_enable() local
1066 err = tc358746_write(tc358746, MCLKCTL_REG, val); in tc358746_mclk_enable()
1067 if (err) in tc358746_mclk_enable()
1068 return err; in tc358746_mclk_enable()
1186 int err; in tc358746_recalc_rate() local
1188 err = tc358746_read(tc358746, MCLKCTL_REG, &val); in tc358746_recalc_rate()
1189 if (err) in tc358746_recalc_rate()
1195 err = tc358746_read(tc358746, CLKCTL_REG, &val); in tc358746_recalc_rate()
1196 if (err) in tc358746_recalc_rate()
1243 int err; in tc358746_setup_mclk_provider() local
1260 err = devm_clk_hw_register(dev, &tc358746->mclk_hw); in tc358746_setup_mclk_provider()
1261 if (err) { in tc358746_setup_mclk_provider()
1263 return err; in tc358746_setup_mclk_provider()
1266 err = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, in tc358746_setup_mclk_provider()
1268 if (err) in tc358746_setup_mclk_provider()
1271 return err; in tc358746_setup_mclk_provider()
1278 int err; in tc358746_init_subdev() local
1287 err = media_entity_pads_init(&sd->entity, TC358746_NR_PADS, in tc358746_init_subdev()
1289 if (err) in tc358746_init_subdev()
1290 return err; in tc358746_init_subdev()
1292 err = v4l2_subdev_init_finalize(sd); in tc358746_init_subdev()
1293 if (err) in tc358746_init_subdev()
1296 return err; in tc358746_init_subdev()
1307 int err; in tc358746_init_output_port() local
1319 err = v4l2_fwnode_endpoint_alloc_parse(ep, vep); in tc358746_init_output_port()
1321 if (err) { in tc358746_init_output_port()
1323 return err; in tc358746_init_output_port()
1330 err = -EINVAL; in tc358746_init_output_port()
1331 goto err; in tc358746_init_output_port()
1339 err = -EINVAL; in tc358746_init_output_port()
1340 goto err; in tc358746_init_output_port()
1343 err = phy_mipi_dphy_get_default_config_for_hsclk(tc358746->pll_rate, in tc358746_init_output_port()
1345 if (err) in tc358746_init_output_port()
1346 goto err; in tc358746_init_output_port()
1352 err: in tc358746_init_output_port()
1355 return err; in tc358746_init_output_port()
1363 int err; in tc358746_init_hw() local
1365 err = pm_runtime_resume_and_get(dev); in tc358746_init_hw()
1366 if (err < 0) { in tc358746_init_hw()
1368 return err; in tc358746_init_hw()
1372 err = tc358746_sw_reset(tc358746); in tc358746_init_hw()
1373 if (err) { in tc358746_init_hw()
1376 return err; in tc358746_init_hw()
1379 err = tc358746_read(tc358746, CHIPID_REG, &val); in tc358746_init_hw()
1382 if (err) in tc358746_init_hw()
1398 int err; in tc358746_init_controls() local
1400 err = v4l2_ctrl_handler_init(&tc358746->ctrl_hdl, 1); in tc358746_init_controls()
1401 if (err) in tc358746_init_controls()
1402 return err; in tc358746_init_controls()
1416 err = tc358746->ctrl_hdl.error; in tc358746_init_controls()
1417 if (err) { in tc358746_init_controls()
1419 return err; in tc358746_init_controls()
1450 int err; in tc358746_async_register() local
1457 err = v4l2_fwnode_endpoint_parse(ep, &vep); in tc358746_async_register()
1458 if (err) { in tc358746_async_register()
1460 return err; in tc358746_async_register()
1469 err = PTR_ERR(asd); in tc358746_async_register()
1475 err = v4l2_async_nf_register(&tc358746->notifier); in tc358746_async_register()
1476 if (err) in tc358746_async_register()
1479 err = v4l2_async_register_subdev(&tc358746->sd); in tc358746_async_register()
1480 if (err) in tc358746_async_register()
1490 return err; in tc358746_async_register()
1499 int err; in tc358746_probe() local
1515 err = clk_prepare_enable(tc358746->refclk); in tc358746_probe()
1516 if (err) in tc358746_probe()
1517 return dev_err_probe(dev, err, in tc358746_probe()
1529 err = devm_regulator_bulk_get(dev, ARRAY_SIZE(tc358746_supplies), in tc358746_probe()
1531 if (err) in tc358746_probe()
1532 return dev_err_probe(dev, err, "Failed to get supplies\n"); in tc358746_probe()
1540 err = tc358746_init_subdev(tc358746, client); in tc358746_probe()
1541 if (err) in tc358746_probe()
1542 return dev_err_probe(dev, err, "Failed to init subdev\n"); in tc358746_probe()
1544 err = tc358746_init_output_port(tc358746, refclk); in tc358746_probe()
1545 if (err) in tc358746_probe()
1552 err = tc358746_init_controls(tc358746); in tc358746_probe()
1553 if (err) in tc358746_probe()
1563 err = tc358746_init_hw(tc358746); in tc358746_probe()
1564 if (err) in tc358746_probe()
1567 err = tc358746_setup_mclk_provider(tc358746); in tc358746_probe()
1568 if (err) in tc358746_probe()
1571 err = tc358746_async_register(tc358746); in tc358746_probe()
1572 if (err < 0) in tc358746_probe()
1591 return err; in tc358746_probe()
1615 int err; in tc358746_suspend() local
1619 err = regulator_bulk_disable(ARRAY_SIZE(tc358746_supplies), in tc358746_suspend()
1621 if (err) in tc358746_suspend()
1624 return err; in tc358746_suspend()
1630 int err; in tc358746_resume() local
1634 err = regulator_bulk_enable(ARRAY_SIZE(tc358746_supplies), in tc358746_resume()
1636 if (err) in tc358746_resume()
1637 return err; in tc358746_resume()
1644 err = clk_prepare_enable(tc358746->refclk); in tc358746_resume()
1645 if (err) in tc358746_resume()
1646 goto err; in tc358746_resume()
1655 err = tc358746_apply_pll_config(tc358746); in tc358746_resume()
1656 if (err) in tc358746_resume()
1663 err: in tc358746_resume()
1666 return err; in tc358746_resume()