Lines Matching full:rc

233 	int rc, i;  in wled3_set_brightness()  local
240 rc = regmap_bulk_write(wled->regmap, wled->ctrl_addr + in wled3_set_brightness()
242 if (rc < 0) in wled3_set_brightness()
243 return rc; in wled3_set_brightness()
251 int rc, i; in wled4_set_brightness() local
263 rc = regmap_bulk_write(wled->regmap, wled->sink_addr + in wled4_set_brightness()
265 if (rc < 0) in wled4_set_brightness()
266 return rc; in wled4_set_brightness()
274 int rc, offset; in wled5_set_brightness() local
289 rc = regmap_bulk_write(wled->regmap, wled->sink_addr + offset, in wled5_set_brightness()
291 return rc; in wled5_set_brightness()
303 int rc; in wled_module_enable() local
308 rc = regmap_update_bits(wled->regmap, wled->ctrl_addr + in wled_module_enable()
312 if (rc < 0) in wled_module_enable()
313 return rc; in wled_module_enable()
335 int rc; in wled3_sync_toggle() local
338 rc = regmap_update_bits(wled->regmap, in wled3_sync_toggle()
341 if (rc < 0) in wled3_sync_toggle()
342 return rc; in wled3_sync_toggle()
344 rc = regmap_update_bits(wled->regmap, in wled3_sync_toggle()
348 return rc; in wled3_sync_toggle()
353 int rc; in wled5_mod_sync_toggle() local
356 rc = regmap_update_bits(wled->regmap, in wled5_mod_sync_toggle()
359 if (rc < 0) in wled5_mod_sync_toggle()
360 return rc; in wled5_mod_sync_toggle()
371 int rc; in wled_ovp_fault_status() local
375 rc = regmap_read(wled->regmap, in wled_ovp_fault_status()
378 if (rc < 0) { in wled_ovp_fault_status()
379 dev_err(wled->dev, "Failed to read INT_RT_STS rc=%d\n", rc); in wled_ovp_fault_status()
380 return rc; in wled_ovp_fault_status()
383 rc = regmap_read(wled->regmap, in wled_ovp_fault_status()
386 if (rc < 0) { in wled_ovp_fault_status()
387 dev_err(wled->dev, "Failed to read FAULT_STATUS rc=%d\n", rc); in wled_ovp_fault_status()
388 return rc; in wled_ovp_fault_status()
405 return rc; in wled_ovp_fault_status()
415 int rc, delay_us; in wled5_ovp_delay() local
420 rc = regmap_read(wled->regmap, wled->ctrl_addr + in wled5_ovp_delay()
422 if (rc < 0) in wled5_ovp_delay()
437 int rc = 0; in wled_update_status() local
441 rc = wled->wled_set_brightness(wled, brightness); in wled_update_status()
442 if (rc < 0) { in wled_update_status()
443 dev_err(wled->dev, "wled failed to set brightness rc:%d\n", in wled_update_status()
444 rc); in wled_update_status()
449 rc = wled->wled_sync_toggle(wled); in wled_update_status()
450 if (rc < 0) { in wled_update_status()
451 dev_err(wled->dev, "wled sync failed rc:%d\n", rc); in wled_update_status()
459 rc = wled5_mod_sync_toggle(wled); in wled_update_status()
460 if (rc < 0) { in wled_update_status()
461 dev_err(wled->dev, "wled mod sync failed rc:%d\n", in wled_update_status()
462 rc); in wled_update_status()
469 rc = wled_module_enable(wled, !!brightness); in wled_update_status()
470 if (rc < 0) { in wled_update_status()
471 dev_err(wled->dev, "wled enable failed rc:%d\n", rc); in wled_update_status()
481 return rc; in wled_update_status()
486 int i, j, rc; in wled4_cabc_config() local
493 rc = regmap_update_bits(wled->regmap, wled->sink_addr + in wled4_cabc_config()
496 if (rc < 0) in wled4_cabc_config()
497 return rc; in wled4_cabc_config()
505 int rc, offset; in wled5_cabc_config() local
515 rc = regmap_update_bits(wled->regmap, wled->sink_addr + offset, in wled5_cabc_config()
517 if (rc < 0) { in wled5_cabc_config()
518 pr_err("Error in configuring CABC rc=%d\n", rc); in wled5_cabc_config()
519 return rc; in wled5_cabc_config()
535 int rc; in wled_short_irq_handler() local
540 rc = wled_module_enable(wled, false); in wled_short_irq_handler()
541 if (rc < 0) { in wled_short_irq_handler()
542 dev_err(wled->dev, "wled disable failed rc:%d\n", rc); in wled_short_irq_handler()
561 rc = wled_module_enable(wled, true); in wled_short_irq_handler()
562 if (rc < 0) in wled_short_irq_handler()
563 dev_err(wled->dev, "wled enable failed rc:%d\n", rc); in wled_short_irq_handler()
575 int rc = 0, i, delay_time_us; in wled_auto_string_detection() local
581 rc = regmap_read(wled->regmap, wled->sink_addr + in wled_auto_string_detection()
583 if (rc < 0) { in wled_auto_string_detection()
584 dev_err(wled->dev, "Failed to read SINK configuration rc=%d\n", in wled_auto_string_detection()
585 rc); in wled_auto_string_detection()
590 rc = regmap_update_bits(wled->regmap, in wled_auto_string_detection()
593 if (rc < 0) { in wled_auto_string_detection()
594 dev_err(wled->dev, "Failed to disable WLED module rc=%d\n", rc); in wled_auto_string_detection()
599 rc = wled4_set_brightness(wled, AUTO_DETECT_BRIGHTNESS); in wled_auto_string_detection()
600 if (rc < 0) { in wled_auto_string_detection()
601 dev_err(wled->dev, "Failed to set brightness for auto detection rc=%d\n", in wled_auto_string_detection()
602 rc); in wled_auto_string_detection()
607 rc = wled->wled_cabc_config(wled, false); in wled_auto_string_detection()
608 if (rc < 0) in wled_auto_string_detection()
613 rc = regmap_write(wled->regmap, in wled_auto_string_detection()
615 if (rc < 0) { in wled_auto_string_detection()
616 dev_err(wled->dev, "Failed to disable all sinks rc=%d\n", rc); in wled_auto_string_detection()
625 rc = regmap_write(wled->regmap, wled->ctrl_addr + in wled_auto_string_detection()
627 if (rc < 0) { in wled_auto_string_detection()
628 dev_err(wled->dev, "Failed to enable feedback for SINK %d rc = %d\n", in wled_auto_string_detection()
629 i + 1, rc); in wled_auto_string_detection()
634 rc = regmap_write(wled->regmap, wled->sink_addr + in wled_auto_string_detection()
636 if (rc < 0) { in wled_auto_string_detection()
637 dev_err(wled->dev, "Failed to configure SINK %d rc=%d\n", in wled_auto_string_detection()
638 i + 1, rc); in wled_auto_string_detection()
643 rc = regmap_update_bits(wled->regmap, wled->ctrl_addr + in wled_auto_string_detection()
647 if (rc < 0) { in wled_auto_string_detection()
648 dev_err(wled->dev, "Failed to enable WLED module rc=%d\n", in wled_auto_string_detection()
649 rc); in wled_auto_string_detection()
656 rc = wled_ovp_fault_status(wled, &fault_set); in wled_auto_string_detection()
657 if (rc < 0) { in wled_auto_string_detection()
658 dev_err(wled->dev, "Error in getting OVP fault_sts, rc=%d\n", in wled_auto_string_detection()
659 rc); in wled_auto_string_detection()
670 rc = regmap_update_bits(wled->regmap, in wled_auto_string_detection()
673 if (rc < 0) { in wled_auto_string_detection()
674 dev_err(wled->dev, "Failed to disable WLED module rc=%d\n", in wled_auto_string_detection()
675 rc); in wled_auto_string_detection()
693 rc = regmap_write(wled->regmap, in wled_auto_string_detection()
696 if (rc < 0) { in wled_auto_string_detection()
697 dev_err(wled->dev, "Failed to reconfigure the default sink rc=%d\n", in wled_auto_string_detection()
698 rc); in wled_auto_string_detection()
712 rc = regmap_write(wled->regmap, wled->sink_addr + in wled_auto_string_detection()
714 if (rc < 0) { in wled_auto_string_detection()
715 dev_err(wled->dev, "Failed to configure MODULATOR_EN rc=%d\n", in wled_auto_string_detection()
716 rc); in wled_auto_string_detection()
723 rc = wled->wled_cabc_config(wled, true); in wled_auto_string_detection()
724 if (rc < 0) in wled_auto_string_detection()
728 rc = regmap_write(wled->regmap, in wled_auto_string_detection()
730 if (rc < 0) { in wled_auto_string_detection()
731 dev_err(wled->dev, "Failed to restore feedback setting rc=%d\n", in wled_auto_string_detection()
732 rc); in wled_auto_string_detection()
737 rc = wled4_set_brightness(wled, wled->brightness); in wled_auto_string_detection()
738 if (rc < 0) { in wled_auto_string_detection()
739 dev_err(wled->dev, "Failed to set brightness after auto detection rc=%d\n", in wled_auto_string_detection()
740 rc); in wled_auto_string_detection()
744 rc = regmap_update_bits(wled->regmap, in wled_auto_string_detection()
748 if (rc < 0) { in wled_auto_string_detection()
749 dev_err(wled->dev, "Failed to enable WLED module rc=%d\n", rc); in wled_auto_string_detection()
812 int rc; in wled_auto_detection_at_init() local
818 rc = wled_ovp_fault_status(wled, &fault_set); in wled_auto_detection_at_init()
819 if (rc < 0) { in wled_auto_detection_at_init()
820 dev_err(wled->dev, "Error in getting OVP fault_sts, rc=%d\n", in wled_auto_detection_at_init()
821 rc); in wled_auto_detection_at_init()
822 return rc; in wled_auto_detection_at_init()
831 return rc; in wled_auto_detection_at_init()
837 int rc; in wled_ovp_irq_handler() local
840 rc = regmap_read(wled->regmap, in wled_ovp_irq_handler()
842 if (rc < 0) { in wled_ovp_irq_handler()
843 dev_err(wled->dev, "Error in reading WLED3_INT_RT_STS rc=%d\n", in wled_ovp_irq_handler()
844 rc); in wled_ovp_irq_handler()
848 rc = regmap_read(wled->regmap, wled->ctrl_addr + in wled_ovp_irq_handler()
850 if (rc < 0) { in wled_ovp_irq_handler()
851 dev_err(wled->dev, "Error in reading WLED_FAULT_STATUS rc=%d\n", in wled_ovp_irq_handler()
852 rc); in wled_ovp_irq_handler()
876 int rc, i, j; in wled3_setup() local
878 rc = regmap_update_bits(wled->regmap, in wled3_setup()
881 if (rc) in wled3_setup()
882 return rc; in wled3_setup()
884 rc = regmap_update_bits(wled->regmap, in wled3_setup()
888 if (rc) in wled3_setup()
889 return rc; in wled3_setup()
891 rc = regmap_update_bits(wled->regmap, in wled3_setup()
895 if (rc) in wled3_setup()
896 return rc; in wled3_setup()
901 rc = regmap_update_bits(wled->regmap, addr, in wled3_setup()
904 if (rc) in wled3_setup()
905 return rc; in wled3_setup()
909 rc = regmap_update_bits(wled->regmap, addr, in wled3_setup()
912 if (rc) in wled3_setup()
913 return rc; in wled3_setup()
917 rc = regmap_update_bits(wled->regmap, addr, in wled3_setup()
920 if (rc) in wled3_setup()
921 return rc; in wled3_setup()
924 rc = regmap_update_bits(wled->regmap, addr, in wled3_setup()
928 if (rc) in wled3_setup()
929 return rc; in wled3_setup()
934 rc = regmap_update_bits(wled->regmap, in wled3_setup()
937 if (rc) in wled3_setup()
938 return rc; in wled3_setup()
957 int rc, temp, i, j; in wled4_setup() local
962 rc = regmap_update_bits(wled->regmap, in wled4_setup()
965 if (rc < 0) in wled4_setup()
966 return rc; in wled4_setup()
968 rc = regmap_update_bits(wled->regmap, in wled4_setup()
972 if (rc < 0) in wled4_setup()
973 return rc; in wled4_setup()
975 rc = regmap_update_bits(wled->regmap, in wled4_setup()
979 if (rc < 0) in wled4_setup()
980 return rc; in wled4_setup()
984 rc = regmap_write(wled->regmap, wled->ctrl_addr + in wled4_setup()
987 if (rc < 0) in wled4_setup()
988 return rc; in wled4_setup()
990 rc = regmap_write(wled->regmap, in wled4_setup()
993 if (rc < 0) in wled4_setup()
994 return rc; in wled4_setup()
997 rc = regmap_read(wled->regmap, wled->sink_addr + in wled4_setup()
999 if (rc < 0) in wled4_setup()
1000 return rc; in wled4_setup()
1009 rc = wled_auto_detection_at_init(wled); in wled4_setup()
1010 return rc; in wled4_setup()
1013 rc = regmap_update_bits(wled->regmap, in wled4_setup()
1016 if (rc < 0) in wled4_setup()
1017 return rc; in wled4_setup()
1019 rc = regmap_update_bits(wled->regmap, wled->ctrl_addr + in wled4_setup()
1022 if (rc < 0) in wled4_setup()
1023 return rc; in wled4_setup()
1031 rc = regmap_update_bits(wled->regmap, addr, in wled4_setup()
1034 if (rc < 0) in wled4_setup()
1035 return rc; in wled4_setup()
1039 rc = regmap_update_bits(wled->regmap, addr, in wled4_setup()
1042 if (rc < 0) in wled4_setup()
1043 return rc; in wled4_setup()
1046 rc = wled4_cabc_config(wled, wled->cfg.cabc); in wled4_setup()
1047 if (rc < 0) in wled4_setup()
1048 return rc; in wled4_setup()
1050 rc = regmap_update_bits(wled->regmap, wled->ctrl_addr + in wled4_setup()
1054 if (rc < 0) in wled4_setup()
1055 return rc; in wled4_setup()
1057 rc = regmap_update_bits(wled->regmap, in wled4_setup()
1060 if (rc < 0) in wled4_setup()
1061 return rc; in wled4_setup()
1063 rc = wled->wled_sync_toggle(wled); in wled4_setup()
1064 if (rc < 0) { in wled4_setup()
1065 dev_err(wled->dev, "Failed to toggle sync reg rc:%d\n", rc); in wled4_setup()
1066 return rc; in wled4_setup()
1069 rc = wled_auto_detection_at_init(wled); in wled4_setup()
1071 return rc; in wled4_setup()
1087 int rc, temp, i, j, offset; in wled5_setup() local
1092 rc = regmap_update_bits(wled->regmap, in wled5_setup()
1095 if (rc < 0) in wled5_setup()
1096 return rc; in wled5_setup()
1098 rc = regmap_update_bits(wled->regmap, in wled5_setup()
1102 if (rc < 0) in wled5_setup()
1103 return rc; in wled5_setup()
1105 rc = regmap_update_bits(wled->regmap, in wled5_setup()
1109 if (rc < 0) in wled5_setup()
1110 return rc; in wled5_setup()
1117 rc = regmap_update_bits(wled->regmap, addr, in wled5_setup()
1120 if (rc < 0) in wled5_setup()
1121 return rc; in wled5_setup()
1124 rc = regmap_update_bits(wled->regmap, addr, in wled5_setup()
1134 rc = wled5_cabc_config(wled, wled->cfg.cabc_sel ? true : false); in wled5_setup()
1135 if (rc < 0) in wled5_setup()
1136 return rc; in wled5_setup()
1141 rc = regmap_update_bits(wled->regmap, addr, in wled5_setup()
1143 if (rc < 0) in wled5_setup()
1144 return rc; in wled5_setup()
1148 rc = regmap_update_bits(wled->regmap, addr, in wled5_setup()
1150 if (rc < 0) in wled5_setup()
1151 return rc; in wled5_setup()
1161 rc = regmap_write(wled->regmap, addr, val); in wled5_setup()
1162 if (rc < 0) in wled5_setup()
1163 return rc; in wled5_setup()
1165 rc = regmap_update_bits(wled->regmap, in wled5_setup()
1168 if (rc < 0) in wled5_setup()
1169 return rc; in wled5_setup()
1172 rc = wled->wled_sync_toggle(wled); in wled5_setup()
1173 if (rc < 0) { in wled5_setup()
1174 pr_err("Failed to toggle sync reg rc:%d\n", rc); in wled5_setup()
1175 return rc; in wled5_setup()
1178 rc = wled_auto_detection_at_init(wled); in wled5_setup()
1179 if (rc < 0) in wled5_setup()
1180 return rc; in wled5_setup()
1323 int rc, i, j, string_len; in wled_configure() local
1435 rc = of_property_read_string(dev->of_node, "label", &wled->name); in wled_configure()
1436 if (rc) in wled_configure()
1496 rc = of_property_read_u32(dev->of_node, u32_opts[i].name, &val); in wled_configure()
1497 if (rc == -EINVAL) { in wled_configure()
1499 } else if (rc) { in wled_configure()
1501 return rc; in wled_configure()
1543 int rc; in wled_configure_short_irq() local
1548 rc = regmap_update_bits(wled->regmap, wled->ctrl_addr + in wled_configure_short_irq()
1552 if (rc < 0) in wled_configure_short_irq()
1553 return rc; in wled_configure_short_irq()
1561 rc = devm_request_threaded_irq(wled->dev, wled->short_irq, in wled_configure_short_irq()
1565 if (rc < 0) in wled_configure_short_irq()
1567 rc); in wled_configure_short_irq()
1569 return rc; in wled_configure_short_irq()
1575 int rc; in wled_configure_ovp_irq() local
1584 rc = devm_request_threaded_irq(wled->dev, wled->ovp_irq, NULL, in wled_configure_ovp_irq()
1587 if (rc < 0) { in wled_configure_ovp_irq()
1589 rc); in wled_configure_ovp_irq()
1594 rc = regmap_read(wled->regmap, wled->ctrl_addr + in wled_configure_ovp_irq()
1596 if (rc < 0) in wled_configure_ovp_irq()
1597 return rc; in wled_configure_ovp_irq()
1617 int rc; in wled_probe() local
1639 rc = wled_configure(wled); in wled_probe()
1640 if (rc) in wled_probe()
1641 return rc; in wled_probe()
1650 rc = wled3_setup(wled); in wled_probe()
1651 if (rc) { in wled_probe()
1653 return rc; in wled_probe()
1659 rc = wled4_setup(wled); in wled_probe()
1660 if (rc) { in wled_probe()
1662 return rc; in wled_probe()
1671 rc = wled5_setup(wled); in wled_probe()
1672 if (rc) { in wled_probe()
1674 return rc; in wled_probe()
1685 rc = wled_configure_short_irq(wled, pdev); in wled_probe()
1686 if (rc < 0) in wled_probe()
1687 return rc; in wled_probe()
1689 rc = wled_configure_ovp_irq(wled, pdev); in wled_probe()
1690 if (rc < 0) in wled_probe()
1691 return rc; in wled_probe()