Lines Matching refs:rc
233 int rc, i; in wled3_set_brightness() local
239 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
262 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
288 rc = regmap_bulk_write(wled->regmap, wled->sink_addr + offset, in wled5_set_brightness()
290 return rc; in wled5_set_brightness()
302 int rc; in wled_module_enable() local
307 rc = regmap_update_bits(wled->regmap, wled->ctrl_addr + in wled_module_enable()
311 if (rc < 0) in wled_module_enable()
312 return rc; in wled_module_enable()
334 int rc; in wled3_sync_toggle() local
337 rc = regmap_update_bits(wled->regmap, in wled3_sync_toggle()
340 if (rc < 0) in wled3_sync_toggle()
341 return rc; in wled3_sync_toggle()
343 rc = regmap_update_bits(wled->regmap, in wled3_sync_toggle()
347 return rc; in wled3_sync_toggle()
352 int rc; in wled5_mod_sync_toggle() local
355 rc = regmap_update_bits(wled->regmap, in wled5_mod_sync_toggle()
358 if (rc < 0) in wled5_mod_sync_toggle()
359 return rc; in wled5_mod_sync_toggle()
370 int rc; in wled_ovp_fault_status() local
374 rc = regmap_read(wled->regmap, in wled_ovp_fault_status()
377 if (rc < 0) { in wled_ovp_fault_status()
378 dev_err(wled->dev, "Failed to read INT_RT_STS rc=%d\n", rc); in wled_ovp_fault_status()
379 return rc; in wled_ovp_fault_status()
382 rc = regmap_read(wled->regmap, in wled_ovp_fault_status()
385 if (rc < 0) { in wled_ovp_fault_status()
386 dev_err(wled->dev, "Failed to read FAULT_STATUS rc=%d\n", rc); in wled_ovp_fault_status()
387 return rc; in wled_ovp_fault_status()
404 return rc; in wled_ovp_fault_status()
414 int rc, delay_us; in wled5_ovp_delay() local
419 rc = regmap_read(wled->regmap, wled->ctrl_addr + in wled5_ovp_delay()
421 if (rc < 0) in wled5_ovp_delay()
436 int rc = 0; in wled_update_status() local
440 rc = wled->wled_set_brightness(wled, brightness); in wled_update_status()
441 if (rc < 0) { in wled_update_status()
443 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()
458 rc = wled5_mod_sync_toggle(wled); in wled_update_status()
459 if (rc < 0) { in wled_update_status()
461 rc); in wled_update_status()
468 rc = wled_module_enable(wled, !!brightness); in wled_update_status()
469 if (rc < 0) { in wled_update_status()
470 dev_err(wled->dev, "wled enable failed rc:%d\n", rc); in wled_update_status()
480 return rc; in wled_update_status()
485 int i, j, rc; in wled4_cabc_config() local
492 rc = regmap_update_bits(wled->regmap, wled->sink_addr + in wled4_cabc_config()
495 if (rc < 0) in wled4_cabc_config()
496 return rc; in wled4_cabc_config()
504 int rc, offset; in wled5_cabc_config() local
514 rc = regmap_update_bits(wled->regmap, wled->sink_addr + offset, in wled5_cabc_config()
516 if (rc < 0) { in wled5_cabc_config()
517 pr_err("Error in configuring CABC rc=%d\n", rc); in wled5_cabc_config()
518 return rc; in wled5_cabc_config()
534 int rc; in wled_short_irq_handler() local
539 rc = wled_module_enable(wled, false); in wled_short_irq_handler()
540 if (rc < 0) { in wled_short_irq_handler()
541 dev_err(wled->dev, "wled disable failed rc:%d\n", rc); in wled_short_irq_handler()
560 rc = wled_module_enable(wled, true); in wled_short_irq_handler()
561 if (rc < 0) in wled_short_irq_handler()
562 dev_err(wled->dev, "wled enable failed rc:%d\n", rc); in wled_short_irq_handler()
574 int rc = 0, i, j, delay_time_us; in wled_auto_string_detection() local
580 rc = regmap_read(wled->regmap, wled->sink_addr + in wled_auto_string_detection()
582 if (rc < 0) { in wled_auto_string_detection()
584 rc); in wled_auto_string_detection()
589 rc = regmap_update_bits(wled->regmap, in wled_auto_string_detection()
592 if (rc < 0) { in wled_auto_string_detection()
593 dev_err(wled->dev, "Failed to disable WLED module rc=%d\n", rc); in wled_auto_string_detection()
598 rc = wled4_set_brightness(wled, AUTO_DETECT_BRIGHTNESS); in wled_auto_string_detection()
599 if (rc < 0) { in wled_auto_string_detection()
601 rc); in wled_auto_string_detection()
606 rc = wled->wled_cabc_config(wled, false); in wled_auto_string_detection()
607 if (rc < 0) in wled_auto_string_detection()
612 rc = regmap_write(wled->regmap, in wled_auto_string_detection()
614 if (rc < 0) { in wled_auto_string_detection()
615 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()
629 j + 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()
638 j + 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()
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()
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()
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()
698 rc); in wled_auto_string_detection()
713 rc = regmap_write(wled->regmap, wled->sink_addr + in wled_auto_string_detection()
715 if (rc < 0) { in wled_auto_string_detection()
717 rc); in wled_auto_string_detection()
724 rc = wled->wled_cabc_config(wled, true); in wled_auto_string_detection()
725 if (rc < 0) in wled_auto_string_detection()
729 rc = regmap_write(wled->regmap, in wled_auto_string_detection()
731 if (rc < 0) { in wled_auto_string_detection()
733 rc); in wled_auto_string_detection()
738 rc = wled4_set_brightness(wled, wled->brightness); in wled_auto_string_detection()
739 if (rc < 0) { in wled_auto_string_detection()
741 rc); in wled_auto_string_detection()
745 rc = regmap_update_bits(wled->regmap, in wled_auto_string_detection()
749 if (rc < 0) { in wled_auto_string_detection()
750 dev_err(wled->dev, "Failed to enable WLED module rc=%d\n", rc); in wled_auto_string_detection()
813 int rc; in wled_auto_detection_at_init() local
819 rc = wled_ovp_fault_status(wled, &fault_set); in wled_auto_detection_at_init()
820 if (rc < 0) { in wled_auto_detection_at_init()
822 rc); in wled_auto_detection_at_init()
823 return rc; in wled_auto_detection_at_init()
832 return rc; in wled_auto_detection_at_init()
838 int rc; in wled_ovp_irq_handler() local
841 rc = regmap_read(wled->regmap, in wled_ovp_irq_handler()
843 if (rc < 0) { in wled_ovp_irq_handler()
845 rc); in wled_ovp_irq_handler()
849 rc = regmap_read(wled->regmap, wled->ctrl_addr + in wled_ovp_irq_handler()
851 if (rc < 0) { in wled_ovp_irq_handler()
853 rc); in wled_ovp_irq_handler()
877 int rc, i, j; in wled3_setup() local
879 rc = regmap_update_bits(wled->regmap, in wled3_setup()
882 if (rc) in wled3_setup()
883 return rc; in wled3_setup()
885 rc = regmap_update_bits(wled->regmap, in wled3_setup()
889 if (rc) in wled3_setup()
890 return rc; in wled3_setup()
892 rc = regmap_update_bits(wled->regmap, in wled3_setup()
896 if (rc) in wled3_setup()
897 return rc; in wled3_setup()
902 rc = regmap_update_bits(wled->regmap, addr, in wled3_setup()
905 if (rc) in wled3_setup()
906 return rc; in wled3_setup()
910 rc = regmap_update_bits(wled->regmap, addr, in wled3_setup()
913 if (rc) in wled3_setup()
914 return rc; in wled3_setup()
918 rc = regmap_update_bits(wled->regmap, addr, in wled3_setup()
921 if (rc) in wled3_setup()
922 return rc; in wled3_setup()
925 rc = regmap_update_bits(wled->regmap, addr, in wled3_setup()
929 if (rc) in wled3_setup()
930 return rc; in wled3_setup()
935 rc = regmap_update_bits(wled->regmap, in wled3_setup()
938 if (rc) in wled3_setup()
939 return rc; in wled3_setup()
958 int rc, temp, i, j; in wled4_setup() local
963 rc = regmap_update_bits(wled->regmap, in wled4_setup()
966 if (rc < 0) in wled4_setup()
967 return rc; in wled4_setup()
969 rc = regmap_update_bits(wled->regmap, in wled4_setup()
973 if (rc < 0) in wled4_setup()
974 return rc; in wled4_setup()
976 rc = regmap_update_bits(wled->regmap, in wled4_setup()
980 if (rc < 0) in wled4_setup()
981 return rc; in wled4_setup()
985 rc = regmap_write(wled->regmap, wled->ctrl_addr + in wled4_setup()
988 if (rc < 0) in wled4_setup()
989 return rc; in wled4_setup()
991 rc = regmap_write(wled->regmap, in wled4_setup()
994 if (rc < 0) in wled4_setup()
995 return rc; in wled4_setup()
998 rc = regmap_read(wled->regmap, wled->sink_addr + in wled4_setup()
1000 if (rc < 0) in wled4_setup()
1001 return rc; in wled4_setup()
1010 rc = wled_auto_detection_at_init(wled); in wled4_setup()
1011 return rc; in wled4_setup()
1014 rc = regmap_update_bits(wled->regmap, in wled4_setup()
1017 if (rc < 0) in wled4_setup()
1018 return rc; in wled4_setup()
1020 rc = regmap_update_bits(wled->regmap, wled->ctrl_addr + in wled4_setup()
1023 if (rc < 0) in wled4_setup()
1024 return rc; in wled4_setup()
1032 rc = regmap_update_bits(wled->regmap, addr, in wled4_setup()
1035 if (rc < 0) in wled4_setup()
1036 return rc; in wled4_setup()
1040 rc = regmap_update_bits(wled->regmap, addr, in wled4_setup()
1043 if (rc < 0) in wled4_setup()
1044 return rc; in wled4_setup()
1047 rc = wled4_cabc_config(wled, wled->cfg.cabc); in wled4_setup()
1048 if (rc < 0) in wled4_setup()
1049 return rc; in wled4_setup()
1051 rc = regmap_update_bits(wled->regmap, wled->ctrl_addr + in wled4_setup()
1055 if (rc < 0) in wled4_setup()
1056 return rc; in wled4_setup()
1058 rc = regmap_update_bits(wled->regmap, in wled4_setup()
1061 if (rc < 0) in wled4_setup()
1062 return rc; in wled4_setup()
1064 rc = wled->wled_sync_toggle(wled); in wled4_setup()
1065 if (rc < 0) { in wled4_setup()
1066 dev_err(wled->dev, "Failed to toggle sync reg rc:%d\n", rc); in wled4_setup()
1067 return rc; in wled4_setup()
1070 rc = wled_auto_detection_at_init(wled); in wled4_setup()
1072 return rc; in wled4_setup()
1089 int rc, temp, i, j, offset; in wled5_setup() local
1094 rc = regmap_update_bits(wled->regmap, in wled5_setup()
1097 if (rc < 0) in wled5_setup()
1098 return rc; in wled5_setup()
1100 rc = regmap_update_bits(wled->regmap, in wled5_setup()
1104 if (rc < 0) in wled5_setup()
1105 return rc; in wled5_setup()
1107 rc = regmap_update_bits(wled->regmap, in wled5_setup()
1111 if (rc < 0) in wled5_setup()
1112 return rc; in wled5_setup()
1119 rc = regmap_update_bits(wled->regmap, addr, in wled5_setup()
1122 if (rc < 0) in wled5_setup()
1123 return rc; in wled5_setup()
1126 rc = regmap_update_bits(wled->regmap, addr, in wled5_setup()
1136 rc = wled5_cabc_config(wled, wled->cfg.cabc_sel ? true : false); in wled5_setup()
1137 if (rc < 0) in wled5_setup()
1138 return rc; in wled5_setup()
1143 rc = regmap_update_bits(wled->regmap, addr, in wled5_setup()
1145 if (rc < 0) in wled5_setup()
1146 return rc; in wled5_setup()
1150 rc = regmap_update_bits(wled->regmap, addr, in wled5_setup()
1152 if (rc < 0) in wled5_setup()
1153 return rc; in wled5_setup()
1163 rc = regmap_write(wled->regmap, addr, val); in wled5_setup()
1164 if (rc < 0) in wled5_setup()
1165 return rc; in wled5_setup()
1167 rc = regmap_update_bits(wled->regmap, in wled5_setup()
1170 if (rc < 0) in wled5_setup()
1171 return rc; in wled5_setup()
1174 rc = wled->wled_sync_toggle(wled); in wled5_setup()
1175 if (rc < 0) { in wled5_setup()
1176 pr_err("Failed to toggle sync reg rc:%d\n", rc); in wled5_setup()
1177 return rc; in wled5_setup()
1180 rc = wled_auto_detection_at_init(wled); in wled5_setup()
1181 if (rc < 0) in wled5_setup()
1182 return rc; in wled5_setup()
1311 int rc, i, j, string_len; in wled_configure() local
1408 rc = of_property_read_string(dev->of_node, "label", &wled->name); in wled_configure()
1409 if (rc) in wled_configure()
1469 rc = of_property_read_u32(dev->of_node, u32_opts[i].name, &val); in wled_configure()
1470 if (rc == -EINVAL) { in wled_configure()
1472 } else if (rc) { in wled_configure()
1474 return rc; in wled_configure()
1509 rc = of_property_read_u32_array(dev->of_node, in wled_configure()
1513 if (rc) { in wled_configure()
1515 string_len, rc); in wled_configure()
1516 return rc; in wled_configure()
1531 rc = of_property_read_u32(dev->of_node, "qcom,num-strings", &val); in wled_configure()
1532 if (!rc) { in wled_configure()
1557 int rc; in wled_configure_short_irq() local
1562 rc = regmap_update_bits(wled->regmap, wled->ctrl_addr + in wled_configure_short_irq()
1566 if (rc < 0) in wled_configure_short_irq()
1567 return rc; in wled_configure_short_irq()
1575 rc = devm_request_threaded_irq(wled->dev, wled->short_irq, in wled_configure_short_irq()
1579 if (rc < 0) in wled_configure_short_irq()
1581 rc); in wled_configure_short_irq()
1583 return rc; in wled_configure_short_irq()
1589 int rc; in wled_configure_ovp_irq() local
1598 rc = devm_request_threaded_irq(wled->dev, wled->ovp_irq, NULL, in wled_configure_ovp_irq()
1601 if (rc < 0) { in wled_configure_ovp_irq()
1603 rc); in wled_configure_ovp_irq()
1608 rc = regmap_read(wled->regmap, wled->ctrl_addr + in wled_configure_ovp_irq()
1610 if (rc < 0) in wled_configure_ovp_irq()
1611 return rc; in wled_configure_ovp_irq()
1631 int rc; in wled_probe() local
1653 rc = wled_configure(wled); in wled_probe()
1654 if (rc) in wled_probe()
1655 return rc; in wled_probe()
1664 rc = wled3_setup(wled); in wled_probe()
1665 if (rc) { in wled_probe()
1667 return rc; in wled_probe()
1673 rc = wled4_setup(wled); in wled_probe()
1674 if (rc) { in wled_probe()
1676 return rc; in wled_probe()
1685 rc = wled5_setup(wled); in wled_probe()
1686 if (rc) { in wled_probe()
1688 return rc; in wled_probe()
1699 rc = wled_configure_short_irq(wled, pdev); in wled_probe()
1700 if (rc < 0) in wled_probe()
1701 return rc; in wled_probe()
1703 rc = wled_configure_ovp_irq(wled, pdev); in wled_probe()
1704 if (rc < 0) in wled_probe()
1705 return rc; in wled_probe()