.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Driver for Feature Integration Technology Inc. (aka Fintek) LPC CIR |
---|
3 | 4 | * |
---|
.. | .. |
---|
6 | 7 | * Special thanks to Fintek for providing hardware and spec sheets. |
---|
7 | 8 | * This driver is based upon the nuvoton, ite and ene drivers for |
---|
8 | 9 | * 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. |
---|
19 | 10 | */ |
---|
20 | 11 | |
---|
21 | 12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
---|
.. | .. |
---|
57 | 48 | static inline void fintek_set_reg_bit(struct fintek_dev *fintek, u8 val, u8 reg) |
---|
58 | 49 | { |
---|
59 | 50 | 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; |
---|
67 | 51 | fintek_cr_write(fintek, tmp, reg); |
---|
68 | 52 | } |
---|
69 | 53 | |
---|
.. | .. |
---|
282 | 266 | /* process ir data stored in driver buffer */ |
---|
283 | 267 | static void fintek_process_rx_ir_data(struct fintek_dev *fintek) |
---|
284 | 268 | { |
---|
285 | | - DEFINE_IR_RAW_EVENT(rawir); |
---|
| 269 | + struct ir_raw_event rawir = {}; |
---|
286 | 270 | u8 sample; |
---|
287 | 271 | bool event = false; |
---|
288 | 272 | int i; |
---|
.. | .. |
---|
314 | 298 | break; |
---|
315 | 299 | case PARSE_IRDATA: |
---|
316 | 300 | fintek->rem--; |
---|
317 | | - init_ir_raw_event(&rawir); |
---|
318 | 301 | 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; |
---|
321 | 304 | |
---|
322 | 305 | fit_dbg("Storing %s with duration %d", |
---|
323 | 306 | rawir.pulse ? "pulse" : "space", |
---|
.. | .. |
---|
541 | 524 | rdev->dev.parent = &pdev->dev; |
---|
542 | 525 | rdev->driver_name = FINTEK_DRIVER_NAME; |
---|
543 | 526 | rdev->map_name = RC_MAP_RC6_MCE; |
---|
544 | | - rdev->timeout = US_TO_NS(1000); |
---|
| 527 | + rdev->timeout = 1000; |
---|
545 | 528 | /* 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; |
---|
547 | 530 | |
---|
548 | 531 | fintek->rdev = rdev; |
---|
549 | 532 | |
---|