hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/media/rc/st_rc.c
....@@ -1,11 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 2013 STMicroelectronics Limited
34 * Author: Srinivas Kandagatla <srinivas.kandagatla@st.com>
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; either version 2 of the License, or
8
- * (at your option) any later version.
95 */
106 #include <linux/kernel.h>
117 #include <linux/clk.h>
....@@ -67,8 +63,7 @@
6763
6864 static void st_rc_send_lirc_timeout(struct rc_dev *rdev)
6965 {
70
- DEFINE_IR_RAW_EVENT(ev);
71
- ev.timeout = true;
66
+ struct ir_raw_event ev = { .timeout = true, .duration = rdev->timeout };
7267 ir_raw_event_store(rdev, &ev);
7368 }
7469
....@@ -101,7 +96,7 @@
10196 struct st_rc_device *dev = data;
10297 int last_symbol = 0;
10398 u32 status, int_status;
104
- DEFINE_IR_RAW_EVENT(ev);
99
+ struct ir_raw_event ev = {};
105100
106101 if (dev->irq_wake)
107102 pm_wakeup_event(dev->dev, 0);
....@@ -139,12 +134,12 @@
139134 mark /= dev->sample_div;
140135 }
141136
142
- ev.duration = US_TO_NS(mark);
137
+ ev.duration = mark;
143138 ev.pulse = true;
144139 ir_raw_event_store(dev->rdev, &ev);
145140
146141 if (!last_symbol) {
147
- ev.duration = US_TO_NS(symbol);
142
+ ev.duration = symbol;
148143 ev.pulse = false;
149144 ir_raw_event_store(dev->rdev, &ev);
150145 } else {
....@@ -297,7 +292,7 @@
297292 rdev->allowed_protocols = RC_PROTO_BIT_ALL_IR_DECODER;
298293 /* rx sampling rate is 10Mhz */
299294 rdev->rx_resolution = 100;
300
- rdev->timeout = US_TO_NS(MAX_SYMB_TIME);
295
+ rdev->timeout = MAX_SYMB_TIME;
301296 rdev->priv = rc_dev;
302297 rdev->open = st_rc_open;
303298 rdev->close = st_rc_close;