From 23fa18eaa71266feff7ba8d83022d9e1cc83c65a Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Fri, 10 May 2024 07:42:03 +0000 Subject: [PATCH] disable pwm7 --- kernel/drivers/media/rc/streamzap.c | 35 +++++++++++------------------------ 1 files changed, 11 insertions(+), 24 deletions(-) diff --git a/kernel/drivers/media/rc/streamzap.c b/kernel/drivers/media/rc/streamzap.c index c9a70fd..9f3cd9f 100644 --- a/kernel/drivers/media/rc/streamzap.c +++ b/kernel/drivers/media/rc/streamzap.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Streamzap Remote Control driver * @@ -15,16 +16,6 @@ * * This driver is based on the USB skeleton driver packaged with the * kernel; copyright (C) 2001-2003 Greg Kroah-Hartman (greg@kroah.com) - * - * 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 <linux/device.h> @@ -130,7 +121,7 @@ static void sz_push_full_pulse(struct streamzap_ir *sz, unsigned char value) { - DEFINE_IR_RAW_EVENT(rawir); + struct ir_raw_event rawir = {}; if (sz->idle) { int delta; @@ -146,7 +137,6 @@ } else { rawir.duration = delta; rawir.duration -= sz->sum; - rawir.duration = US_TO_NS(rawir.duration); rawir.duration = (rawir.duration > IR_MAX_DURATION) ? IR_MAX_DURATION : rawir.duration; } @@ -160,7 +150,6 @@ rawir.duration = ((int) value) * SZ_RESOLUTION; rawir.duration += SZ_RESOLUTION / 2; sz->sum += rawir.duration; - rawir.duration = US_TO_NS(rawir.duration); rawir.duration = (rawir.duration > IR_MAX_DURATION) ? IR_MAX_DURATION : rawir.duration; sz_push(sz, rawir); @@ -175,13 +164,12 @@ static void sz_push_full_space(struct streamzap_ir *sz, unsigned char value) { - DEFINE_IR_RAW_EVENT(rawir); + struct ir_raw_event rawir = {}; rawir.pulse = false; rawir.duration = ((int) value) * SZ_RESOLUTION; rawir.duration += SZ_RESOLUTION / 2; sz->sum += rawir.duration; - rawir.duration = US_TO_NS(rawir.duration); sz_push(sz, rawir); } @@ -249,10 +237,10 @@ break; case FullSpace: if (sz->buf_in[i] == SZ_TIMEOUT) { - DEFINE_IR_RAW_EVENT(rawir); - - rawir.pulse = false; - rawir.duration = sz->rdev->timeout; + struct ir_raw_event rawir = { + .pulse = false, + .duration = sz->rdev->timeout + }; sz->idle = true; if (sz->timeout_enabled) sz_push(sz, rawir); @@ -396,7 +384,7 @@ if (usbdev->descriptor.iManufacturer && usb_string(usbdev, usbdev->descriptor.iManufacturer, buf, sizeof(buf)) > 0) - strlcpy(name, buf, sizeof(name)); + strscpy(name, buf, sizeof(name)); if (usbdev->descriptor.iProduct && usb_string(usbdev, usbdev->descriptor.iProduct, @@ -412,13 +400,12 @@ sz->decoder_state = PulseSpace; /* FIXME: don't yet have a way to set this */ sz->timeout_enabled = true; - sz->rdev->timeout = ((US_TO_NS(SZ_TIMEOUT * SZ_RESOLUTION) & - IR_MAX_DURATION) | 0x03000000); + sz->rdev->timeout = SZ_TIMEOUT * SZ_RESOLUTION; #if 0 /* not yet supported, depends on patches from maxim */ /* see also: LIRC_GET_REC_RESOLUTION and LIRC_SET_REC_TIMEOUT */ - sz->min_timeout = US_TO_NS(SZ_TIMEOUT * SZ_RESOLUTION); - sz->max_timeout = US_TO_NS(SZ_TIMEOUT * SZ_RESOLUTION); + sz->min_timeout = SZ_TIMEOUT * SZ_RESOLUTION; + sz->max_timeout = SZ_TIMEOUT * SZ_RESOLUTION; #endif sz->signal_start = ktime_get_real(); -- Gitblit v1.6.2