.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* ir-sharp-decoder.c - handle Sharp IR Pulse/Space protocol |
---|
2 | 3 | * |
---|
3 | 4 | * Copyright (C) 2013-2014 Imagination Technologies Ltd. |
---|
4 | 5 | * |
---|
5 | 6 | * Based on NEC decoder: |
---|
6 | 7 | * Copyright (C) 2010 by Mauro Carvalho Chehab |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or modify |
---|
9 | | - * it under the terms of the GNU General Public License as published by |
---|
10 | | - * the Free Software Foundation version 2 of the License. |
---|
11 | | - * |
---|
12 | | - * This program is distributed in the hope that it will be useful, |
---|
13 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | | - * GNU General Public License for more details. |
---|
16 | 8 | */ |
---|
17 | 9 | |
---|
18 | 10 | #include <linux/bitrev.h> |
---|
.. | .. |
---|
20 | 12 | #include "rc-core-priv.h" |
---|
21 | 13 | |
---|
22 | 14 | #define SHARP_NBITS 15 |
---|
23 | | -#define SHARP_UNIT 40000 /* ns */ |
---|
| 15 | +#define SHARP_UNIT 40 /* us */ |
---|
24 | 16 | #define SHARP_BIT_PULSE (8 * SHARP_UNIT) /* 320us */ |
---|
25 | 17 | #define SHARP_BIT_0_PERIOD (25 * SHARP_UNIT) /* 1ms (680us space) */ |
---|
26 | 18 | #define SHARP_BIT_1_PERIOD (50 * SHARP_UNIT) /* 2ms (1680ms space) */ |
---|
.. | .. |
---|
55 | 47 | } |
---|
56 | 48 | |
---|
57 | 49 | dev_dbg(&dev->dev, "Sharp decode started at state %d (%uus %s)\n", |
---|
58 | | - data->state, TO_US(ev.duration), TO_STR(ev.pulse)); |
---|
| 50 | + data->state, ev.duration, TO_STR(ev.pulse)); |
---|
59 | 51 | |
---|
60 | 52 | switch (data->state) { |
---|
61 | 53 | |
---|
.. | .. |
---|
167 | 159 | } |
---|
168 | 160 | |
---|
169 | 161 | dev_dbg(&dev->dev, "Sharp decode failed at count %d state %d (%uus %s)\n", |
---|
170 | | - data->count, data->state, TO_US(ev.duration), TO_STR(ev.pulse)); |
---|
| 162 | + data->count, data->state, ev.duration, TO_STR(ev.pulse)); |
---|
171 | 163 | data->state = STATE_INACTIVE; |
---|
172 | 164 | return -EINVAL; |
---|
173 | 165 | } |
---|