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/ttusbir.c | 33 +++++++++++---------------------- 1 files changed, 11 insertions(+), 22 deletions(-) diff --git a/kernel/drivers/media/rc/ttusbir.c b/kernel/drivers/media/rc/ttusbir.c index aafea3c..629787d 100644 --- a/kernel/drivers/media/rc/ttusbir.c +++ b/kernel/drivers/media/rc/ttusbir.c @@ -1,17 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * TechnoTrend USB IR Receiver * * Copyright (C) 2012 Sean Young <sean@mess.org> - * - * 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/module.h> @@ -29,8 +20,8 @@ * messages per second (!), whether IR is idle or not. */ #define NUM_URBS 4 -#define NS_PER_BYTE 62500 -#define NS_PER_BIT (NS_PER_BYTE/8) +#define US_PER_BYTE 62 +#define US_PER_BIT (US_PER_BYTE / 8) struct ttusbir { struct rc_dev *rc; @@ -117,24 +108,22 @@ */ static void ttusbir_process_ir_data(struct ttusbir *tt, uint8_t *buf) { - struct ir_raw_event rawir; + struct ir_raw_event rawir = {}; unsigned i, v, b; bool event = false; - - init_ir_raw_event(&rawir); for (i = 0; i < 128; i++) { v = buf[i] & 0xfe; switch (v) { case 0xfe: rawir.pulse = false; - rawir.duration = NS_PER_BYTE; + rawir.duration = US_PER_BYTE; if (ir_raw_event_store_with_filter(tt->rc, &rawir)) event = true; break; case 0: rawir.pulse = true; - rawir.duration = NS_PER_BYTE; + rawir.duration = US_PER_BYTE; if (ir_raw_event_store_with_filter(tt->rc, &rawir)) event = true; break; @@ -148,12 +137,12 @@ rawir.pulse = false; } - rawir.duration = NS_PER_BIT * (8 - b); + rawir.duration = US_PER_BIT * (8 - b); if (ir_raw_event_store_with_filter(tt->rc, &rawir)) event = true; rawir.pulse = !rawir.pulse; - rawir.duration = NS_PER_BIT * b; + rawir.duration = US_PER_BIT * b; if (ir_raw_event_store_with_filter(tt->rc, &rawir)) event = true; break; @@ -322,10 +311,10 @@ rc->max_timeout = 10 * IR_DEFAULT_TIMEOUT; /* - * The precision is NS_PER_BIT, but since every 8th bit can be - * overwritten with garbage the accuracy is at best 2 * NS_PER_BIT. + * The precision is US_PER_BIT, but since every 8th bit can be + * overwritten with garbage the accuracy is at best 2 * US_PER_BIT. */ - rc->rx_resolution = NS_PER_BIT; + rc->rx_resolution = 2 * US_PER_BIT; ret = rc_register_device(rc); if (ret) { -- Gitblit v1.6.2