| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * TTUSB DEC Driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2003-2004 Alex Woods <linux-dvb@giblets.org> |
|---|
| 5 | 6 | * IR support by Peter Beutner <p.beutner@gmx.net> |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 9 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 10 | | - * (at your option) any later version. |
|---|
| 11 | | - * |
|---|
| 12 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 13 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 15 | | - * GNU General Public License for more details. |
|---|
| 16 | | - * |
|---|
| 17 | 7 | */ |
|---|
| 18 | 8 | |
|---|
| 19 | 9 | #include <linux/list.h> |
|---|
| .. | .. |
|---|
| 260 | 250 | struct ttusb_dec *dec = urb->context; |
|---|
| 261 | 251 | char *buffer = dec->irq_buffer; |
|---|
| 262 | 252 | int retval; |
|---|
| 253 | + int index = buffer[4]; |
|---|
| 263 | 254 | |
|---|
| 264 | 255 | switch(urb->status) { |
|---|
| 265 | 256 | case 0: /*success*/ |
|---|
| .. | .. |
|---|
| 284 | 275 | * |
|---|
| 285 | 276 | * this is an fact a bit too simple implementation; |
|---|
| 286 | 277 | * the box also reports a keyrepeat signal |
|---|
| 287 | | - * (with buffer[3] == 0x40) in an intervall of ~100ms. |
|---|
| 278 | + * (with buffer[3] == 0x40) in an interval of ~100ms. |
|---|
| 288 | 279 | * But to handle this correctly we had to imlemenent some |
|---|
| 289 | 280 | * kind of timer which signals a 'key up' event if no |
|---|
| 290 | 281 | * keyrepeat signal is received for lets say 200ms. |
|---|
| 291 | 282 | * this should/could be added later ... |
|---|
| 292 | 283 | * for now lets report each signal as a key down and up |
|---|
| 293 | 284 | */ |
|---|
| 294 | | - if (buffer[4] - 1 < ARRAY_SIZE(rc_keys)) { |
|---|
| 295 | | - dprintk("%s:rc signal:%d\n", __func__, buffer[4]); |
|---|
| 296 | | - input_report_key(dec->rc_input_dev, rc_keys[buffer[4] - 1], 1); |
|---|
| 285 | + if (index - 1 < ARRAY_SIZE(rc_keys)) { |
|---|
| 286 | + dprintk("%s:rc signal:%d\n", __func__, index); |
|---|
| 287 | + input_report_key(dec->rc_input_dev, rc_keys[index - 1], 1); |
|---|
| 297 | 288 | input_sync(dec->rc_input_dev); |
|---|
| 298 | | - input_report_key(dec->rc_input_dev, rc_keys[buffer[4] - 1], 0); |
|---|
| 289 | + input_report_key(dec->rc_input_dev, rc_keys[index - 1], 0); |
|---|
| 299 | 290 | input_sync(dec->rc_input_dev); |
|---|
| 300 | 291 | } |
|---|
| 301 | 292 | } |
|---|
| .. | .. |
|---|
| 778 | 769 | } |
|---|
| 779 | 770 | } |
|---|
| 780 | 771 | |
|---|
| 781 | | -static void ttusb_dec_process_urb_frame_list(unsigned long data) |
|---|
| 772 | +static void ttusb_dec_process_urb_frame_list(struct tasklet_struct *t) |
|---|
| 782 | 773 | { |
|---|
| 783 | | - struct ttusb_dec *dec = (struct ttusb_dec *)data; |
|---|
| 774 | + struct ttusb_dec *dec = from_tasklet(dec, t, urb_tasklet); |
|---|
| 784 | 775 | struct list_head *item; |
|---|
| 785 | 776 | struct urb_frame *frame; |
|---|
| 786 | 777 | unsigned long flags; |
|---|
| .. | .. |
|---|
| 1218 | 1209 | { |
|---|
| 1219 | 1210 | spin_lock_init(&dec->urb_frame_list_lock); |
|---|
| 1220 | 1211 | INIT_LIST_HEAD(&dec->urb_frame_list); |
|---|
| 1221 | | - tasklet_init(&dec->urb_tasklet, ttusb_dec_process_urb_frame_list, |
|---|
| 1222 | | - (unsigned long)dec); |
|---|
| 1212 | + tasklet_setup(&dec->urb_tasklet, ttusb_dec_process_urb_frame_list); |
|---|
| 1223 | 1213 | } |
|---|
| 1224 | 1214 | |
|---|
| 1225 | 1215 | static int ttusb_init_rc( struct ttusb_dec *dec) |
|---|
| .. | .. |
|---|
| 1561 | 1551 | dvb_dmx_release(&dec->demux); |
|---|
| 1562 | 1552 | if (dec->fe) { |
|---|
| 1563 | 1553 | dvb_unregister_frontend(dec->fe); |
|---|
| 1564 | | - if (dec->fe->ops.release) |
|---|
| 1565 | | - dec->fe->ops.release(dec->fe); |
|---|
| 1554 | + dvb_frontend_detach(dec->fe); |
|---|
| 1566 | 1555 | } |
|---|
| 1567 | 1556 | dvb_unregister_adapter(&dec->adapter); |
|---|
| 1568 | 1557 | } |
|---|