rmi_f01.c (5fe9cfbe44b6892e17f803125c4761221b0175c6) | rmi_f01.c (24d28e4f1271cb2f91613dada8f2acccd00eff56) |
---|---|
1/* 2 * Copyright (c) 2011-2016 Synaptics Incorporated 3 * Copyright (c) 2011 Unixphere 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 as published by 7 * the Free Software Foundation. 8 */ --- 667 unchanged lines hidden (view full) --- 676 dev_err(&fn->dev, 677 "Failed to restore normal operation: %d.\n", error); 678 return error; 679 } 680 681 return 0; 682} 683 | 1/* 2 * Copyright (c) 2011-2016 Synaptics Incorporated 3 * Copyright (c) 2011 Unixphere 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 as published by 7 * the Free Software Foundation. 8 */ --- 667 unchanged lines hidden (view full) --- 676 dev_err(&fn->dev, 677 "Failed to restore normal operation: %d.\n", error); 678 return error; 679 } 680 681 return 0; 682} 683 |
684static int rmi_f01_attention(struct rmi_function *fn, 685 unsigned long *irq_bits) | 684static irqreturn_t rmi_f01_attention(int irq, void *ctx) |
686{ | 685{ |
686 struct rmi_function *fn = ctx; |
|
687 struct rmi_device *rmi_dev = fn->rmi_dev; 688 int error; 689 u8 device_status; 690 691 error = rmi_read(rmi_dev, fn->fd.data_base_addr, &device_status); 692 if (error) { 693 dev_err(&fn->dev, 694 "Failed to read device status: %d.\n", error); | 687 struct rmi_device *rmi_dev = fn->rmi_dev; 688 int error; 689 u8 device_status; 690 691 error = rmi_read(rmi_dev, fn->fd.data_base_addr, &device_status); 692 if (error) { 693 dev_err(&fn->dev, 694 "Failed to read device status: %d.\n", error); |
695 return error; | 695 return IRQ_RETVAL(error); |
696 } 697 698 if (RMI_F01_STATUS_BOOTLOADER(device_status)) 699 dev_warn(&fn->dev, 700 "Device in bootloader mode, please update firmware\n"); 701 702 if (RMI_F01_STATUS_UNCONFIGURED(device_status)) { 703 dev_warn(&fn->dev, "Device reset detected.\n"); 704 error = rmi_dev->driver->reset_handler(rmi_dev); 705 if (error) { 706 dev_err(&fn->dev, "Device reset failed: %d\n", error); | 696 } 697 698 if (RMI_F01_STATUS_BOOTLOADER(device_status)) 699 dev_warn(&fn->dev, 700 "Device in bootloader mode, please update firmware\n"); 701 702 if (RMI_F01_STATUS_UNCONFIGURED(device_status)) { 703 dev_warn(&fn->dev, "Device reset detected.\n"); 704 error = rmi_dev->driver->reset_handler(rmi_dev); 705 if (error) { 706 dev_err(&fn->dev, "Device reset failed: %d\n", error); |
707 return error; | 707 return IRQ_RETVAL(error); |
708 } 709 } 710 | 708 } 709 } 710 |
711 return 0; | 711 return IRQ_HANDLED; |
712} 713 714struct rmi_function_handler rmi_f01_handler = { 715 .driver = { 716 .name = "rmi4_f01", 717 /* 718 * Do not allow user unbinding F01 as it is critical 719 * function. 720 */ 721 .suppress_bind_attrs = true, 722 }, 723 .func = 0x01, 724 .probe = rmi_f01_probe, 725 .remove = rmi_f01_remove, 726 .config = rmi_f01_config, 727 .attention = rmi_f01_attention, 728 .suspend = rmi_f01_suspend, 729 .resume = rmi_f01_resume, 730}; | 712} 713 714struct rmi_function_handler rmi_f01_handler = { 715 .driver = { 716 .name = "rmi4_f01", 717 /* 718 * Do not allow user unbinding F01 as it is critical 719 * function. 720 */ 721 .suppress_bind_attrs = true, 722 }, 723 .func = 0x01, 724 .probe = rmi_f01_probe, 725 .remove = rmi_f01_remove, 726 .config = rmi_f01_config, 727 .attention = rmi_f01_attention, 728 .suspend = rmi_f01_suspend, 729 .resume = rmi_f01_resume, 730}; |