.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /*************************************************************************** |
---|
2 | 3 | * Copyright (C) 2010-2012 by Bruno Prémont <bonbons@linux-vserver.org> * |
---|
3 | 4 | * * |
---|
4 | 5 | * Based on Logitech G13 driver (v0.4) * |
---|
5 | 6 | * Copyright (C) 2009 by Rick L. Vinyard, Jr. <rvinyard@cs.nmsu.edu> * |
---|
6 | 7 | * * |
---|
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, version 2 of the License. * |
---|
10 | | - * * |
---|
11 | | - * This driver is distributed in the hope that it will be useful, but * |
---|
12 | | - * WITHOUT ANY WARRANTY; without even the implied warranty of * |
---|
13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * |
---|
14 | | - * General Public License for more details. * |
---|
15 | | - * * |
---|
16 | | - * You should have received a copy of the GNU General Public License * |
---|
17 | | - * along with this software. If not see <http://www.gnu.org/licenses/>. * |
---|
18 | 8 | ***************************************************************************/ |
---|
19 | 9 | |
---|
20 | 10 | #include <linux/hid.h> |
---|
.. | .. |
---|
45 | 35 | { |
---|
46 | 36 | unsigned long flags; |
---|
47 | 37 | int i, w, sz; |
---|
48 | | - DEFINE_IR_RAW_EVENT(rawir); |
---|
| 38 | + struct ir_raw_event rawir = {}; |
---|
49 | 39 | |
---|
50 | 40 | /* ignore if rc_dev is NULL or status is shunned */ |
---|
51 | 41 | spin_lock_irqsave(&data->lock, flags); |
---|
.. | .. |
---|
67 | 57 | */ |
---|
68 | 58 | sz = size > 0 ? min((int)raw_data[0], size-1) : 0; |
---|
69 | 59 | for (i = 0; i+1 < sz; i += 2) { |
---|
70 | | - init_ir_raw_event(&rawir); |
---|
71 | 60 | w = (raw_data[i] << 8) | (raw_data[i+1]); |
---|
72 | 61 | rawir.pulse = !!(w & 0x8000); |
---|
73 | | - rawir.duration = US_TO_NS(rawir.pulse ? (65536 - w) : w); |
---|
| 62 | + rawir.duration = rawir.pulse ? (65536 - w) : w; |
---|
74 | 63 | /* Quirk!! - see above */ |
---|
75 | | - if (i == 0 && rawir.duration > 15000000) |
---|
76 | | - rawir.duration -= 15000000; |
---|
| 64 | + if (i == 0 && rawir.duration > 15000) |
---|
| 65 | + rawir.duration -= 15000; |
---|
77 | 66 | ir_raw_event_store(data->rc_dev, &rawir); |
---|
78 | 67 | } |
---|
79 | 68 | ir_raw_event_handle(data->rc_dev); |
---|
.. | .. |
---|
125 | 114 | rdev->dev.parent = &data->hdev->dev; |
---|
126 | 115 | rdev->driver_name = PICOLCD_NAME; |
---|
127 | 116 | rdev->map_name = RC_MAP_RC6_MCE; |
---|
128 | | - rdev->timeout = MS_TO_NS(100); |
---|
129 | | - rdev->rx_resolution = US_TO_NS(1); |
---|
| 117 | + rdev->timeout = MS_TO_US(100); |
---|
| 118 | + rdev->rx_resolution = 1; |
---|
130 | 119 | |
---|
131 | 120 | ret = rc_register_device(rdev); |
---|
132 | 121 | if (ret) |
---|