Lines Matching refs:rc

155 	int i, rc;
167 rc = regmap_field_write(flash_data->r_fields[REG_MODULE_EN], enable);
168 if (rc)
169 dev_err(led->flash.led_cdev.dev, "write module_en failed, rc=%d\n", rc);
172 return rc;
180 int i, rc;
197 rc = regmap_fields_write(flash_data->r_fields[REG_ITARGET], chan_id, itarget);
198 if (rc)
199 return rc;
227 int rc, i;
241 rc = regmap_fields_write(flash_data->r_fields[REG_CHAN_TIMER], chan_id, timer);
242 if (rc)
243 return rc;
253 int rc, i;
268 rc = regmap_fields_write(
270 if (rc)
271 return rc;
278 rc = regmap_field_update_bits(flash_data->r_fields[REG_CHAN_EN], chan_mask, chan_en);
279 if (rc)
280 return rc;
310 int rc;
312 rc = set_flash_strobe(led, SW_STROBE, false);
313 if (rc)
314 return rc;
316 rc = set_flash_current(led, led->flash_current_ma, FLASH_MODE);
317 if (rc)
318 return rc;
320 rc = set_flash_timeout(led, led->flash_timeout_ms);
321 if (rc)
322 return rc;
324 rc = set_flash_module_en(led, state);
325 if (rc)
326 return rc;
346 int i, rc;
348 rc = regmap_field_read(flash_data->r_fields[REG_STATUS1], &val);
349 if (rc)
350 return rc;
362 rc = regmap_field_read(flash_data->r_fields[REG_STATUS2], &val);
363 if (rc)
364 return rc;
394 rc = regmap_field_read(flash_data->r_fields[REG_STATUS3], &val);
395 if (rc)
396 return rc;
422 int rc;
424 rc = set_flash_strobe(led, SW_STROBE, false);
425 if (rc)
426 return rc;
428 rc = set_flash_module_en(led, false);
429 if (rc)
430 return rc;
432 rc = set_flash_current(led, current_ma, TORCH_MODE);
433 if (rc)
434 return rc;
437 rc = set_flash_timeout(led, 0);
438 if (rc)
439 return rc;
441 rc = set_flash_module_en(led, enable);
442 if (rc)
443 return rc;
461 int rc;
463 rc = set_flash_module_en(led, enable);
464 if (rc)
465 return rc;
547 int i, rc, count;
561 rc = fwnode_property_read_u32_array(node, "led-sources", channels, count);
562 if (rc < 0) {
563 dev_err(dev, "Failed to read led-sources property, rc=%d\n", rc);
564 return rc;
583 rc = fwnode_property_read_u32(node, "led-max-microamp", &current_ua);
584 if (rc < 0) {
585 dev_err(dev, "Failed to read led-max-microamp property, rc=%d\n", rc);
586 return rc;
600 rc = fwnode_property_read_u32(node, "flash-max-microamp", &current_ua);
601 if (rc < 0) {
602 dev_err(dev, "Failed to read flash-max-microamp property, rc=%d\n",
603 rc);
604 return rc;
619 rc = fwnode_property_read_u32(node, "flash-max-timeout-us", &timeout_us);
620 if (rc < 0) {
621 dev_err(dev, "Failed to read flash-max-timeout-us property, rc=%d\n",
622 rc);
623 return rc;
645 rc = devm_led_classdev_flash_register_ext(dev, flash, &init_data);
646 if (rc < 0) {
647 dev_err(dev, "Register flash LED classdev failed, rc=%d\n", rc);
648 return rc;
662 int count, i, rc;
675 rc = fwnode_property_read_u32(dev->fwnode, "reg", &reg_base);
676 if (rc < 0) {
677 dev_err(dev, "Failed to get register base address, rc=%d\n", rc);
678 return rc;
681 rc = regmap_read(regmap, reg_base + FLASH_TYPE_REG, &val);
682 if (rc < 0) {
683 dev_err(dev, "Read flash LED module type failed, rc=%d\n", rc);
684 return rc;
692 rc = regmap_read(regmap, reg_base + FLASH_SUBTYPE_REG, &val);
693 if (rc < 0) {
694 dev_err(dev, "Read flash LED module subtype failed, rc=%d\n", rc);
695 return rc;
714 rc = devm_regmap_field_bulk_alloc(dev, regmap, flash_data->r_fields, regs, REG_MAX_COUNT);
715 if (rc < 0) {
716 dev_err(dev, "Failed to allocate regmap field, rc=%d\n", rc);
717 return rc;
737 rc = -ENOMEM;
742 rc = qcom_flash_register_led_device(dev, child, led);
743 if (rc < 0)
755 return rc;