Lines Matching refs:rval
159 int rval; in as3645a_write() local
161 rval = i2c_smbus_write_byte_data(client, addr, val); in as3645a_write()
164 rval < 0 ? "fail" : "ok"); in as3645a_write()
166 return rval; in as3645a_write()
173 int rval; in as3645a_read() local
175 rval = i2c_smbus_read_byte_data(client, addr); in as3645a_read()
177 dev_dbg(&client->dev, "Read Addr:%02X Val:%02X %s\n", addr, rval, in as3645a_read()
178 rval < 0 ? "fail" : "ok"); in as3645a_read()
180 return rval; in as3645a_read()
254 int rval; in as3645a_get_fault() local
257 rval = as3645a_read(flash, AS_FAULT_INFO_REG); in as3645a_get_fault()
258 if (rval < 0) in as3645a_get_fault()
259 return rval; in as3645a_get_fault()
261 if (rval & AS_FAULT_INFO_INDUCTOR_PEAK_LIMIT) in as3645a_get_fault()
264 if (rval & AS_FAULT_INFO_INDICATOR_LED) in as3645a_get_fault()
268 rval & AS_FAULT_INFO_LED_AMOUNT ? 2 : 1); in as3645a_get_fault()
270 if (rval & AS_FAULT_INFO_TIMEOUT) in as3645a_get_fault()
273 if (rval & AS_FAULT_INFO_OVER_TEMPERATURE) in as3645a_get_fault()
276 if (rval & AS_FAULT_INFO_SHORT_CIRCUIT) in as3645a_get_fault()
279 if (rval & AS_FAULT_INFO_OVER_VOLTAGE) in as3645a_get_fault()
282 return rval; in as3645a_get_fault()
315 int rval; in as3645a_set_indicator_brightness() local
319 rval = as3645a_set_timeout(flash); in as3645a_set_indicator_brightness()
320 if (rval) in as3645a_set_indicator_brightness()
321 return rval; in as3645a_set_indicator_brightness()
331 int rval; in as3645a_set_assist_brightness() local
337 rval = as3645a_set_current(flash); in as3645a_set_assist_brightness()
338 if (rval) in as3645a_set_assist_brightness()
339 return rval; in as3645a_set_assist_brightness()
384 int rval; in as3645a_setup() local
387 rval = as3645a_read(flash, AS_FAULT_INFO_REG); in as3645a_setup()
388 if (rval < 0) in as3645a_setup()
389 return rval; in as3645a_setup()
391 dev_dbg(dev, "Fault info: %02x\n", rval); in as3645a_setup()
393 rval = as3645a_set_current(flash); in as3645a_setup()
394 if (rval < 0) in as3645a_setup()
395 return rval; in as3645a_setup()
397 rval = as3645a_set_timeout(flash); in as3645a_setup()
398 if (rval < 0) in as3645a_setup()
399 return rval; in as3645a_setup()
401 rval = as3645a_set_control(flash, AS_MODE_INDICATOR, false); in as3645a_setup()
402 if (rval < 0) in as3645a_setup()
403 return rval; in as3645a_setup()
406 rval = as3645a_get_fault(&flash->fled, &fault); in as3645a_setup()
407 if (rval < 0) in as3645a_setup()
408 return rval; in as3645a_setup()
417 return rval & ~AS_FAULT_INFO_LED_AMOUNT ? -EIO : 0; in as3645a_setup()
423 int rval, man, model, rfu, version; in as3645a_detect() local
426 rval = as3645a_read(flash, AS_DESIGN_INFO_REG); in as3645a_detect()
427 if (rval < 0) { in as3645a_detect()
429 return rval; in as3645a_detect()
432 man = AS_DESIGN_INFO_FACTORY(rval); in as3645a_detect()
433 model = AS_DESIGN_INFO_MODEL(rval); in as3645a_detect()
435 rval = as3645a_read(flash, AS_VERSION_CONTROL_REG); in as3645a_detect()
436 if (rval < 0) { in as3645a_detect()
438 return rval; in as3645a_detect()
441 rfu = AS_VERSION_CONTROL_RFU(rval); in as3645a_detect()
442 version = AS_VERSION_CONTROL_VERSION(rval); in as3645a_detect()
474 rval = as3645a_write(flash, AS_PASSWORD_REG, AS_PASSWORD_UNLOCK_VALUE); in as3645a_detect()
475 if (rval < 0) in as3645a_detect()
476 return rval; in as3645a_detect()
486 int rval; in as3645a_parse_node() local
514 rval = fwnode_property_read_u32(flash->flash_node, "flash-timeout-us", in as3645a_parse_node()
516 if (rval < 0) { in as3645a_parse_node()
522 rval = fwnode_property_read_u32(flash->flash_node, "flash-max-microamp", in as3645a_parse_node()
524 if (rval < 0) { in as3645a_parse_node()
530 rval = fwnode_property_read_u32(flash->flash_node, "led-max-microamp", in as3645a_parse_node()
532 if (rval < 0) { in as3645a_parse_node()
548 rval = -ENODEV; in as3645a_parse_node()
553 rval = fwnode_property_read_u32(flash->indicator_node, in as3645a_parse_node()
556 if (rval < 0) { in as3645a_parse_node()
568 return rval; in as3645a_parse_node()
577 int rval; in as3645a_led_class_setup() local
588 rval = led_classdev_register_ext(&flash->client->dev, iled_cdev, in as3645a_led_class_setup()
590 if (rval < 0) in as3645a_led_class_setup()
591 return rval; in as3645a_led_class_setup()
618 rval = led_classdev_flash_register_ext(&flash->client->dev, in as3645a_led_class_setup()
620 if (rval) in as3645a_led_class_setup()
623 return rval; in as3645a_led_class_setup()
629 rval); in as3645a_led_class_setup()
630 return rval; in as3645a_led_class_setup()
678 int rval; in as3645a_probe() local
689 rval = as3645a_parse_node(flash, dev_fwnode(&client->dev)); in as3645a_probe()
690 if (rval < 0) in as3645a_probe()
691 return rval; in as3645a_probe()
693 rval = as3645a_detect(flash); in as3645a_probe()
694 if (rval < 0) in as3645a_probe()
700 rval = as3645a_setup(flash); in as3645a_probe()
701 if (rval) in as3645a_probe()
704 rval = as3645a_led_class_setup(flash); in as3645a_probe()
705 if (rval) in as3645a_probe()
708 rval = as3645a_v4l2_setup(flash); in as3645a_probe()
709 if (rval) in as3645a_probe()
724 return rval; in as3645a_probe()