hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/media/i2c/cx25840/cx25840-ir.c
....@@ -1,19 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Driver for the Conexant CX2584x Audio/Video decoder chip and related cores
34 *
45 * Integrated Consumer Infrared Controller
56 *
67 * Copyright (C) 2010 Andy Walls <awalls@md.metrocast.net>
7
- *
8
- * This program is free software; you can redistribute it and/or
9
- * modify it under the terms of the GNU General Public License
10
- * as published by the Free Software Foundation; either version 2
11
- * of the License, or (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
178 */
189
1910 #include <linux/slab.h>
....@@ -549,7 +540,7 @@
549540 ror = stats & STATS_ROR; /* Rx FIFO Over Run */
550541
551542 tse = irqen & IRQEN_TSE; /* Tx FIFO Service Request IRQ Enable */
552
- rse = irqen & IRQEN_RSE; /* Rx FIFO Service Reuqest IRQ Enable */
543
+ rse = irqen & IRQEN_RSE; /* Rx FIFO Service Request IRQ Enable */
553544 rte = irqen & IRQEN_RTE; /* Rx Pulse Width Timer Time Out IRQ Enable */
554545 roe = irqen & IRQEN_ROE; /* Rx FIFO Over Run IRQ Enable */
555546
....@@ -638,7 +629,7 @@
638629 events |= V4L2_SUBDEV_IR_RX_END_OF_RX_DETECTED;
639630 }
640631 if (v) {
641
- /* Clear STATS_ROR & STATS_RTO as needed by reseting hardware */
632
+ /* Clear STATS_ROR & STATS_RTO as needed by resetting hardware */
642633 cx25840_write4(c, CX25840_IR_CNTRL_REG, cntrl & ~v);
643634 cx25840_write4(c, CX25840_IR_CNTRL_REG, cntrl);
644635 *handled = true;
....@@ -697,14 +688,12 @@
697688 }
698689
699690 v = (unsigned) pulse_width_count_to_ns(
700
- (u16) (p->hw_fifo_data & FIFO_RXTX), divider);
691
+ (u16)(p->hw_fifo_data & FIFO_RXTX), divider) / 1000;
701692 if (v > IR_MAX_DURATION)
702693 v = IR_MAX_DURATION;
703694
704
- init_ir_raw_event(&p->ir_core_data);
705
- p->ir_core_data.pulse = u;
706
- p->ir_core_data.duration = v;
707
- p->ir_core_data.timeout = w;
695
+ p->ir_core_data = (struct ir_raw_event)
696
+ { .pulse = u, .duration = v, .timeout = w };
708697
709698 v4l2_dbg(2, ir_debug, sd, "rx read: %10u ns %s %s\n",
710699 v, u ? "mark" : "space", w ? "(timed out)" : "");