diff options
Diffstat (limited to 'drivers/hid/hid-picolcd.c')
-rw-r--r-- | drivers/hid/hid-picolcd.c | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/drivers/hid/hid-picolcd.c b/drivers/hid/hid-picolcd.c index abd0bdc84624..de9cf21b3494 100644 --- a/drivers/hid/hid-picolcd.c +++ b/drivers/hid/hid-picolcd.c | |||
@@ -253,7 +253,7 @@ static struct hid_report *picolcd_report(int id, struct hid_device *hdev, int di | |||
253 | if (report->id == id) | 253 | if (report->id == id) |
254 | return report; | 254 | return report; |
255 | } | 255 | } |
256 | dev_warn(&hdev->dev, "No report with id 0x%x found\n", id); | 256 | hid_warn(hdev, "No report with id 0x%x found\n", id); |
257 | return NULL; | 257 | return NULL; |
258 | } | 258 | } |
259 | 259 | ||
@@ -1329,7 +1329,7 @@ static int picolcd_check_version(struct hid_device *hdev) | |||
1329 | 1329 | ||
1330 | verinfo = picolcd_send_and_wait(hdev, REPORT_VERSION, NULL, 0); | 1330 | verinfo = picolcd_send_and_wait(hdev, REPORT_VERSION, NULL, 0); |
1331 | if (!verinfo) { | 1331 | if (!verinfo) { |
1332 | dev_err(&hdev->dev, "no version response from PicoLCD"); | 1332 | hid_err(hdev, "no version response from PicoLCD\n"); |
1333 | return -ENODEV; | 1333 | return -ENODEV; |
1334 | } | 1334 | } |
1335 | 1335 | ||
@@ -1337,14 +1337,14 @@ static int picolcd_check_version(struct hid_device *hdev) | |||
1337 | data->version[0] = verinfo->raw_data[1]; | 1337 | data->version[0] = verinfo->raw_data[1]; |
1338 | data->version[1] = verinfo->raw_data[0]; | 1338 | data->version[1] = verinfo->raw_data[0]; |
1339 | if (data->status & PICOLCD_BOOTLOADER) { | 1339 | if (data->status & PICOLCD_BOOTLOADER) { |
1340 | dev_info(&hdev->dev, "PicoLCD, bootloader version %d.%d\n", | 1340 | hid_info(hdev, "PicoLCD, bootloader version %d.%d\n", |
1341 | verinfo->raw_data[1], verinfo->raw_data[0]); | 1341 | verinfo->raw_data[1], verinfo->raw_data[0]); |
1342 | } else { | 1342 | } else { |
1343 | dev_info(&hdev->dev, "PicoLCD, firmware version %d.%d\n", | 1343 | hid_info(hdev, "PicoLCD, firmware version %d.%d\n", |
1344 | verinfo->raw_data[1], verinfo->raw_data[0]); | 1344 | verinfo->raw_data[1], verinfo->raw_data[0]); |
1345 | } | 1345 | } |
1346 | } else { | 1346 | } else { |
1347 | dev_err(&hdev->dev, "confused, got unexpected version response from PicoLCD\n"); | 1347 | hid_err(hdev, "confused, got unexpected version response from PicoLCD\n"); |
1348 | ret = -EINVAL; | 1348 | ret = -EINVAL; |
1349 | } | 1349 | } |
1350 | kfree(verinfo); | 1350 | kfree(verinfo); |
@@ -2329,8 +2329,7 @@ static void picolcd_init_devfs(struct picolcd_data *data, | |||
2329 | (flash_w ? S_IWUSR : 0) | (flash_r ? S_IRUSR : 0), | 2329 | (flash_w ? S_IWUSR : 0) | (flash_r ? S_IRUSR : 0), |
2330 | hdev->debug_dir, data, &picolcd_debug_flash_fops); | 2330 | hdev->debug_dir, data, &picolcd_debug_flash_fops); |
2331 | } else if (flash_r || flash_w) | 2331 | } else if (flash_r || flash_w) |
2332 | dev_warn(&hdev->dev, "Unexpected FLASH access reports, " | 2332 | hid_warn(hdev, "Unexpected FLASH access reports, please submit rdesc for review\n"); |
2333 | "please submit rdesc for review\n"); | ||
2334 | } | 2333 | } |
2335 | 2334 | ||
2336 | static void picolcd_exit_devfs(struct picolcd_data *data) | 2335 | static void picolcd_exit_devfs(struct picolcd_data *data) |
@@ -2458,13 +2457,13 @@ static int picolcd_init_keys(struct picolcd_data *data, | |||
2458 | return -ENODEV; | 2457 | return -ENODEV; |
2459 | if (report->maxfield != 1 || report->field[0]->report_count != 2 || | 2458 | if (report->maxfield != 1 || report->field[0]->report_count != 2 || |
2460 | report->field[0]->report_size != 8) { | 2459 | report->field[0]->report_size != 8) { |
2461 | dev_err(&hdev->dev, "unsupported KEY_STATE report"); | 2460 | hid_err(hdev, "unsupported KEY_STATE report\n"); |
2462 | return -EINVAL; | 2461 | return -EINVAL; |
2463 | } | 2462 | } |
2464 | 2463 | ||
2465 | idev = input_allocate_device(); | 2464 | idev = input_allocate_device(); |
2466 | if (idev == NULL) { | 2465 | if (idev == NULL) { |
2467 | dev_err(&hdev->dev, "failed to allocate input device"); | 2466 | hid_err(hdev, "failed to allocate input device\n"); |
2468 | return -ENOMEM; | 2467 | return -ENOMEM; |
2469 | } | 2468 | } |
2470 | input_set_drvdata(idev, hdev); | 2469 | input_set_drvdata(idev, hdev); |
@@ -2486,7 +2485,7 @@ static int picolcd_init_keys(struct picolcd_data *data, | |||
2486 | input_set_capability(idev, EV_KEY, data->keycode[i]); | 2485 | input_set_capability(idev, EV_KEY, data->keycode[i]); |
2487 | error = input_register_device(idev); | 2486 | error = input_register_device(idev); |
2488 | if (error) { | 2487 | if (error) { |
2489 | dev_err(&hdev->dev, "error registering the input device"); | 2488 | hid_err(hdev, "error registering the input device\n"); |
2490 | input_free_device(idev); | 2489 | input_free_device(idev); |
2491 | return error; | 2490 | return error; |
2492 | } | 2491 | } |
@@ -2523,9 +2522,8 @@ static int picolcd_probe_lcd(struct hid_device *hdev, struct picolcd_data *data) | |||
2523 | return error; | 2522 | return error; |
2524 | 2523 | ||
2525 | if (data->version[0] != 0 && data->version[1] != 3) | 2524 | if (data->version[0] != 0 && data->version[1] != 3) |
2526 | dev_info(&hdev->dev, "Device with untested firmware revision, " | 2525 | hid_info(hdev, "Device with untested firmware revision, please submit /sys/kernel/debug/hid/%s/rdesc for this device.\n", |
2527 | "please submit /sys/kernel/debug/hid/%s/rdesc for this device.\n", | 2526 | dev_name(&hdev->dev)); |
2528 | dev_name(&hdev->dev)); | ||
2529 | 2527 | ||
2530 | /* Setup keypad input device */ | 2528 | /* Setup keypad input device */ |
2531 | error = picolcd_init_keys(data, picolcd_in_report(REPORT_KEY_STATE, hdev)); | 2529 | error = picolcd_init_keys(data, picolcd_in_report(REPORT_KEY_STATE, hdev)); |
@@ -2582,9 +2580,8 @@ static int picolcd_probe_bootloader(struct hid_device *hdev, struct picolcd_data | |||
2582 | return error; | 2580 | return error; |
2583 | 2581 | ||
2584 | if (data->version[0] != 1 && data->version[1] != 0) | 2582 | if (data->version[0] != 1 && data->version[1] != 0) |
2585 | dev_info(&hdev->dev, "Device with untested bootloader revision, " | 2583 | hid_info(hdev, "Device with untested bootloader revision, please submit /sys/kernel/debug/hid/%s/rdesc for this device.\n", |
2586 | "please submit /sys/kernel/debug/hid/%s/rdesc for this device.\n", | 2584 | dev_name(&hdev->dev)); |
2587 | dev_name(&hdev->dev)); | ||
2588 | 2585 | ||
2589 | picolcd_init_devfs(data, NULL, NULL, | 2586 | picolcd_init_devfs(data, NULL, NULL, |
2590 | picolcd_out_report(REPORT_BL_READ_MEMORY, hdev), | 2587 | picolcd_out_report(REPORT_BL_READ_MEMORY, hdev), |
@@ -2606,7 +2603,7 @@ static int picolcd_probe(struct hid_device *hdev, | |||
2606 | */ | 2603 | */ |
2607 | data = kzalloc(sizeof(struct picolcd_data), GFP_KERNEL); | 2604 | data = kzalloc(sizeof(struct picolcd_data), GFP_KERNEL); |
2608 | if (data == NULL) { | 2605 | if (data == NULL) { |
2609 | dev_err(&hdev->dev, "can't allocate space for Minibox PicoLCD device data\n"); | 2606 | hid_err(hdev, "can't allocate space for Minibox PicoLCD device data\n"); |
2610 | error = -ENOMEM; | 2607 | error = -ENOMEM; |
2611 | goto err_no_cleanup; | 2608 | goto err_no_cleanup; |
2612 | } | 2609 | } |
@@ -2622,7 +2619,7 @@ static int picolcd_probe(struct hid_device *hdev, | |||
2622 | /* Parse the device reports and start it up */ | 2619 | /* Parse the device reports and start it up */ |
2623 | error = hid_parse(hdev); | 2620 | error = hid_parse(hdev); |
2624 | if (error) { | 2621 | if (error) { |
2625 | dev_err(&hdev->dev, "device report parse failed\n"); | 2622 | hid_err(hdev, "device report parse failed\n"); |
2626 | goto err_cleanup_data; | 2623 | goto err_cleanup_data; |
2627 | } | 2624 | } |
2628 | 2625 | ||
@@ -2632,25 +2629,25 @@ static int picolcd_probe(struct hid_device *hdev, | |||
2632 | error = hid_hw_start(hdev, 0); | 2629 | error = hid_hw_start(hdev, 0); |
2633 | hdev->claimed = 0; | 2630 | hdev->claimed = 0; |
2634 | if (error) { | 2631 | if (error) { |
2635 | dev_err(&hdev->dev, "hardware start failed\n"); | 2632 | hid_err(hdev, "hardware start failed\n"); |
2636 | goto err_cleanup_data; | 2633 | goto err_cleanup_data; |
2637 | } | 2634 | } |
2638 | 2635 | ||
2639 | error = hdev->ll_driver->open(hdev); | 2636 | error = hid_hw_open(hdev); |
2640 | if (error) { | 2637 | if (error) { |
2641 | dev_err(&hdev->dev, "failed to open input interrupt pipe for key and IR events\n"); | 2638 | hid_err(hdev, "failed to open input interrupt pipe for key and IR events\n"); |
2642 | goto err_cleanup_hid_hw; | 2639 | goto err_cleanup_hid_hw; |
2643 | } | 2640 | } |
2644 | 2641 | ||
2645 | error = device_create_file(&hdev->dev, &dev_attr_operation_mode_delay); | 2642 | error = device_create_file(&hdev->dev, &dev_attr_operation_mode_delay); |
2646 | if (error) { | 2643 | if (error) { |
2647 | dev_err(&hdev->dev, "failed to create sysfs attributes\n"); | 2644 | hid_err(hdev, "failed to create sysfs attributes\n"); |
2648 | goto err_cleanup_hid_ll; | 2645 | goto err_cleanup_hid_ll; |
2649 | } | 2646 | } |
2650 | 2647 | ||
2651 | error = device_create_file(&hdev->dev, &dev_attr_operation_mode); | 2648 | error = device_create_file(&hdev->dev, &dev_attr_operation_mode); |
2652 | if (error) { | 2649 | if (error) { |
2653 | dev_err(&hdev->dev, "failed to create sysfs attributes\n"); | 2650 | hid_err(hdev, "failed to create sysfs attributes\n"); |
2654 | goto err_cleanup_sysfs1; | 2651 | goto err_cleanup_sysfs1; |
2655 | } | 2652 | } |
2656 | 2653 | ||
@@ -2669,7 +2666,7 @@ err_cleanup_sysfs2: | |||
2669 | err_cleanup_sysfs1: | 2666 | err_cleanup_sysfs1: |
2670 | device_remove_file(&hdev->dev, &dev_attr_operation_mode_delay); | 2667 | device_remove_file(&hdev->dev, &dev_attr_operation_mode_delay); |
2671 | err_cleanup_hid_ll: | 2668 | err_cleanup_hid_ll: |
2672 | hdev->ll_driver->close(hdev); | 2669 | hid_hw_close(hdev); |
2673 | err_cleanup_hid_hw: | 2670 | err_cleanup_hid_hw: |
2674 | hid_hw_stop(hdev); | 2671 | hid_hw_stop(hdev); |
2675 | err_cleanup_data: | 2672 | err_cleanup_data: |
@@ -2700,7 +2697,7 @@ static void picolcd_remove(struct hid_device *hdev) | |||
2700 | picolcd_exit_devfs(data); | 2697 | picolcd_exit_devfs(data); |
2701 | device_remove_file(&hdev->dev, &dev_attr_operation_mode); | 2698 | device_remove_file(&hdev->dev, &dev_attr_operation_mode); |
2702 | device_remove_file(&hdev->dev, &dev_attr_operation_mode_delay); | 2699 | device_remove_file(&hdev->dev, &dev_attr_operation_mode_delay); |
2703 | hdev->ll_driver->close(hdev); | 2700 | hid_hw_close(hdev); |
2704 | hid_hw_stop(hdev); | 2701 | hid_hw_stop(hdev); |
2705 | hid_set_drvdata(hdev, NULL); | 2702 | hid_set_drvdata(hdev, NULL); |
2706 | 2703 | ||
@@ -2754,7 +2751,7 @@ static void __exit picolcd_exit(void) | |||
2754 | { | 2751 | { |
2755 | hid_unregister_driver(&picolcd_driver); | 2752 | hid_unregister_driver(&picolcd_driver); |
2756 | #ifdef CONFIG_HID_PICOLCD_FB | 2753 | #ifdef CONFIG_HID_PICOLCD_FB |
2757 | flush_scheduled_work(); | 2754 | flush_work_sync(&picolcd_fb_cleanup); |
2758 | WARN_ON(fb_pending); | 2755 | WARN_ON(fb_pending); |
2759 | #endif | 2756 | #endif |
2760 | } | 2757 | } |