Lines Matching refs: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_sync_toggle() local
358 rc = regmap_update_bits(wled->regmap, in wled5_sync_toggle()
361 if (rc < 0) in wled5_sync_toggle()
362 return rc; in wled5_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()
444 rc); in wled_update_status()
448 rc = wled->wled_sync_toggle(wled); in wled_update_status()
449 if (rc < 0) { in wled_update_status()
450 dev_err(wled->dev, "wled sync failed rc:%d\n", rc); in wled_update_status()
456 rc = wled_module_enable(wled, !!brightness); in wled_update_status()
457 if (rc < 0) { in wled_update_status()
458 dev_err(wled->dev, "wled enable failed rc:%d\n", rc); in wled_update_status()
468 return rc; in wled_update_status()
473 int i, j, rc; in wled4_cabc_config() local
480 rc = regmap_update_bits(wled->regmap, wled->sink_addr + in wled4_cabc_config()
483 if (rc < 0) in wled4_cabc_config()
484 return rc; in wled4_cabc_config()
492 int rc, offset; in wled5_cabc_config() local
502 rc = regmap_update_bits(wled->regmap, wled->sink_addr + offset, in wled5_cabc_config()
504 if (rc < 0) { in wled5_cabc_config()
505 pr_err("Error in configuring CABC rc=%d\n", rc); in wled5_cabc_config()
506 return rc; in wled5_cabc_config()
522 int rc; in wled_short_irq_handler() local
527 rc = wled_module_enable(wled, false); in wled_short_irq_handler()
528 if (rc < 0) { in wled_short_irq_handler()
529 dev_err(wled->dev, "wled disable failed rc:%d\n", rc); in wled_short_irq_handler()
548 rc = wled_module_enable(wled, true); in wled_short_irq_handler()
549 if (rc < 0) in wled_short_irq_handler()
550 dev_err(wled->dev, "wled enable failed rc:%d\n", rc); in wled_short_irq_handler()
562 int rc = 0, i, delay_time_us; in wled_auto_string_detection() local
568 rc = regmap_read(wled->regmap, wled->sink_addr + in wled_auto_string_detection()
570 if (rc < 0) { in wled_auto_string_detection()
572 rc); in wled_auto_string_detection()
577 rc = regmap_update_bits(wled->regmap, in wled_auto_string_detection()
580 if (rc < 0) { in wled_auto_string_detection()
581 dev_err(wled->dev, "Failed to disable WLED module rc=%d\n", rc); in wled_auto_string_detection()
586 rc = wled4_set_brightness(wled, AUTO_DETECT_BRIGHTNESS); in wled_auto_string_detection()
587 if (rc < 0) { in wled_auto_string_detection()
589 rc); in wled_auto_string_detection()
594 rc = wled->wled_cabc_config(wled, false); in wled_auto_string_detection()
595 if (rc < 0) in wled_auto_string_detection()
600 rc = regmap_write(wled->regmap, in wled_auto_string_detection()
602 if (rc < 0) { in wled_auto_string_detection()
603 dev_err(wled->dev, "Failed to disable all sinks rc=%d\n", rc); in wled_auto_string_detection()
612 rc = regmap_write(wled->regmap, wled->ctrl_addr + in wled_auto_string_detection()
614 if (rc < 0) { in wled_auto_string_detection()
616 i + 1, rc); in wled_auto_string_detection()
621 rc = regmap_write(wled->regmap, wled->sink_addr + in wled_auto_string_detection()
623 if (rc < 0) { in wled_auto_string_detection()
625 i + 1, rc); in wled_auto_string_detection()
630 rc = regmap_update_bits(wled->regmap, wled->ctrl_addr + in wled_auto_string_detection()
634 if (rc < 0) { in wled_auto_string_detection()
636 rc); in wled_auto_string_detection()
643 rc = wled_ovp_fault_status(wled, &fault_set); in wled_auto_string_detection()
644 if (rc < 0) { in wled_auto_string_detection()
646 rc); in wled_auto_string_detection()
657 rc = regmap_update_bits(wled->regmap, in wled_auto_string_detection()
660 if (rc < 0) { in wled_auto_string_detection()
662 rc); in wled_auto_string_detection()
680 rc = regmap_write(wled->regmap, in wled_auto_string_detection()
683 if (rc < 0) { in wled_auto_string_detection()
685 rc); in wled_auto_string_detection()
699 rc = regmap_write(wled->regmap, wled->sink_addr + in wled_auto_string_detection()
701 if (rc < 0) { in wled_auto_string_detection()
703 rc); in wled_auto_string_detection()
710 rc = wled->wled_cabc_config(wled, true); in wled_auto_string_detection()
711 if (rc < 0) in wled_auto_string_detection()
715 rc = regmap_write(wled->regmap, in wled_auto_string_detection()
717 if (rc < 0) { in wled_auto_string_detection()
719 rc); in wled_auto_string_detection()
724 rc = wled4_set_brightness(wled, wled->brightness); in wled_auto_string_detection()
725 if (rc < 0) { in wled_auto_string_detection()
727 rc); in wled_auto_string_detection()
731 rc = regmap_update_bits(wled->regmap, in wled_auto_string_detection()
735 if (rc < 0) { in wled_auto_string_detection()
736 dev_err(wled->dev, "Failed to enable WLED module rc=%d\n", rc); in wled_auto_string_detection()
799 int rc; in wled_auto_detection_at_init() local
805 rc = wled_ovp_fault_status(wled, &fault_set); in wled_auto_detection_at_init()
806 if (rc < 0) { in wled_auto_detection_at_init()
808 rc); in wled_auto_detection_at_init()
809 return rc; in wled_auto_detection_at_init()
818 return rc; in wled_auto_detection_at_init()
824 int rc; in wled_ovp_irq_handler() local
827 rc = regmap_read(wled->regmap, in wled_ovp_irq_handler()
829 if (rc < 0) { in wled_ovp_irq_handler()
831 rc); in wled_ovp_irq_handler()
835 rc = regmap_read(wled->regmap, wled->ctrl_addr + in wled_ovp_irq_handler()
837 if (rc < 0) { in wled_ovp_irq_handler()
839 rc); in wled_ovp_irq_handler()
863 int rc, i, j; in wled3_setup() local
865 rc = regmap_update_bits(wled->regmap, in wled3_setup()
868 if (rc) in wled3_setup()
869 return rc; in wled3_setup()
871 rc = regmap_update_bits(wled->regmap, in wled3_setup()
875 if (rc) in wled3_setup()
876 return rc; in wled3_setup()
878 rc = regmap_update_bits(wled->regmap, in wled3_setup()
882 if (rc) in wled3_setup()
883 return rc; in wled3_setup()
888 rc = regmap_update_bits(wled->regmap, addr, in wled3_setup()
891 if (rc) in wled3_setup()
892 return rc; in wled3_setup()
896 rc = regmap_update_bits(wled->regmap, addr, in wled3_setup()
899 if (rc) in wled3_setup()
900 return rc; in wled3_setup()
904 rc = regmap_update_bits(wled->regmap, addr, in wled3_setup()
907 if (rc) in wled3_setup()
908 return rc; in wled3_setup()
911 rc = regmap_update_bits(wled->regmap, addr, in wled3_setup()
915 if (rc) in wled3_setup()
916 return rc; in wled3_setup()
921 rc = regmap_update_bits(wled->regmap, in wled3_setup()
924 if (rc) in wled3_setup()
925 return rc; in wled3_setup()
944 int rc, temp, i, j; in wled4_setup() local
949 rc = regmap_update_bits(wled->regmap, in wled4_setup()
952 if (rc < 0) in wled4_setup()
953 return rc; in wled4_setup()
955 rc = regmap_update_bits(wled->regmap, in wled4_setup()
959 if (rc < 0) in wled4_setup()
960 return rc; in wled4_setup()
962 rc = regmap_update_bits(wled->regmap, in wled4_setup()
966 if (rc < 0) in wled4_setup()
967 return rc; in wled4_setup()
971 rc = regmap_write(wled->regmap, wled->ctrl_addr + in wled4_setup()
974 if (rc < 0) in wled4_setup()
975 return rc; in wled4_setup()
977 rc = regmap_write(wled->regmap, in wled4_setup()
980 if (rc < 0) in wled4_setup()
981 return rc; in wled4_setup()
984 rc = regmap_read(wled->regmap, wled->sink_addr + in wled4_setup()
986 if (rc < 0) in wled4_setup()
987 return rc; in wled4_setup()
996 rc = wled_auto_detection_at_init(wled); in wled4_setup()
997 return rc; in wled4_setup()
1000 rc = regmap_update_bits(wled->regmap, in wled4_setup()
1003 if (rc < 0) in wled4_setup()
1004 return rc; in wled4_setup()
1006 rc = regmap_update_bits(wled->regmap, wled->ctrl_addr + in wled4_setup()
1009 if (rc < 0) in wled4_setup()
1010 return rc; in wled4_setup()
1018 rc = regmap_update_bits(wled->regmap, addr, in wled4_setup()
1021 if (rc < 0) in wled4_setup()
1022 return rc; in wled4_setup()
1026 rc = regmap_update_bits(wled->regmap, addr, in wled4_setup()
1029 if (rc < 0) in wled4_setup()
1030 return rc; in wled4_setup()
1033 rc = wled4_cabc_config(wled, wled->cfg.cabc); in wled4_setup()
1034 if (rc < 0) in wled4_setup()
1035 return rc; in wled4_setup()
1037 rc = regmap_update_bits(wled->regmap, wled->ctrl_addr + in wled4_setup()
1041 if (rc < 0) in wled4_setup()
1042 return rc; in wled4_setup()
1044 rc = regmap_update_bits(wled->regmap, in wled4_setup()
1047 if (rc < 0) in wled4_setup()
1048 return rc; in wled4_setup()
1050 rc = wled->wled_sync_toggle(wled); in wled4_setup()
1051 if (rc < 0) { in wled4_setup()
1052 dev_err(wled->dev, "Failed to toggle sync reg rc:%d\n", rc); in wled4_setup()
1053 return rc; in wled4_setup()
1056 rc = wled_auto_detection_at_init(wled); in wled4_setup()
1058 return rc; in wled4_setup()
1074 int rc, temp, i, j, offset; in wled5_setup() local
1079 rc = regmap_update_bits(wled->regmap, in wled5_setup()
1082 if (rc < 0) in wled5_setup()
1083 return rc; in wled5_setup()
1085 rc = regmap_update_bits(wled->regmap, in wled5_setup()
1089 if (rc < 0) in wled5_setup()
1090 return rc; in wled5_setup()
1092 rc = regmap_update_bits(wled->regmap, in wled5_setup()
1096 if (rc < 0) in wled5_setup()
1097 return rc; in wled5_setup()
1104 rc = regmap_update_bits(wled->regmap, addr, in wled5_setup()
1107 if (rc < 0) in wled5_setup()
1108 return rc; in wled5_setup()
1111 rc = regmap_update_bits(wled->regmap, addr, in wled5_setup()
1121 rc = wled5_cabc_config(wled, wled->cfg.cabc_sel ? true : false); in wled5_setup()
1122 if (rc < 0) in wled5_setup()
1123 return rc; in wled5_setup()
1128 rc = regmap_update_bits(wled->regmap, addr, in wled5_setup()
1130 if (rc < 0) in wled5_setup()
1131 return rc; in wled5_setup()
1135 rc = regmap_update_bits(wled->regmap, addr, in wled5_setup()
1137 if (rc < 0) in wled5_setup()
1138 return rc; in wled5_setup()
1148 rc = regmap_write(wled->regmap, addr, val); in wled5_setup()
1149 if (rc < 0) in wled5_setup()
1150 return rc; in wled5_setup()
1152 rc = regmap_update_bits(wled->regmap, in wled5_setup()
1155 if (rc < 0) in wled5_setup()
1156 return rc; in wled5_setup()
1159 rc = wled->wled_sync_toggle(wled); in wled5_setup()
1160 if (rc < 0) { in wled5_setup()
1161 pr_err("Failed to toggle sync reg rc:%d\n", rc); in wled5_setup()
1162 return rc; in wled5_setup()
1165 rc = wled_auto_detection_at_init(wled); in wled5_setup()
1166 if (rc < 0) in wled5_setup()
1167 return rc; in wled5_setup()
1310 int rc, i, j, string_len; in wled_configure() local
1422 rc = of_property_read_string(dev->of_node, "label", &wled->name); in wled_configure()
1423 if (rc) in wled_configure()
1483 rc = of_property_read_u32(dev->of_node, u32_opts[i].name, &val); in wled_configure()
1484 if (rc == -EINVAL) { in wled_configure()
1486 } else if (rc) { in wled_configure()
1488 return rc; in wled_configure()
1530 int rc; in wled_configure_short_irq() local
1535 rc = regmap_update_bits(wled->regmap, wled->ctrl_addr + in wled_configure_short_irq()
1539 if (rc < 0) in wled_configure_short_irq()
1540 return rc; in wled_configure_short_irq()
1548 rc = devm_request_threaded_irq(wled->dev, wled->short_irq, in wled_configure_short_irq()
1552 if (rc < 0) in wled_configure_short_irq()
1554 rc); in wled_configure_short_irq()
1556 return rc; in wled_configure_short_irq()
1562 int rc; in wled_configure_ovp_irq() local
1571 rc = devm_request_threaded_irq(wled->dev, wled->ovp_irq, NULL, in wled_configure_ovp_irq()
1574 if (rc < 0) { in wled_configure_ovp_irq()
1576 rc); in wled_configure_ovp_irq()
1581 rc = regmap_read(wled->regmap, wled->ctrl_addr + in wled_configure_ovp_irq()
1583 if (rc < 0) in wled_configure_ovp_irq()
1584 return rc; in wled_configure_ovp_irq()
1604 int rc; in wled_probe() local
1626 rc = wled_configure(wled); in wled_probe()
1627 if (rc) in wled_probe()
1628 return rc; in wled_probe()
1637 rc = wled3_setup(wled); in wled_probe()
1638 if (rc) { in wled_probe()
1640 return rc; in wled_probe()
1646 rc = wled4_setup(wled); in wled_probe()
1647 if (rc) { in wled_probe()
1649 return rc; in wled_probe()
1658 rc = wled5_setup(wled); in wled_probe()
1659 if (rc) { in wled_probe()
1661 return rc; in wled_probe()
1672 rc = wled_configure_short_irq(wled, pdev); in wled_probe()
1673 if (rc < 0) in wled_probe()
1674 return rc; in wled_probe()
1676 rc = wled_configure_ovp_irq(wled, pdev); in wled_probe()
1677 if (rc < 0) in wled_probe()
1678 return rc; in wled_probe()