media: rc-core: rename ir_raw_event_reset to ir_raw_event_overflow
Subsystems (8)
Sean Young
maintainerPATCH 1/2 media: rc-core: rename ir_raw_event_reset to ir_raw_event_overflow
The driver report a reset event when the hardware reports and overflow. There is no reason to have a generic "reset" event.
--- drivers/media/pci/cx23885/cx23885-input.c | 2 +- drivers/media/rc/fintek-cir.c | 2 +- drivers/media/rc/igorplugusb.c | 2 +- drivers/media/rc/iguanair.c | 2 +- drivers/media/rc/ir-hix5hd2.c | 2 +- drivers/media/rc/ir-imon-decoder.c | 2 +- drivers/media/rc/ir-jvc-decoder.c | 2 +- drivers/media/rc/ir-mce_kbd-decoder.c | 2 +- drivers/media/rc/ir-nec-decoder.c | 2 +- drivers/media/rc/ir-rc5-decoder.c | 2 +- drivers/media/rc/ir-rc6-decoder.c | 2 +- drivers/media/rc/ir-rcmm-decoder.c | 2 +- drivers/media/rc/ir-sanyo-decoder.c | 4 ++-- drivers/media/rc/ir-sharp-decoder.c | 2 +- drivers/media/rc/ir-sony-decoder.c | 2 +- drivers/media/rc/ir-xmp-decoder.c | 2 +- drivers/media/rc/ite-cir.c | 2 +- drivers/media/rc/lirc_dev.c | 8 ++++---- drivers/media/rc/nuvoton-cir.c | 2 +- drivers/media/rc/rc-core-priv.h | 2 +- drivers/media/rc/rc-ir-raw.c | 2 -- drivers/media/rc/st_rc.c | 2 +- drivers/media/rc/sunxi-cir.c | 2 +- drivers/media/rc/winbond-cir.c | 2 +- include/media/rc-core.h | 6 +++--- 25 files changed, 30 insertions(+), 32 deletions(-)
drivers/media/pci/cx23885/cx23885-input.c +1 -1
@@ -55,7 +55,7 @@ static void cx23885_input_process_measurements(struct cx23885_dev *dev, }while (num !=0 );if (overrun) -ir_raw_event_reset (kernel_ir->rc); +ir_raw_event_overflow (kernel_ir->rc);else if (handle)ir_raw_event_handle (kernel_ir->rc); }
drivers/media/rc/fintek-cir.c +1 -1
@@ -287,7 +287,7 @@ static void fintek_process_rx_ir_data(struct fintek_dev *fintek)if (fintek->rem) fintek->parser_state =PARSE_IRDATA ;else -ir_raw_event_reset (fintek->rdev); +ir_raw_event_overflow (fintek->rdev);break ;case SUBCMD : fintek->rem =fintek_cmdsize (fintek->cmd, sample);
drivers/media/rc/igorplugusb.c +1 -1
@@ -67,7 +67,7 @@ static void igorplugusb_irdata(struct igorplugusb *ir, unsigned len)if (overflow >0 ) {dev_warn (ir->dev,"receive overflow, at least %u lost" , overflow); -ir_raw_event_reset (ir->rc); +ir_raw_event_overflow (ir->rc); } do {
drivers/media/rc/iguanair.c +1 -1
@@ -109,7 +109,7 @@ static void process_ir_data(struct iguanair *ir, unsigned len)break ;case CMD_RX_OVERFLOW :dev_warn (ir->dev,"receive overflow\n" ); -ir_raw_event_reset (ir->rc); +ir_raw_event_overflow (ir->rc);break ;default : dev_warn(ir->dev, "control code %02x received\n",
drivers/media/rc/ir-hix5hd2.c +1 -1
@@ -194,7 +194,7 @@ static irqreturn_t hix5hd2_ir_rx_interrupt(int irq, void *data)* IR_INTS availably since logic would not clear * fifo when overflow, drv do the job */ -ir_raw_event_reset (priv->rdev); +ir_raw_event_overflow (priv->rdev); symb_num =readl_relaxed (priv->base +IR_DATAH );for (i =0 ; i < symb_num; i++)readl_relaxed (priv->base +IR_DATAL );
drivers/media/rc/ir-imon-decoder.c +1 -1
@@ -95,7 +95,7 @@ static int ir_imon_decode(struct rc_dev *dev, struct ir_raw_event ev)struct imon_dec *data = &dev->raw->imon;if (!is_timing_event (ev)) { -if (ev.reset) +if (ev.overflow) data->state =STATE_INACTIVE ;return 0 ; }
drivers/media/rc/ir-jvc-decoder.c +1 -1
@@ -40,7 +40,7 @@ static int ir_jvc_decode(struct rc_dev *dev, struct ir_raw_event ev)struct jvc_dec *data = &dev->raw->jvc;if (!is_timing_event (ev)) { -if (ev.reset) +if (ev.overflow) data->state =STATE_INACTIVE ;return 0 ; }
drivers/media/rc/ir-mce_kbd-decoder.c +1 -1
@@ -221,7 +221,7 @@ static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev)struct lirc_scancode lsc = {};if (!is_timing_event (ev)) { -if (ev.reset) +if (ev.overflow) data->state =STATE_INACTIVE ;return 0 ; }
drivers/media/rc/ir-nec-decoder.c +1 -1
@@ -44,7 +44,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)u8 address, not_address, command, not_command;if (!is_timing_event (ev)) { -if (ev.reset) +if (ev.overflow) data->state =STATE_INACTIVE ;return 0 ; }
drivers/media/rc/ir-rc5-decoder.c +1 -1
@@ -45,7 +45,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev)enum rc_proto protocol;if (!is_timing_event (ev)) { -if (ev.reset) +if (ev.overflow) data->state =STATE_INACTIVE ;return 0 ; }
drivers/media/rc/ir-rc6-decoder.c +1 -1
@@ -85,7 +85,7 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev)enum rc_proto protocol;if (!is_timing_event (ev)) { -if (ev.reset) +if (ev.overflow) data->state =STATE_INACTIVE ;return 0 ; }
drivers/media/rc/ir-rcmm-decoder.c +1 -1
@@ -69,7 +69,7 @@ static int ir_rcmm_decode(struct rc_dev *dev, struct ir_raw_event ev)return 0 ;if (!is_timing_event (ev)) { -if (ev.reset) +if (ev.overflow) data->state =STATE_INACTIVE ;return 0 ; }
drivers/media/rc/ir-sanyo-decoder.c +2 -2
@@ -51,8 +51,8 @@ static int ir_sanyo_decode(struct rc_dev *dev, struct ir_raw_event ev)u8 command, not_command;if (!is_timing_event (ev)) { -if (ev.reset) { -dev_dbg (&dev->dev,"SANYO event reset received. reset to state 0\n" ); +if (ev.overflow) { +dev_dbg (&dev->dev,"SANYO event overflow received. reset to state 0\n" ); data->state =STATE_INACTIVE ; }return 0 ;
drivers/media/rc/ir-sharp-decoder.c +1 -1
@@ -41,7 +41,7 @@ static int ir_sharp_decode(struct rc_dev *dev, struct ir_raw_event ev)u32 msg, echo, address, command, scancode;if (!is_timing_event (ev)) { -if (ev.reset) +if (ev.overflow) data->state =STATE_INACTIVE ;return 0 ; }
drivers/media/rc/ir-sony-decoder.c +1 -1
@@ -39,7 +39,7 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev)u8 device, subdevice, function;if (!is_timing_event (ev)) { -if (ev.reset) +if (ev.overflow) data->state =STATE_INACTIVE ;return 0 ; }
drivers/media/rc/ir-xmp-decoder.c +1 -1
@@ -37,7 +37,7 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev)struct xmp_dec *data = &dev->raw->xmp;if (!is_timing_event (ev)) { -if (ev.reset) +if (ev.overflow) data->state =STATE_INACTIVE ;return 0 ; }
drivers/media/rc/ite-cir.c +1 -1
@@ -238,7 +238,7 @@ static irqreturn_t ite_cir_isr(int irq, void *data)/* Check for RX overflow */ if (iflags &ITE_IRQ_RX_FIFO_OVERRUN ) {dev_warn (&dev->rdev->dev,"receive overflow\n" ); -ir_raw_event_reset (dev->rdev); +ir_raw_event_overflow (dev->rdev); }/* check for the receive interrupt */
drivers/media/rc/lirc_dev.c +4 -4
@@ -41,17 +41,17 @@ void lirc_raw_event(struct rc_dev *dev, struct ir_raw_event ev)struct lirc_fh *fh;int sample; -/* Packet start */ -if (ev.reset) { +/* Receiver overflow, data missing */ +if (ev.overflow) {/* * Userspace expects a long space event before the start of * the signal to use as a sync. This may be done with repeat -* packets and normal samples. But if a reset has been sent +* packets and normal samples. But if an overflow has been sent * then we assume that a long time has passed, so we send a * space with the maximum time value. */ sample =LIRC_SPACE (LIRC_VALUE_MASK ); -dev_dbg (&dev->dev,"delivering reset sync space to lirc_dev\n" ); +dev_dbg (&dev->dev,"delivering overflow space to lirc_dev\n" );/* Carrier reports */ }else if (ev.carrier_report) {
drivers/media/rc/nuvoton-cir.c +1 -1
@@ -742,7 +742,7 @@ static void nvt_handle_rx_fifo_overrun(struct nvt_dev *nvt) nvt->pkts =0 ;nvt_clear_cir_fifo (nvt); -ir_raw_event_reset (nvt->rdev); +ir_raw_event_overflow (nvt->rdev); }/* copy data from hardware rx fifo into driver buffer */
drivers/media/rc/rc-core-priv.h +1 -1
@@ -190,7 +190,7 @@ static inline void decrease_duration(struct ir_raw_event *ev, unsigned duration)/* Returns true if event is normal pulse/space event */ static inline bool is_timing_event (struct ir_raw_event ev) { -return !ev.carrier_report && !ev.reset; +return !ev.carrier_report && !ev.overflow; }#define TO_STR (is_pulse) ((is_pulse) ? "pulse" : "space")
drivers/media/rc/rc-ir-raw.c +0 -2
@@ -35,8 +35,6 @@ static int ir_raw_event_thread(void *data) !is_transition(&ev, &raw->prev_ev))dev_warn_once (&dev->dev,"two consecutive events of type %s" ,TO_STR (ev.pulse)); -if (raw->prev_ev.reset && ev.pulse ==0 ) -dev_warn_once (&dev->dev,"timing event after reset should be pulse" ); }list_for_each_entry (handler, &ir_raw_handler_list, list) if (dev->enabled_protocols &
drivers/media/rc/st_rc.c +1 -1
@@ -111,7 +111,7 @@ static irqreturn_t st_rc_rx_interrupt(int irq, void *data) int_status =readl (dev->rx_base +IRB_RX_INT_STATUS );if (unlikely (int_status &IRB_RX_OVERRUN_INT )) {/* discard the entire collection in case of errors! */ -ir_raw_event_reset (dev->rdev); +ir_raw_event_overflow (dev->rdev);dev_info (dev->dev,"IR RX overrun\n" );writel (IRB_RX_OVERRUN_INT , dev->rx_base +IRB_RX_INT_CLEAR );
drivers/media/rc/sunxi-cir.c +1 -1
@@ -126,7 +126,7 @@ static irqreturn_t sunxi_ir_irq(int irqno, void *dev_id) }if (status ®_RXSTA_ROI ) { -ir_raw_event_reset (ir->rc); +ir_raw_event_overflow (ir->rc); }else if (status ®_RXSTA_RPE ) {ir_raw_event_set_idle (ir->rc, true);ir_raw_event_handle (ir->rc);
drivers/media/rc/winbond-cir.c +1 -1
@@ -470,7 +470,7 @@ wbcir_irq_handler(int irqno, void *cookie)/* RX overflow? (read clears bit) */ if (inb (data->sbase +WBCIR_REG_SP3_LSR ) &WBCIR_RX_OVERRUN ) { data->rxstate =WBCIR_RXSTATE_ERROR ; -ir_raw_event_reset (data->dev); +ir_raw_event_overflow (data->dev); }/* TX underflow? */
include/media/rc-core.h +3 -3
@@ -298,7 +298,7 @@ struct ir_raw_event {u8 duty_cycle; unsigned pulse:1; - unsigned reset:1; + unsigned overflow:1; unsigned timeout:1; unsigned carrier_report:1; };
@@ -321,9 +321,9 @@ int ir_raw_encode_scancode(enum rc_proto protocol, u32 scancode, struct ir_raw_event *events, unsigned int max);int ir_raw_encode_carrier (enum rc_proto protocol); -static inline void ir_raw_event_reset (struct rc_dev *dev) +static inline void ir_raw_event_overflow (struct rc_dev *dev) { -ir_raw_event_store (dev, &((struct ir_raw_event ) { .reset = true })); +ir_raw_event_store (dev, &((struct ir_raw_event ) { .overflow = true })); dev->idle = true;ir_raw_event_handle (dev); }
Signature · 1 line
2.34.1
Sean Young
maintainerPATCH 2/2 media: lirc: report ir receiver overflow
If the driver reports that the hardware had an overflow, report this to userspace. It would be nice to know when this happens, and not just get a long space.
This change has been tested with lircd, ir-ctl, and ir-keytable.
--- .../userspace-api/media/lirc.h.rst.exceptions | 3 +++ .../userspace-api/media/rc/lirc-dev-intro.rst | 11 +++++++++-- drivers/media/rc/lirc_dev.c | 11 +++++------ drivers/media/rc/rc-loopback.c | 6 +++++- include/uapi/linux/lirc.h | 3 +++ 5 files changed, 25 insertions(+), 9 deletions(-)
Documentation/userspace-api/media/lirc.h.rst.exceptions +3 -0
@@ -11,12 +11,14 @@ ignore define LIRC_SPACE ignore define LIRC_PULSE ignore define LIRC_FREQUENCY ignore define LIRC_TIMEOUT +ignore define LIRC_OVERFLOW ignore define LIRC_VALUE ignore define LIRC_MODE2 ignore define LIRC_IS_SPACE ignore define LIRC_IS_PULSE ignore define LIRC_IS_FREQUENCY ignore define LIRC_IS_TIMEOUT +ignore define LIRC_IS_OVERFLOW ignore define LIRC_MODE2SEND ignore define LIRC_SEND2MODE
@@ -75,6 +77,7 @@ ignore define PULSE_MASK ignore define LIRC_MODE2_SPACE ignore define LIRC_MODE2_PULSE ignore define LIRC_MODE2_TIMEOUT +ignore define LIRC_MODE2_OVERFLOW ignore define LIRC_VALUE_MASK ignore define LIRC_MODE2_MASK
Documentation/userspace-api/media/rc/lirc-dev-intro.rst +9 -2
@@ -103,11 +103,11 @@ on the following table. ``LIRC_MODE2_PULSE`` - Signifies the presence of IR in microseconds. + Signifies the presence of IR in microseconds, also known as *flash*. ``LIRC_MODE2_SPACE`` - Signifies absence of IR in microseconds. + Signifies absence of IR in microseconds, also known as *gap*. ``LIRC_MODE2_FREQUENCY``
@@ -121,6 +121,13 @@ on the following table. to no IR being detected, this packet will be sent, with the number of microseconds with no IR. + ``LIRC_MODE2_OVERFLOW`` + + Signifies that the IR receiver encounter an overflow, and some IR + is missing. The IR data after this should be correct again. The + actual value is not important, but this is set to 0xffffff by the + kernel for compatibility with lircd. + .. _lirc-mode-pulse: ``LIRC_MODE_PULSE``
drivers/media/rc/lirc_dev.c +5 -6
@@ -44,13 +44,12 @@ void lirc_raw_event(struct rc_dev *dev, struct ir_raw_event ev)/* Receiver overflow, data missing */ if (ev.overflow) {/* -* Userspace expects a long space event before the start of -* the signal to use as a sync. This may be done with repeat -* packets and normal samples. But if an overflow has been sent -* then we assume that a long time has passed, so we send a -* space with the maximum time value. +* Send lirc overflow message. This message is unknown to +* lircd, but it will interpret this as a long space as +* long as the value is set to high value. This resets its +* decoder state. */ - sample =LIRC_SPACE (LIRC_VALUE_MASK ); + sample =LIRC_OVERFLOW (LIRC_VALUE_MASK );dev_dbg (&dev->dev,"delivering overflow space to lirc_dev\n" );/* Carrier reports */
drivers/media/rc/rc-loopback.c +5 -1
@@ -112,7 +112,11 @@ static int loop_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count) rawir.pulse = i %2 ? false : true; rawir.duration = txbuf[i]; -ir_raw_event_store_with_filter (dev, &rawir); +/* simulate overflow if ridiculously long pulse was sent */ +if (rawir.pulse && rawir.duration >MS_TO_US (50 )) +ir_raw_event_overflow (dev); +else +ir_raw_event_store_with_filter (dev, &rawir); }if (lodev->carrierreport) {
include/uapi/linux/lirc.h +3 -0
@@ -16,6 +16,7 @@#define LIRC_MODE2_PULSE 0x01000000#define LIRC_MODE2_FREQUENCY 0x02000000#define LIRC_MODE2_TIMEOUT 0x03000000 +#define LIRC_MODE2_OVERFLOW 0x04000000#define LIRC_VALUE_MASK 0x00FFFFFF#define LIRC_MODE2_MASK 0xFF000000
@@ -24,6 +25,7 @@#define LIRC_PULSE (val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_PULSE)#define LIRC_FREQUENCY (val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_FREQUENCY)#define LIRC_TIMEOUT (val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_TIMEOUT) +#define LIRC_OVERFLOW (val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_OVERFLOW)#define LIRC_VALUE (val) ((val)&LIRC_VALUE_MASK)#define LIRC_MODE2 (val) ((val)&LIRC_MODE2_MASK)
@@ -32,6 +34,7 @@#define LIRC_IS_PULSE (val) (LIRC_MODE2(val) == LIRC_MODE2_PULSE)#define LIRC_IS_FREQUENCY (val) (LIRC_MODE2(val) == LIRC_MODE2_FREQUENCY)#define LIRC_IS_TIMEOUT (val) (LIRC_MODE2(val) == LIRC_MODE2_TIMEOUT) +#define LIRC_IS_OVERFLOW (val) (LIRC_MODE2(val) == LIRC_MODE2_OVERFLOW)/* used heavily by lirc userspace */ #define lirc_t int
Signature · 1 line
2.34.1
kernel test robot
build botI love your patch! Yet something to improve:
Hi Sean,
I love your patch! Yet something to improve:
[auto build test ERROR on media-tree/master]
[also build test ERROR on next-20220121]
[cannot apply to sunxi/sunxi/for-next v5.16]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Sean-Young/media-rc-core-rename-ir_raw_event_reset-to-ir_raw_event_overflow/20220121-001937 base: git://linuxtv.org/media_tree.git master config: hexagon-randconfig-r041-20220120 (https://download.01.org/0day-ci/archive/20220121/202201211605.1ccb0HNg-lkp(a)intel.com/config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project f7b7138a62648f4019c55e4671682af1f851f295)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/5b0115b915832b54ebe085c923d73209b1abb364
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Sean-Young/media-rc-core-rename-ir_raw_event_reset-to-ir_raw_event_overflow/20220121-001937 git checkout 5b0115b915832b54ebe085c923d73209b1abb364
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/media/rc/
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
>> drivers/media/rc/mtk-cir.c:220:2: error: implicit declaration of function 'ir_raw_event_reset' [-Werror,-Wimplicit-function-declaration]
ir_raw_event_reset(ir->rc);
^
drivers/media/rc/mtk-cir.c:220:2: note: did you mean 'ir_raw_event_store'?
include/media/rc-core.h:317:5: note: 'ir_raw_event_store' declared here
int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev);
^1 error generated.
vim +/ir_raw_event_reset +220 drivers/media/rc/mtk-cir.c
6691e7b9a57c24 Sean Wang 2017-01-13 202
6691e7b9a57c24 Sean Wang 2017-01-13 203 static irqreturn_t mtk_ir_irq(int irqno, void *dev_id)
6691e7b9a57c24 Sean Wang 2017-01-13 204 {
6691e7b9a57c24 Sean Wang 2017-01-13 205 struct mtk_ir *ir = dev_id;
6691e7b9a57c24 Sean Wang 2017-01-13 206 u8 wid = 0;
6691e7b9a57c24 Sean Wang 2017-01-13 207 u32 i, j, val;
183e19f5b9ee18 Sean Young 2018-08-21 208 struct ir_raw_event rawir = {};
6691e7b9a57c24 Sean Wang 2017-01-13 209
6691e7b9a57c24 Sean Wang 2017-01-13 210 /*
6691e7b9a57c24 Sean Wang 2017-01-13 211 * Reset decoder state machine explicitly is required
6691e7b9a57c24 Sean Wang 2017-01-13 212 * because 1) the longest duration for space MTK IR hardware
6691e7b9a57c24 Sean Wang 2017-01-13 213 * could record is not safely long. e.g 12ms if rx resolution
6691e7b9a57c24 Sean Wang 2017-01-13 214 * is 46us by default. There is still the risk to satisfying
6691e7b9a57c24 Sean Wang 2017-01-13 215 * every decoder to reset themselves through long enough
6691e7b9a57c24 Sean Wang 2017-01-13 216 * trailing spaces and 2) the IRQ handler guarantees that
6691e7b9a57c24 Sean Wang 2017-01-13 217 * start of IR message is always contained in and starting
50c3c1ba171f3f Sean Wang 2017-06-30 218 * from register mtk_chkdata_reg(ir, i).
6691e7b9a57c24 Sean Wang 2017-01-13 219 */
6691e7b9a57c24 Sean Wang 2017-01-13 @220 ir_raw_event_reset(ir->rc);
6691e7b9a57c24 Sean Wang 2017-01-13 221
6691e7b9a57c24 Sean Wang 2017-01-13 222 /* First message must be pulse */
6691e7b9a57c24 Sean Wang 2017-01-13 223 rawir.pulse = false;
6691e7b9a57c24 Sean Wang 2017-01-13 224
6691e7b9a57c24 Sean Wang 2017-01-13 225 /* Handle all pulse and space IR controller captures */
6691e7b9a57c24 Sean Wang 2017-01-13 226 for (i = 0 ; i < MTK_CHKDATA_SZ ; i++) {
50c3c1ba171f3f Sean Wang 2017-06-30 227 val = mtk_r32(ir, mtk_chkdata_reg(ir, i));
6691e7b9a57c24 Sean Wang 2017-01-13 228 dev_dbg(ir->dev, "@reg%d=0x%08x\n", i, val);
6691e7b9a57c24 Sean Wang 2017-01-13 229
6691e7b9a57c24 Sean Wang 2017-01-13 230 for (j = 0 ; j < 4 ; j++) {
6691e7b9a57c24 Sean Wang 2017-01-13 231 wid = (val & (MTK_WIDTH_MASK << j * 8)) >> j * 8;
6691e7b9a57c24 Sean Wang 2017-01-13 232 rawir.pulse = !rawir.pulse;
6691e7b9a57c24 Sean Wang 2017-01-13 233 rawir.duration = wid * (MTK_IR_SAMPLE + 1);
6691e7b9a57c24 Sean Wang 2017-01-13 234 ir_raw_event_store_with_filter(ir->rc, &rawir);
6691e7b9a57c24 Sean Wang 2017-01-13 235 }
6691e7b9a57c24 Sean Wang 2017-01-13 236 }
6691e7b9a57c24 Sean Wang 2017-01-13 237
6691e7b9a57c24 Sean Wang 2017-01-13 238 /*
6691e7b9a57c24 Sean Wang 2017-01-13 239 * The maximum number of edges the IR controller can
6691e7b9a57c24 Sean Wang 2017-01-13 240 * hold is MTK_CHKDATA_SZ * 4. So if received IR messages
6691e7b9a57c24 Sean Wang 2017-01-13 241 * is over the limit, the last incomplete IR message would
6691e7b9a57c24 Sean Wang 2017-01-13 242 * be appended trailing space and still would be sent into
6691e7b9a57c24 Sean Wang 2017-01-13 243 * ir-rc-raw to decode. That helps it is possible that it
6691e7b9a57c24 Sean Wang 2017-01-13 244 * has enough information to decode a scancode even if the
6691e7b9a57c24 Sean Wang 2017-01-13 245 * trailing end of the message is missing.
6691e7b9a57c24 Sean Wang 2017-01-13 246 */
6691e7b9a57c24 Sean Wang 2017-01-13 247 if (!MTK_IR_END(wid, rawir.pulse)) {
6691e7b9a57c24 Sean Wang 2017-01-13 248 rawir.pulse = false;
6691e7b9a57c24 Sean Wang 2017-01-13 249 rawir.duration = MTK_MAX_SAMPLES * (MTK_IR_SAMPLE + 1);
6691e7b9a57c24 Sean Wang 2017-01-13 250 ir_raw_event_store_with_filter(ir->rc, &rawir);
6691e7b9a57c24 Sean Wang 2017-01-13 251 }
6691e7b9a57c24 Sean Wang 2017-01-13 252
6691e7b9a57c24 Sean Wang 2017-01-13 253 ir_raw_event_handle(ir->rc);
6691e7b9a57c24 Sean Wang 2017-01-13 254
6691e7b9a57c24 Sean Wang 2017-01-13 255 /*
6691e7b9a57c24 Sean Wang 2017-01-13 256 * Restart controller for the next receive that would
6691e7b9a57c24 Sean Wang 2017-01-13 257 * clear up all CHKDATA registers
6691e7b9a57c24 Sean Wang 2017-01-13 258 */
50c3c1ba171f3f Sean Wang 2017-06-30 259 mtk_w32_mask(ir, 0x1, MTK_IRCLR, ir->data->regs[MTK_IRCLR_REG]);
6691e7b9a57c24 Sean Wang 2017-01-13 260
6691e7b9a57c24 Sean Wang 2017-01-13 261 /* Clear interrupt status */
50c3c1ba171f3f Sean Wang 2017-06-30 262 mtk_w32_mask(ir, 0x1, MTK_IRINT_CLR,
50c3c1ba171f3f Sean Wang 2017-06-30 263 ir->data->regs[MTK_IRINT_CLR_REG]);
6691e7b9a57c24 Sean Wang 2017-01-13 264
6691e7b9a57c24 Sean Wang 2017-01-13 265 return IRQ_HANDLED;
6691e7b9a57c24 Sean Wang 2017-01-13 266 }
6691e7b9a57c24 Sean Wang 2017-01-13 267 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
Sean Young
maintainerHi Bot,
Quoted 31 lines · kernel test robot
Hi Sean,
I love your patch! Yet something to improve:
[auto build test ERROR on media-tree/master]
[also build test ERROR on next-20220121]
[cannot apply to sunxi/sunxi/for-next v5.16]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]url: https://github.com/0day-ci/linux/commits/Sean-Young/media-rc-core-rename-ir_raw_event_reset-to-ir_raw_event_overflow/20220121-001937 base: git://linuxtv.org/media_tree.git master config: hexagon-randconfig-r041-20220120 (https://download.01.org/0day-ci/archive/20220121/202201211605.1ccb0HNg-lkp(a)intel.com/config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project f7b7138a62648f4019c55e4671682af1f851f295)reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/5b0115b915832b54ebe085c923d73209b1abb364
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Sean-Young/media-rc-core-rename-ir_raw_event_reset-to-ir_raw_event_overflow/20220121-001937 git checkout5b0115b915832b54ebe085c923d73209b1abb364
# save the config file to linux build tree
mkdirbuild_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bashdrivers/media/rc/If you fix the issue, kindly add following tag as appropriate
Reported-by kernel test robot <[email protected]>All errors (new ones prefixed by >>):
Quoted 8 lines
Quoted 1 line
Quoted 1 line
drivers/media/rc/mtk-cir.c:220:2: error: implicit declaration of function 'ir_raw_event_reset' [-Werror,-Wimplicit-function-declaration]ir_raw_event_reset(ir->rc); ^ drivers/media/rc/mtk-cir.c:220:2: note: did you mean 'ir_raw_event_store'? include/media/rc-core.h:317:5: note: 'ir_raw_event_store' declared here int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev); ^1 error generated.
This patch depends on:
https://patchwork.linuxtv.org/project/linux-media/patch/20220114150353.195192-2-sean(a)mess.org/
With that patch it should build fine.
Sean
kernel test robot
build botI love your patch! Yet something to improve:
Hi Sean,
I love your patch! Yet something to improve:
[auto build test ERROR on media-tree/master]
[also build test ERROR on next-20220121]
[cannot apply to sunxi/sunxi/for-next v5.16]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Sean-Young/media-rc-core-rename-ir_raw_event_reset-to-ir_raw_event_overflow/20220121-001937 base: git://linuxtv.org/media_tree.git master config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20220122/202201220241.WSoRnyo3-lkp(a)intel.com/config) compiler: alpha-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/5b0115b915832b54ebe085c923d73209b1abb364
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Sean-Young/media-rc-core-rename-ir_raw_event_reset-to-ir_raw_event_overflow/20220121-001937 git checkout 5b0115b915832b54ebe085c923d73209b1abb364
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=alpha SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
drivers/media/rc/mtk-cir.c: In function 'mtk_ir_irq':
>> drivers/media/rc/mtk-cir.c:220:9: error: implicit declaration of function 'ir_raw_event_reset'; did you mean 'ir_raw_event_store'? [-Werror=implicit-function-declaration]
220 | ir_raw_event_reset(ir->rc);
| ^~~~~~~~~~~~~~~~~~
| ir_raw_event_storecc1: some warnings being treated as errors
vim +220 drivers/media/rc/mtk-cir.c
6691e7b9a57c24 Sean Wang 2017-01-13 202
6691e7b9a57c24 Sean Wang 2017-01-13 203 static irqreturn_t mtk_ir_irq(int irqno, void *dev_id)
6691e7b9a57c24 Sean Wang 2017-01-13 204 {
6691e7b9a57c24 Sean Wang 2017-01-13 205 struct mtk_ir *ir = dev_id;
6691e7b9a57c24 Sean Wang 2017-01-13 206 u8 wid = 0;
6691e7b9a57c24 Sean Wang 2017-01-13 207 u32 i, j, val;
183e19f5b9ee18 Sean Young 2018-08-21 208 struct ir_raw_event rawir = {};
6691e7b9a57c24 Sean Wang 2017-01-13 209
6691e7b9a57c24 Sean Wang 2017-01-13 210 /*
6691e7b9a57c24 Sean Wang 2017-01-13 211 * Reset decoder state machine explicitly is required
6691e7b9a57c24 Sean Wang 2017-01-13 212 * because 1) the longest duration for space MTK IR hardware
6691e7b9a57c24 Sean Wang 2017-01-13 213 * could record is not safely long. e.g 12ms if rx resolution
6691e7b9a57c24 Sean Wang 2017-01-13 214 * is 46us by default. There is still the risk to satisfying
6691e7b9a57c24 Sean Wang 2017-01-13 215 * every decoder to reset themselves through long enough
6691e7b9a57c24 Sean Wang 2017-01-13 216 * trailing spaces and 2) the IRQ handler guarantees that
6691e7b9a57c24 Sean Wang 2017-01-13 217 * start of IR message is always contained in and starting
50c3c1ba171f3f Sean Wang 2017-06-30 218 * from register mtk_chkdata_reg(ir, i).
6691e7b9a57c24 Sean Wang 2017-01-13 219 */
6691e7b9a57c24 Sean Wang 2017-01-13 @220 ir_raw_event_reset(ir->rc);
6691e7b9a57c24 Sean Wang 2017-01-13 221
6691e7b9a57c24 Sean Wang 2017-01-13 222 /* First message must be pulse */
6691e7b9a57c24 Sean Wang 2017-01-13 223 rawir.pulse = false;
6691e7b9a57c24 Sean Wang 2017-01-13 224
6691e7b9a57c24 Sean Wang 2017-01-13 225 /* Handle all pulse and space IR controller captures */
6691e7b9a57c24 Sean Wang 2017-01-13 226 for (i = 0 ; i < MTK_CHKDATA_SZ ; i++) {
50c3c1ba171f3f Sean Wang 2017-06-30 227 val = mtk_r32(ir, mtk_chkdata_reg(ir, i));
6691e7b9a57c24 Sean Wang 2017-01-13 228 dev_dbg(ir->dev, "@reg%d=0x%08x\n", i, val);
6691e7b9a57c24 Sean Wang 2017-01-13 229
6691e7b9a57c24 Sean Wang 2017-01-13 230 for (j = 0 ; j < 4 ; j++) {
6691e7b9a57c24 Sean Wang 2017-01-13 231 wid = (val & (MTK_WIDTH_MASK << j * 8)) >> j * 8;
6691e7b9a57c24 Sean Wang 2017-01-13 232 rawir.pulse = !rawir.pulse;
6691e7b9a57c24 Sean Wang 2017-01-13 233 rawir.duration = wid * (MTK_IR_SAMPLE + 1);
6691e7b9a57c24 Sean Wang 2017-01-13 234 ir_raw_event_store_with_filter(ir->rc, &rawir);
6691e7b9a57c24 Sean Wang 2017-01-13 235 }
6691e7b9a57c24 Sean Wang 2017-01-13 236 }
6691e7b9a57c24 Sean Wang 2017-01-13 237
6691e7b9a57c24 Sean Wang 2017-01-13 238 /*
6691e7b9a57c24 Sean Wang 2017-01-13 239 * The maximum number of edges the IR controller can
6691e7b9a57c24 Sean Wang 2017-01-13 240 * hold is MTK_CHKDATA_SZ * 4. So if received IR messages
6691e7b9a57c24 Sean Wang 2017-01-13 241 * is over the limit, the last incomplete IR message would
6691e7b9a57c24 Sean Wang 2017-01-13 242 * be appended trailing space and still would be sent into
6691e7b9a57c24 Sean Wang 2017-01-13 243 * ir-rc-raw to decode. That helps it is possible that it
6691e7b9a57c24 Sean Wang 2017-01-13 244 * has enough information to decode a scancode even if the
6691e7b9a57c24 Sean Wang 2017-01-13 245 * trailing end of the message is missing.
6691e7b9a57c24 Sean Wang 2017-01-13 246 */
6691e7b9a57c24 Sean Wang 2017-01-13 247 if (!MTK_IR_END(wid, rawir.pulse)) {
6691e7b9a57c24 Sean Wang 2017-01-13 248 rawir.pulse = false;
6691e7b9a57c24 Sean Wang 2017-01-13 249 rawir.duration = MTK_MAX_SAMPLES * (MTK_IR_SAMPLE + 1);
6691e7b9a57c24 Sean Wang 2017-01-13 250 ir_raw_event_store_with_filter(ir->rc, &rawir);
6691e7b9a57c24 Sean Wang 2017-01-13 251 }
6691e7b9a57c24 Sean Wang 2017-01-13 252
6691e7b9a57c24 Sean Wang 2017-01-13 253 ir_raw_event_handle(ir->rc);
6691e7b9a57c24 Sean Wang 2017-01-13 254
6691e7b9a57c24 Sean Wang 2017-01-13 255 /*
6691e7b9a57c24 Sean Wang 2017-01-13 256 * Restart controller for the next receive that would
6691e7b9a57c24 Sean Wang 2017-01-13 257 * clear up all CHKDATA registers
6691e7b9a57c24 Sean Wang 2017-01-13 258 */
50c3c1ba171f3f Sean Wang 2017-06-30 259 mtk_w32_mask(ir, 0x1, MTK_IRCLR, ir->data->regs[MTK_IRCLR_REG]);
6691e7b9a57c24 Sean Wang 2017-01-13 260
6691e7b9a57c24 Sean Wang 2017-01-13 261 /* Clear interrupt status */
50c3c1ba171f3f Sean Wang 2017-06-30 262 mtk_w32_mask(ir, 0x1, MTK_IRINT_CLR,
50c3c1ba171f3f Sean Wang 2017-06-30 263 ir->data->regs[MTK_IRINT_CLR_REG]);
6691e7b9a57c24 Sean Wang 2017-01-13 264
6691e7b9a57c24 Sean Wang 2017-01-13 265 return IRQ_HANDLED;
6691e7b9a57c24 Sean Wang 2017-01-13 266 }
6691e7b9a57c24 Sean Wang 2017-01-13 267 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org