hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/media/rc/ir-sharp-decoder.c
....@@ -1,18 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /* ir-sharp-decoder.c - handle Sharp IR Pulse/Space protocol
23 *
34 * Copyright (C) 2013-2014 Imagination Technologies Ltd.
45 *
56 * Based on NEC decoder:
67 * 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.
168 */
179
1810 #include <linux/bitrev.h>
....@@ -20,7 +12,7 @@
2012 #include "rc-core-priv.h"
2113
2214 #define SHARP_NBITS 15
23
-#define SHARP_UNIT 40000 /* ns */
15
+#define SHARP_UNIT 40 /* us */
2416 #define SHARP_BIT_PULSE (8 * SHARP_UNIT) /* 320us */
2517 #define SHARP_BIT_0_PERIOD (25 * SHARP_UNIT) /* 1ms (680us space) */
2618 #define SHARP_BIT_1_PERIOD (50 * SHARP_UNIT) /* 2ms (1680ms space) */
....@@ -55,7 +47,7 @@
5547 }
5648
5749 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));
5951
6052 switch (data->state) {
6153
....@@ -167,7 +159,7 @@
167159 }
168160
169161 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));
171163 data->state = STATE_INACTIVE;
172164 return -EINVAL;
173165 }