| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Loopback driver for rc-core, |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * This driver receives TX data and passes it back as RX data, |
|---|
| 7 | 8 | * which is useful for (scripted) debugging of rc-core without |
|---|
| 8 | 9 | * having to use actual hardware. |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 11 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 12 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 13 | | - * (at your option) any later version. |
|---|
| 14 | | - * |
|---|
| 15 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 16 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 17 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 18 | | - * GNU General Public License for more details. |
|---|
| 19 | | - * |
|---|
| 20 | 10 | */ |
|---|
| 21 | 11 | |
|---|
| 22 | 12 | #include <linux/device.h> |
|---|
| .. | .. |
|---|
| 103 | 93 | struct loopback_dev *lodev = dev->priv; |
|---|
| 104 | 94 | u32 rxmask; |
|---|
| 105 | 95 | unsigned i; |
|---|
| 106 | | - DEFINE_IR_RAW_EVENT(rawir); |
|---|
| 96 | + struct ir_raw_event rawir = {}; |
|---|
| 107 | 97 | |
|---|
| 108 | 98 | if (lodev->txcarrier < lodev->rxcarriermin || |
|---|
| 109 | 99 | lodev->txcarrier > lodev->rxcarriermax) { |
|---|
| .. | .. |
|---|
| 123 | 113 | |
|---|
| 124 | 114 | for (i = 0; i < count; i++) { |
|---|
| 125 | 115 | rawir.pulse = i % 2 ? false : true; |
|---|
| 126 | | - rawir.duration = txbuf[i] * 1000; |
|---|
| 116 | + rawir.duration = txbuf[i]; |
|---|
| 127 | 117 | if (rawir.duration) |
|---|
| 128 | 118 | ir_raw_event_store_with_filter(dev, &rawir); |
|---|
| 129 | 119 | } |
|---|
| .. | .. |
|---|
| 229 | 219 | rc->allowed_protocols = RC_PROTO_BIT_ALL_IR_DECODER; |
|---|
| 230 | 220 | rc->allowed_wakeup_protocols = RC_PROTO_BIT_ALL_IR_ENCODER; |
|---|
| 231 | 221 | rc->encode_wakeup = true; |
|---|
| 232 | | - rc->timeout = 100 * 1000 * 1000; /* 100 ms */ |
|---|
| 222 | + rc->timeout = MS_TO_US(100); /* 100 ms */ |
|---|
| 233 | 223 | rc->min_timeout = 1; |
|---|
| 234 | 224 | rc->max_timeout = UINT_MAX; |
|---|
| 235 | | - rc->rx_resolution = 1000; |
|---|
| 236 | | - rc->tx_resolution = 1000; |
|---|
| 225 | + rc->rx_resolution = 1; |
|---|
| 226 | + rc->tx_resolution = 1; |
|---|
| 237 | 227 | rc->s_tx_mask = loop_set_tx_mask; |
|---|
| 238 | 228 | rc->s_tx_carrier = loop_set_tx_carrier; |
|---|
| 239 | 229 | rc->s_tx_duty_cycle = loop_set_tx_duty_cycle; |
|---|