.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* ir-sony-decoder.c - handle Sony IR Pulse/Space protocol |
---|
2 | 3 | * |
---|
3 | 4 | * Copyright (C) 2010 by David Härdeman <david@hardeman.nu> |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify |
---|
6 | | - * it under the terms of the GNU General Public License as published by |
---|
7 | | - * the Free Software Foundation version 2 of the License. |
---|
8 | | - * |
---|
9 | | - * This program is distributed in the hope that it will be useful, |
---|
10 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
12 | | - * GNU General Public License for more details. |
---|
13 | 5 | */ |
---|
14 | 6 | |
---|
15 | 7 | #include <linux/bitrev.h> |
---|
16 | 8 | #include <linux/module.h> |
---|
17 | 9 | #include "rc-core-priv.h" |
---|
18 | 10 | |
---|
19 | | -#define SONY_UNIT 600000 /* ns */ |
---|
| 11 | +#define SONY_UNIT 600 /* us */ |
---|
20 | 12 | #define SONY_HEADER_PULSE (4 * SONY_UNIT) |
---|
21 | 13 | #define SONY_HEADER_SPACE (1 * SONY_UNIT) |
---|
22 | 14 | #define SONY_BIT_0_PULSE (1 * SONY_UNIT) |
---|
.. | .. |
---|
56 | 48 | goto out; |
---|
57 | 49 | |
---|
58 | 50 | dev_dbg(&dev->dev, "Sony decode started at state %d (%uus %s)\n", |
---|
59 | | - data->state, TO_US(ev.duration), TO_STR(ev.pulse)); |
---|
| 51 | + data->state, ev.duration, TO_STR(ev.pulse)); |
---|
60 | 52 | |
---|
61 | 53 | switch (data->state) { |
---|
62 | 54 | |
---|
.. | .. |
---|
110 | 102 | } |
---|
111 | 103 | |
---|
112 | 104 | data->state = STATE_FINISHED; |
---|
113 | | - /* Fall through */ |
---|
| 105 | + fallthrough; |
---|
114 | 106 | |
---|
115 | 107 | case STATE_FINISHED: |
---|
116 | 108 | if (ev.pulse) |
---|
.. | .. |
---|
162 | 154 | |
---|
163 | 155 | out: |
---|
164 | 156 | dev_dbg(&dev->dev, "Sony decode failed at state %d (%uus %s)\n", |
---|
165 | | - data->state, TO_US(ev.duration), TO_STR(ev.pulse)); |
---|
| 157 | + data->state, ev.duration, TO_STR(ev.pulse)); |
---|
166 | 158 | data->state = STATE_INACTIVE; |
---|
167 | 159 | return -EINVAL; |
---|
168 | 160 | |
---|