hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/hid/hid-picolcd_cir.c
....@@ -1,20 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /***************************************************************************
23 * Copyright (C) 2010-2012 by Bruno Prémont <bonbons@linux-vserver.org> *
34 * *
45 * Based on Logitech G13 driver (v0.4) *
56 * Copyright (C) 2009 by Rick L. Vinyard, Jr. <rvinyard@cs.nmsu.edu> *
67 * *
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/>. *
188 ***************************************************************************/
199
2010 #include <linux/hid.h>
....@@ -45,7 +35,7 @@
4535 {
4636 unsigned long flags;
4737 int i, w, sz;
48
- DEFINE_IR_RAW_EVENT(rawir);
38
+ struct ir_raw_event rawir = {};
4939
5040 /* ignore if rc_dev is NULL or status is shunned */
5141 spin_lock_irqsave(&data->lock, flags);
....@@ -67,13 +57,12 @@
6757 */
6858 sz = size > 0 ? min((int)raw_data[0], size-1) : 0;
6959 for (i = 0; i+1 < sz; i += 2) {
70
- init_ir_raw_event(&rawir);
7160 w = (raw_data[i] << 8) | (raw_data[i+1]);
7261 rawir.pulse = !!(w & 0x8000);
73
- rawir.duration = US_TO_NS(rawir.pulse ? (65536 - w) : w);
62
+ rawir.duration = rawir.pulse ? (65536 - w) : w;
7463 /* 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;
7766 ir_raw_event_store(data->rc_dev, &rawir);
7867 }
7968 ir_raw_event_handle(data->rc_dev);
....@@ -125,8 +114,8 @@
125114 rdev->dev.parent = &data->hdev->dev;
126115 rdev->driver_name = PICOLCD_NAME;
127116 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;
130119
131120 ret = rc_register_device(rdev);
132121 if (ret)