hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/media/rc/ir-sony-decoder.c
....@@ -1,22 +1,14 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /* ir-sony-decoder.c - handle Sony IR Pulse/Space protocol
23 *
34 * 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.
135 */
146
157 #include <linux/bitrev.h>
168 #include <linux/module.h>
179 #include "rc-core-priv.h"
1810
19
-#define SONY_UNIT 600000 /* ns */
11
+#define SONY_UNIT 600 /* us */
2012 #define SONY_HEADER_PULSE (4 * SONY_UNIT)
2113 #define SONY_HEADER_SPACE (1 * SONY_UNIT)
2214 #define SONY_BIT_0_PULSE (1 * SONY_UNIT)
....@@ -56,7 +48,7 @@
5648 goto out;
5749
5850 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));
6052
6153 switch (data->state) {
6254
....@@ -110,7 +102,7 @@
110102 }
111103
112104 data->state = STATE_FINISHED;
113
- /* Fall through */
105
+ fallthrough;
114106
115107 case STATE_FINISHED:
116108 if (ev.pulse)
....@@ -162,7 +154,7 @@
162154
163155 out:
164156 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));
166158 data->state = STATE_INACTIVE;
167159 return -EINVAL;
168160