forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/drivers/media/rc/igorplugusb.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * IgorPlug-USB IR Receiver
34 *
....@@ -9,16 +10,6 @@
910 * Based on the lirc_igorplugusb.c driver:
1011 * Copyright (C) 2004 Jan M. Hochstein
1112 * <hochstein@algo.informatik.tu-darmstadt.de>
12
- *
13
- * This program is free software; you can redistribute it and/or modify
14
- * it under the terms of the GNU General Public License as published by
15
- * the Free Software Foundation; either version 2 of the License, or
16
- * (at your option) any later version.
17
- *
18
- * This program is distributed in the hope that it will be useful,
19
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- * GNU General Public License for more details.
2213 */
2314 #include <linux/device.h>
2415 #include <linux/kernel.h>
....@@ -56,7 +47,7 @@
5647
5748 static void igorplugusb_irdata(struct igorplugusb *ir, unsigned len)
5849 {
59
- DEFINE_IR_RAW_EVENT(rawir);
50
+ struct ir_raw_event rawir = {};
6051 unsigned i, start, overflow;
6152
6253 dev_dbg(ir->dev, "irdata: %*ph (len=%u)", len, ir->buf_in, len);
....@@ -80,7 +71,7 @@
8071 }
8172
8273 do {
83
- rawir.duration = ir->buf_in[i] * 85333;
74
+ rawir.duration = ir->buf_in[i] * 85;
8475 rawir.pulse = i & 1;
8576
8677 ir_raw_event_store_with_filter(ir->rc, &rawir);
....@@ -213,8 +204,8 @@
213204 rc->priv = ir;
214205 rc->driver_name = DRIVER_NAME;
215206 rc->map_name = RC_MAP_HAUPPAUGE;
216
- rc->timeout = MS_TO_NS(100);
217
- rc->rx_resolution = 85333;
207
+ rc->timeout = MS_TO_US(100);
208
+ rc->rx_resolution = 85;
218209
219210 ir->rc = rc;
220211 ret = rc_register_device(rc);