hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/media/rc/fintek-cir.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Driver for Feature Integration Technology Inc. (aka Fintek) LPC CIR
34 *
....@@ -6,16 +7,6 @@
67 * Special thanks to Fintek for providing hardware and spec sheets.
78 * This driver is based upon the nuvoton, ite and ene drivers for
89 * similar hardware.
9
- *
10
- * This program is free software; you can redistribute it and/or
11
- * modify it under the terms of the GNU General Public License as
12
- * published by the Free Software Foundation; either version 2 of the
13
- * License, or (at your option) any later version.
14
- *
15
- * This program is distributed in the hope that it will be useful, but
16
- * WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
- * General Public License for more details.
1910 */
2011
2112 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -57,13 +48,6 @@
5748 static inline void fintek_set_reg_bit(struct fintek_dev *fintek, u8 val, u8 reg)
5849 {
5950 u8 tmp = fintek_cr_read(fintek, reg) | val;
60
- fintek_cr_write(fintek, tmp, reg);
61
-}
62
-
63
-/* clear config register bit without changing other bits */
64
-static inline void fintek_clear_reg_bit(struct fintek_dev *fintek, u8 val, u8 reg)
65
-{
66
- u8 tmp = fintek_cr_read(fintek, reg) & ~val;
6751 fintek_cr_write(fintek, tmp, reg);
6852 }
6953
....@@ -282,7 +266,7 @@
282266 /* process ir data stored in driver buffer */
283267 static void fintek_process_rx_ir_data(struct fintek_dev *fintek)
284268 {
285
- DEFINE_IR_RAW_EVENT(rawir);
269
+ struct ir_raw_event rawir = {};
286270 u8 sample;
287271 bool event = false;
288272 int i;
....@@ -314,10 +298,9 @@
314298 break;
315299 case PARSE_IRDATA:
316300 fintek->rem--;
317
- init_ir_raw_event(&rawir);
318301 rawir.pulse = ((sample & BUF_PULSE_BIT) != 0);
319
- rawir.duration = US_TO_NS((sample & BUF_SAMPLE_MASK)
320
- * CIR_SAMPLE_PERIOD);
302
+ rawir.duration = (sample & BUF_SAMPLE_MASK)
303
+ * CIR_SAMPLE_PERIOD;
321304
322305 fit_dbg("Storing %s with duration %d",
323306 rawir.pulse ? "pulse" : "space",
....@@ -541,9 +524,9 @@
541524 rdev->dev.parent = &pdev->dev;
542525 rdev->driver_name = FINTEK_DRIVER_NAME;
543526 rdev->map_name = RC_MAP_RC6_MCE;
544
- rdev->timeout = US_TO_NS(1000);
527
+ rdev->timeout = 1000;
545528 /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */
546
- rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD);
529
+ rdev->rx_resolution = CIR_SAMPLE_PERIOD;
547530
548531 fintek->rdev = rdev;
549532