Lines Matching refs:error

206 	int error;  in ims_pcu_setup_buttons()  local
237 error = input_register_device(input); in ims_pcu_setup_buttons()
238 if (error) { in ims_pcu_setup_buttons()
241 error); in ims_pcu_setup_buttons()
243 return error; in ims_pcu_setup_buttons()
288 int error; in ims_pcu_setup_gamepad() local
295 error = -ENOMEM; in ims_pcu_setup_gamepad()
324 error = input_register_device(input); in ims_pcu_setup_gamepad()
325 if (error) { in ims_pcu_setup_gamepad()
328 error); in ims_pcu_setup_gamepad()
338 return error; in ims_pcu_setup_gamepad()
512 int error; in ims_pcu_send_cmd_chunk() local
514 error = usb_bulk_msg(pcu->udev, in ims_pcu_send_cmd_chunk()
519 if (error < 0) { in ims_pcu_send_cmd_chunk()
522 command, chunk, error); in ims_pcu_send_cmd_chunk()
523 return error; in ims_pcu_send_cmd_chunk()
536 int error; in ims_pcu_send_command() local
560 error = ims_pcu_send_cmd_chunk(pcu, command, in ims_pcu_send_command()
562 if (error) in ims_pcu_send_command()
563 return error; in ims_pcu_send_command()
579 error = ims_pcu_send_cmd_chunk(pcu, command, ++chunk, count); in ims_pcu_send_command()
580 if (error) in ims_pcu_send_command()
581 return error; in ims_pcu_send_command()
599 int error; in __ims_pcu_execute_command() local
604 error = ims_pcu_send_command(pcu, command, data, len); in __ims_pcu_execute_command()
605 if (error) in __ims_pcu_execute_command()
606 return error; in __ims_pcu_execute_command()
653 int error; in __ims_pcu_execute_bl_command() local
659 error = __ims_pcu_execute_command(pcu, in __ims_pcu_execute_bl_command()
663 if (error) { in __ims_pcu_execute_bl_command()
666 pcu->cmd_buf[0], error); in __ims_pcu_execute_bl_command()
667 return error; in __ims_pcu_execute_bl_command()
693 int error; in ims_pcu_get_info() local
695 error = ims_pcu_execute_query(pcu, GET_INFO); in ims_pcu_get_info()
696 if (error) { in ims_pcu_get_info()
698 "GET_INFO command failed, error: %d\n", error); in ims_pcu_get_info()
699 return error; in ims_pcu_get_info()
717 int error; in ims_pcu_set_info() local
726 error = ims_pcu_execute_command(pcu, SET_INFO, in ims_pcu_set_info()
729 if (error) { in ims_pcu_set_info()
732 error); in ims_pcu_set_info()
733 return error; in ims_pcu_set_info()
741 int error; in ims_pcu_switch_to_bootloader() local
744 error = ims_pcu_execute_command(pcu, JUMP_TO_BTLDR, NULL, 0); in ims_pcu_switch_to_bootloader()
745 if (error) { in ims_pcu_switch_to_bootloader()
748 error); in ims_pcu_switch_to_bootloader()
749 return error; in ims_pcu_switch_to_bootloader()
784 int error; in ims_pcu_verify_block() local
790 error = ims_pcu_execute_bl_command(pcu, READ_APP, NULL, 5, in ims_pcu_verify_block()
792 if (error) { in ims_pcu_verify_block()
795 addr, len, error); in ims_pcu_verify_block()
796 return error; in ims_pcu_verify_block()
828 int error; in ims_pcu_flash_firmware() local
830 error = ims_pcu_execute_bl_command(pcu, ERASE_APP, NULL, 0, 2000); in ims_pcu_flash_firmware()
831 if (error) { in ims_pcu_flash_firmware()
834 error); in ims_pcu_flash_firmware()
835 return error; in ims_pcu_flash_firmware()
853 error = ims_pcu_execute_bl_command(pcu, PROGRAM_DEVICE, in ims_pcu_flash_firmware()
856 if (error) { in ims_pcu_flash_firmware()
859 addr, len, error); in ims_pcu_flash_firmware()
860 return error; in ims_pcu_flash_firmware()
864 error = ims_pcu_verify_block(pcu, addr, len, rec->data); in ims_pcu_flash_firmware()
865 if (error) in ims_pcu_flash_firmware()
866 return error; in ims_pcu_flash_firmware()
875 error = ims_pcu_execute_bl_command(pcu, PROGRAM_COMPLETE, in ims_pcu_flash_firmware()
877 if (error) in ims_pcu_flash_firmware()
880 error); in ims_pcu_flash_firmware()
916 int error; in ims_pcu_process_async_firmware() local
924 error = ihex_validate_fw(fw); in ims_pcu_process_async_firmware()
925 if (error) { in ims_pcu_process_async_firmware()
955 int error; in ims_pcu_backlight_set_brightness() local
959 error = ims_pcu_execute_command(pcu, SET_BRIGHTNESS, in ims_pcu_backlight_set_brightness()
961 if (error && error != -ENODEV) in ims_pcu_backlight_set_brightness()
964 value, error); in ims_pcu_backlight_set_brightness()
968 return error; in ims_pcu_backlight_set_brightness()
979 int error; in ims_pcu_backlight_get_brightness() local
983 error = ims_pcu_execute_query(pcu, GET_BRIGHTNESS); in ims_pcu_backlight_get_brightness()
984 if (error) { in ims_pcu_backlight_get_brightness()
987 error); in ims_pcu_backlight_get_brightness()
1003 int error; in ims_pcu_setup_backlight() local
1014 error = led_classdev_register(pcu->dev, &backlight->cdev); in ims_pcu_setup_backlight()
1015 if (error) { in ims_pcu_setup_backlight()
1018 error); in ims_pcu_setup_backlight()
1019 return error; in ims_pcu_setup_backlight()
1067 int error; in ims_pcu_attribute_store() local
1076 error = mutex_lock_interruptible(&pcu->cmd_mutex); in ims_pcu_attribute_store()
1077 if (error) in ims_pcu_attribute_store()
1078 return error; in ims_pcu_attribute_store()
1083 error = ims_pcu_set_info(pcu); in ims_pcu_attribute_store()
1093 return error < 0 ? error : count; in ims_pcu_attribute_store()
1126 int error; in ims_pcu_reset_device() local
1128 error = kstrtoint(buf, 0, &value); in ims_pcu_reset_device()
1129 if (error) in ims_pcu_reset_device()
1130 return error; in ims_pcu_reset_device()
1137 error = ims_pcu_execute_command(pcu, PCU_RESET, &reset_byte, 1); in ims_pcu_reset_device()
1138 if (error) { in ims_pcu_reset_device()
1141 error); in ims_pcu_reset_device()
1142 return error; in ims_pcu_reset_device()
1158 int error; in ims_pcu_update_firmware_store() local
1160 error = kstrtoint(buf, 0, &value); in ims_pcu_update_firmware_store()
1161 if (error) in ims_pcu_update_firmware_store()
1162 return error; in ims_pcu_update_firmware_store()
1167 error = mutex_lock_interruptible(&pcu->cmd_mutex); in ims_pcu_update_firmware_store()
1168 if (error) in ims_pcu_update_firmware_store()
1169 return error; in ims_pcu_update_firmware_store()
1171 error = request_ihex_firmware(&fw, IMS_PCU_FIRMWARE_NAME, pcu->dev); in ims_pcu_update_firmware_store()
1172 if (error) { in ims_pcu_update_firmware_store()
1174 IMS_PCU_FIRMWARE_NAME, error); in ims_pcu_update_firmware_store()
1187 error = ims_pcu_handle_firmware_update(pcu, fw); in ims_pcu_update_firmware_store()
1189 error = ims_pcu_switch_to_bootloader(pcu); in ims_pcu_update_firmware_store()
1195 return error ?: count; in ims_pcu_update_firmware_store()
1261 int error; in ims_pcu_read_ofn_config() local
1264 error = ims_pcu_execute_command(pcu, OFN_GET_CONFIG, in ims_pcu_read_ofn_config()
1266 if (error) in ims_pcu_read_ofn_config()
1267 return error; in ims_pcu_read_ofn_config()
1281 int error; in ims_pcu_write_ofn_config() local
1284 error = ims_pcu_execute_command(pcu, OFN_SET_CONFIG, in ims_pcu_write_ofn_config()
1286 if (error) in ims_pcu_write_ofn_config()
1287 return error; in ims_pcu_write_ofn_config()
1302 int error; in ims_pcu_ofn_reg_data_show() local
1306 error = ims_pcu_read_ofn_config(pcu, pcu->ofn_reg_addr, &data); in ims_pcu_ofn_reg_data_show()
1309 if (error) in ims_pcu_ofn_reg_data_show()
1310 return error; in ims_pcu_ofn_reg_data_show()
1321 int error; in ims_pcu_ofn_reg_data_store() local
1324 error = kstrtou8(buf, 0, &value); in ims_pcu_ofn_reg_data_store()
1325 if (error) in ims_pcu_ofn_reg_data_store()
1326 return error; in ims_pcu_ofn_reg_data_store()
1329 error = ims_pcu_write_ofn_config(pcu, pcu->ofn_reg_addr, value); in ims_pcu_ofn_reg_data_store()
1332 return error ?: count; in ims_pcu_ofn_reg_data_store()
1344 int error; in ims_pcu_ofn_reg_addr_show() local
1347 error = scnprintf(buf, PAGE_SIZE, "%x\n", pcu->ofn_reg_addr); in ims_pcu_ofn_reg_addr_show()
1350 return error; in ims_pcu_ofn_reg_addr_show()
1359 int error; in ims_pcu_ofn_reg_addr_store() local
1362 error = kstrtou8(buf, 0, &value); in ims_pcu_ofn_reg_addr_store()
1363 if (error) in ims_pcu_ofn_reg_addr_store()
1364 return error; in ims_pcu_ofn_reg_addr_store()
1390 int error; in ims_pcu_ofn_bit_show() local
1394 error = ims_pcu_read_ofn_config(pcu, attr->addr, &data); in ims_pcu_ofn_bit_show()
1397 if (error) in ims_pcu_ofn_bit_show()
1398 return error; in ims_pcu_ofn_bit_show()
1411 int error; in ims_pcu_ofn_bit_store() local
1415 error = kstrtoint(buf, 0, &value); in ims_pcu_ofn_bit_store()
1416 if (error) in ims_pcu_ofn_bit_store()
1417 return error; in ims_pcu_ofn_bit_store()
1424 error = ims_pcu_read_ofn_config(pcu, attr->addr, &data); in ims_pcu_ofn_bit_store()
1425 if (!error) { in ims_pcu_ofn_bit_store()
1431 error = ims_pcu_write_ofn_config(pcu, attr->addr, data); in ims_pcu_ofn_bit_store()
1436 return error ?: count; in ims_pcu_ofn_bit_store()
1513 int error; in ims_pcu_buffers_alloc() local
1526 error = -ENOMEM; in ims_pcu_buffers_alloc()
1546 error = -ENOMEM; in ims_pcu_buffers_alloc()
1555 error = -ENOMEM; in ims_pcu_buffers_alloc()
1562 error = -ENOMEM; in ims_pcu_buffers_alloc()
1587 return error; in ims_pcu_buffers_alloc()
1723 int error; in ims_pcu_start_io() local
1725 error = usb_submit_urb(pcu->urb_ctrl, GFP_KERNEL); in ims_pcu_start_io()
1726 if (error) { in ims_pcu_start_io()
1729 error); in ims_pcu_start_io()
1733 error = usb_submit_urb(pcu->urb_in, GFP_KERNEL); in ims_pcu_start_io()
1734 if (error) { in ims_pcu_start_io()
1737 error); in ims_pcu_start_io()
1755 int error; in ims_pcu_line_setup() local
1761 error = usb_control_msg(pcu->udev, usb_sndctrlpipe(pcu->udev, 0), in ims_pcu_line_setup()
1767 if (error < 0) { in ims_pcu_line_setup()
1769 error); in ims_pcu_line_setup()
1770 return error; in ims_pcu_line_setup()
1773 error = usb_control_msg(pcu->udev, usb_sndctrlpipe(pcu->udev, 0), in ims_pcu_line_setup()
1778 if (error < 0) { in ims_pcu_line_setup()
1780 error); in ims_pcu_line_setup()
1781 return error; in ims_pcu_line_setup()
1789 int error; in ims_pcu_get_device_info() local
1791 error = ims_pcu_get_info(pcu); in ims_pcu_get_device_info()
1792 if (error) in ims_pcu_get_device_info()
1793 return error; in ims_pcu_get_device_info()
1795 error = ims_pcu_execute_query(pcu, GET_FW_VERSION); in ims_pcu_get_device_info()
1796 if (error) { in ims_pcu_get_device_info()
1798 "GET_FW_VERSION command failed, error: %d\n", error); in ims_pcu_get_device_info()
1799 return error; in ims_pcu_get_device_info()
1807 error = ims_pcu_execute_query(pcu, GET_BL_VERSION); in ims_pcu_get_device_info()
1808 if (error) { in ims_pcu_get_device_info()
1810 "GET_BL_VERSION command failed, error: %d\n", error); in ims_pcu_get_device_info()
1811 return error; in ims_pcu_get_device_info()
1819 error = ims_pcu_execute_query(pcu, RESET_REASON); in ims_pcu_get_device_info()
1820 if (error) { in ims_pcu_get_device_info()
1822 "RESET_REASON command failed, error: %d\n", error); in ims_pcu_get_device_info()
1823 return error; in ims_pcu_get_device_info()
1843 int error; in ims_pcu_identify_type() local
1845 error = ims_pcu_execute_query(pcu, GET_DEVICE_ID); in ims_pcu_identify_type()
1846 if (error) { in ims_pcu_identify_type()
1848 "GET_DEVICE_ID command failed, error: %d\n", error); in ims_pcu_identify_type()
1849 return error; in ims_pcu_identify_type()
1863 int error; in ims_pcu_init_application_mode() local
1865 error = ims_pcu_get_device_info(pcu); in ims_pcu_init_application_mode()
1866 if (error) { in ims_pcu_init_application_mode()
1868 return error; in ims_pcu_init_application_mode()
1871 error = ims_pcu_identify_type(pcu, &pcu->device_id); in ims_pcu_init_application_mode()
1872 if (error) { in ims_pcu_init_application_mode()
1874 "Failed to identify device, error: %d\n", error); in ims_pcu_init_application_mode()
1897 error = sysfs_create_group(&pcu->dev->kobj, in ims_pcu_init_application_mode()
1899 if (error) in ims_pcu_init_application_mode()
1900 return error; in ims_pcu_init_application_mode()
1903 error = ims_pcu_setup_backlight(pcu); in ims_pcu_init_application_mode()
1904 if (error) in ims_pcu_init_application_mode()
1905 return error; in ims_pcu_init_application_mode()
1908 error = ims_pcu_setup_buttons(pcu, info->keymap, info->keymap_len); in ims_pcu_init_application_mode()
1909 if (error) in ims_pcu_init_application_mode()
1913 error = ims_pcu_setup_gamepad(pcu); in ims_pcu_init_application_mode()
1914 if (error) in ims_pcu_init_application_mode()
1926 return error; in ims_pcu_init_application_mode()
1948 int error; in ims_pcu_init_bootloader_mode() local
1950 error = ims_pcu_execute_bl_command(pcu, QUERY_DEVICE, NULL, 0, in ims_pcu_init_bootloader_mode()
1952 if (error) { in ims_pcu_init_bootloader_mode()
1954 return error; in ims_pcu_init_bootloader_mode()
1966 error = request_firmware_nowait(THIS_MODULE, true, in ims_pcu_init_bootloader_mode()
1970 if (error) { in ims_pcu_init_bootloader_mode()
1994 int error; in ims_pcu_probe() local
2007 error = ims_pcu_parse_cdc_data(intf, pcu); in ims_pcu_probe()
2008 if (error) in ims_pcu_probe()
2011 error = usb_driver_claim_interface(&ims_pcu_driver, in ims_pcu_probe()
2013 if (error) { in ims_pcu_probe()
2016 error); in ims_pcu_probe()
2022 error = ims_pcu_buffers_alloc(pcu); in ims_pcu_probe()
2023 if (error) in ims_pcu_probe()
2026 error = ims_pcu_start_io(pcu); in ims_pcu_probe()
2027 if (error) in ims_pcu_probe()
2030 error = ims_pcu_line_setup(pcu); in ims_pcu_probe()
2031 if (error) in ims_pcu_probe()
2034 error = sysfs_create_group(&intf->dev.kobj, &ims_pcu_attr_group); in ims_pcu_probe()
2035 if (error) in ims_pcu_probe()
2038 error = pcu->bootloader_mode ? in ims_pcu_probe()
2041 if (error) in ims_pcu_probe()
2056 return error; in ims_pcu_probe()