From d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Mon, 11 Dec 2023 02:45:28 +0000 Subject: [PATCH] add boot partition size --- kernel/drivers/media/rc/redrat3.c | 41 +++++++++++++++-------------------------- 1 files changed, 15 insertions(+), 26 deletions(-) diff --git a/kernel/drivers/media/rc/redrat3.c b/kernel/drivers/media/rc/redrat3.c index 14be14b..a61f982 100644 --- a/kernel/drivers/media/rc/redrat3.c +++ b/kernel/drivers/media/rc/redrat3.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * USB RedRat3 IR Transceiver rc-core driver * @@ -28,17 +29,6 @@ * It uses its own little protocol to communicate, the required * parts of which are embedded within this driver. * -- - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * */ #include <asm/unaligned.h> @@ -140,7 +130,7 @@ * When receiving a continuous ir stream (for example when a user is * holding a button down on a remote), this specifies the minimum size * of a space when the redrat3 sends a irdata packet to the host. Specified - * in miliseconds. Default value 18ms. + * in milliseconds. Default value 18ms. * The value can be between 2 and 30 inclusive. */ static int minimum_pause = 18; @@ -348,9 +338,9 @@ static void redrat3_process_ir_data(struct redrat3_dev *rr3) { - DEFINE_IR_RAW_EVENT(rawir); + struct ir_raw_event rawir = {}; struct device *dev; - unsigned int i, sig_size, single_len, offset, val; + unsigned int i, sig_size, offset, val; u32 mod_freq; dev = rr3->dev; @@ -358,10 +348,10 @@ mod_freq = redrat3_val_to_mod_freq(&rr3->irdata); dev_dbg(dev, "Got mod_freq of %u\n", mod_freq); if (mod_freq && rr3->wideband) { - DEFINE_IR_RAW_EVENT(ev); - - ev.carrier_report = 1; - ev.carrier = mod_freq; + struct ir_raw_event ev = { + .carrier_report = 1, + .carrier = mod_freq + }; ir_raw_event_store(rr3->rc, &ev); } @@ -371,7 +361,6 @@ for (i = 0; i < sig_size; i++) { offset = rr3->irdata.sigdata[i]; val = get_unaligned_be16(&rr3->irdata.lens[offset]); - single_len = redrat3_len_to_us(val); /* we should always get pulse/space/pulse/space samples */ if (i % 2) @@ -379,7 +368,7 @@ else rawir.pulse = true; - rawir.duration = US_TO_NS(single_len); + rawir.duration = redrat3_len_to_us(val); /* cap the value to IR_MAX_DURATION */ rawir.duration = (rawir.duration > IR_MAX_DURATION) ? IR_MAX_DURATION : rawir.duration; @@ -505,7 +494,7 @@ return timeout; } -static int redrat3_set_timeout(struct rc_dev *rc_dev, unsigned int timeoutns) +static int redrat3_set_timeout(struct rc_dev *rc_dev, unsigned int timeoutus) { struct redrat3_dev *rr3 = rc_dev->priv; struct usb_device *udev = rr3->udev; @@ -517,7 +506,7 @@ if (!timeout) return -ENOMEM; - *timeout = cpu_to_be32(redrat3_us_to_len(timeoutns / 1000)); + *timeout = cpu_to_be32(redrat3_us_to_len(timeoutus)); ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), RR3_SET_IR_PARAM, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, RR3_IR_IO_SIG_TIMEOUT, 0, timeout, sizeof(*timeout), @@ -957,15 +946,15 @@ rc->dev.parent = dev; rc->priv = rr3; rc->allowed_protocols = RC_PROTO_BIT_ALL_IR_DECODER; - rc->min_timeout = MS_TO_NS(RR3_RX_MIN_TIMEOUT); - rc->max_timeout = MS_TO_NS(RR3_RX_MAX_TIMEOUT); - rc->timeout = US_TO_NS(redrat3_get_timeout(rr3)); + rc->min_timeout = MS_TO_US(RR3_RX_MIN_TIMEOUT); + rc->max_timeout = MS_TO_US(RR3_RX_MAX_TIMEOUT); + rc->timeout = redrat3_get_timeout(rr3); rc->s_timeout = redrat3_set_timeout; rc->tx_ir = redrat3_transmit_ir; rc->s_tx_carrier = redrat3_set_tx_carrier; rc->s_carrier_report = redrat3_wideband_receiver; rc->driver_name = DRIVER_NAME; - rc->rx_resolution = US_TO_NS(2); + rc->rx_resolution = 2; rc->map_name = RC_MAP_HAUPPAUGE; ret = rc_register_device(rc); -- Gitblit v1.6.2