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.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
Sean Young 2022-01-15 11:12:35 +01:00 committed by Mauro Carvalho Chehab
parent b2a90f4fcb
commit 950170d6d2
25 changed files with 30 additions and 32 deletions

View file

@ -55,7 +55,7 @@ static void cx23885_input_process_measurements(struct cx23885_dev *dev,
} while (num != 0); } while (num != 0);
if (overrun) if (overrun)
ir_raw_event_reset(kernel_ir->rc); ir_raw_event_overflow(kernel_ir->rc);
else if (handle) else if (handle)
ir_raw_event_handle(kernel_ir->rc); ir_raw_event_handle(kernel_ir->rc);
} }

View file

@ -287,7 +287,7 @@ static void fintek_process_rx_ir_data(struct fintek_dev *fintek)
if (fintek->rem) if (fintek->rem)
fintek->parser_state = PARSE_IRDATA; fintek->parser_state = PARSE_IRDATA;
else else
ir_raw_event_reset(fintek->rdev); ir_raw_event_overflow(fintek->rdev);
break; break;
case SUBCMD: case SUBCMD:
fintek->rem = fintek_cmdsize(fintek->cmd, sample); fintek->rem = fintek_cmdsize(fintek->cmd, sample);

View file

@ -67,7 +67,7 @@ static void igorplugusb_irdata(struct igorplugusb *ir, unsigned len)
if (overflow > 0) { if (overflow > 0) {
dev_warn(ir->dev, "receive overflow, at least %u lost", dev_warn(ir->dev, "receive overflow, at least %u lost",
overflow); overflow);
ir_raw_event_reset(ir->rc); ir_raw_event_overflow(ir->rc);
} }
do { do {

View file

@ -109,7 +109,7 @@ static void process_ir_data(struct iguanair *ir, unsigned len)
break; break;
case CMD_RX_OVERFLOW: case CMD_RX_OVERFLOW:
dev_warn(ir->dev, "receive overflow\n"); dev_warn(ir->dev, "receive overflow\n");
ir_raw_event_reset(ir->rc); ir_raw_event_overflow(ir->rc);
break; break;
default: default:
dev_warn(ir->dev, "control code %02x received\n", dev_warn(ir->dev, "control code %02x received\n",

View file

@ -194,7 +194,7 @@ static irqreturn_t hix5hd2_ir_rx_interrupt(int irq, void *data)
* IR_INTS availably since logic would not clear * IR_INTS availably since logic would not clear
* fifo when overflow, drv do the job * 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); symb_num = readl_relaxed(priv->base + IR_DATAH);
for (i = 0; i < symb_num; i++) for (i = 0; i < symb_num; i++)
readl_relaxed(priv->base + IR_DATAL); readl_relaxed(priv->base + IR_DATAL);

View file

@ -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; struct imon_dec *data = &dev->raw->imon;
if (!is_timing_event(ev)) { if (!is_timing_event(ev)) {
if (ev.reset) if (ev.overflow)
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return 0; return 0;
} }

View file

@ -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; struct jvc_dec *data = &dev->raw->jvc;
if (!is_timing_event(ev)) { if (!is_timing_event(ev)) {
if (ev.reset) if (ev.overflow)
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return 0; return 0;
} }

View file

@ -221,7 +221,7 @@ static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev)
struct lirc_scancode lsc = {}; struct lirc_scancode lsc = {};
if (!is_timing_event(ev)) { if (!is_timing_event(ev)) {
if (ev.reset) if (ev.overflow)
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return 0; return 0;
} }

View file

@ -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; u8 address, not_address, command, not_command;
if (!is_timing_event(ev)) { if (!is_timing_event(ev)) {
if (ev.reset) if (ev.overflow)
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return 0; return 0;
} }

View file

@ -45,7 +45,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev)
enum rc_proto protocol; enum rc_proto protocol;
if (!is_timing_event(ev)) { if (!is_timing_event(ev)) {
if (ev.reset) if (ev.overflow)
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return 0; return 0;
} }

View file

@ -85,7 +85,7 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev)
enum rc_proto protocol; enum rc_proto protocol;
if (!is_timing_event(ev)) { if (!is_timing_event(ev)) {
if (ev.reset) if (ev.overflow)
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return 0; return 0;
} }

View file

@ -69,7 +69,7 @@ static int ir_rcmm_decode(struct rc_dev *dev, struct ir_raw_event ev)
return 0; return 0;
if (!is_timing_event(ev)) { if (!is_timing_event(ev)) {
if (ev.reset) if (ev.overflow)
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return 0; return 0;
} }

View file

@ -51,8 +51,8 @@ static int ir_sanyo_decode(struct rc_dev *dev, struct ir_raw_event ev)
u8 command, not_command; u8 command, not_command;
if (!is_timing_event(ev)) { if (!is_timing_event(ev)) {
if (ev.reset) { if (ev.overflow) {
dev_dbg(&dev->dev, "SANYO event reset received. reset to state 0\n"); dev_dbg(&dev->dev, "SANYO event overflow received. reset to state 0\n");
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
} }
return 0; return 0;

View file

@ -41,7 +41,7 @@ static int ir_sharp_decode(struct rc_dev *dev, struct ir_raw_event ev)
u32 msg, echo, address, command, scancode; u32 msg, echo, address, command, scancode;
if (!is_timing_event(ev)) { if (!is_timing_event(ev)) {
if (ev.reset) if (ev.overflow)
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return 0; return 0;
} }

View file

@ -39,7 +39,7 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev)
u8 device, subdevice, function; u8 device, subdevice, function;
if (!is_timing_event(ev)) { if (!is_timing_event(ev)) {
if (ev.reset) if (ev.overflow)
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return 0; return 0;
} }

View file

@ -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; struct xmp_dec *data = &dev->raw->xmp;
if (!is_timing_event(ev)) { if (!is_timing_event(ev)) {
if (ev.reset) if (ev.overflow)
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return 0; return 0;
} }

View file

@ -238,7 +238,7 @@ static irqreturn_t ite_cir_isr(int irq, void *data)
/* Check for RX overflow */ /* Check for RX overflow */
if (iflags & ITE_IRQ_RX_FIFO_OVERRUN) { if (iflags & ITE_IRQ_RX_FIFO_OVERRUN) {
dev_warn(&dev->rdev->dev, "receive overflow\n"); 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 */ /* check for the receive interrupt */

View file

@ -41,17 +41,17 @@ void lirc_raw_event(struct rc_dev *dev, struct ir_raw_event ev)
struct lirc_fh *fh; struct lirc_fh *fh;
int sample; int sample;
/* Packet start */ /* Receiver overflow, data missing */
if (ev.reset) { if (ev.overflow) {
/* /*
* Userspace expects a long space event before the start of * Userspace expects a long space event before the start of
* the signal to use as a sync. This may be done with repeat * 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 * then we assume that a long time has passed, so we send a
* space with the maximum time value. * space with the maximum time value.
*/ */
sample = LIRC_SPACE(LIRC_VALUE_MASK); 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 */ /* Carrier reports */
} else if (ev.carrier_report) { } else if (ev.carrier_report) {

View file

@ -742,7 +742,7 @@ static void nvt_handle_rx_fifo_overrun(struct nvt_dev *nvt)
nvt->pkts = 0; nvt->pkts = 0;
nvt_clear_cir_fifo(nvt); 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 */ /* copy data from hardware rx fifo into driver buffer */

View file

@ -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 */ /* Returns true if event is normal pulse/space event */
static inline bool is_timing_event(struct ir_raw_event ev) 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") #define TO_STR(is_pulse) ((is_pulse) ? "pulse" : "space")

View file

@ -35,8 +35,6 @@ static int ir_raw_event_thread(void *data)
!is_transition(&ev, &raw->prev_ev)) !is_transition(&ev, &raw->prev_ev))
dev_warn_once(&dev->dev, "two consecutive events of type %s", dev_warn_once(&dev->dev, "two consecutive events of type %s",
TO_STR(ev.pulse)); 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) list_for_each_entry(handler, &ir_raw_handler_list, list)
if (dev->enabled_protocols & if (dev->enabled_protocols &

View file

@ -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); int_status = readl(dev->rx_base + IRB_RX_INT_STATUS);
if (unlikely(int_status & IRB_RX_OVERRUN_INT)) { if (unlikely(int_status & IRB_RX_OVERRUN_INT)) {
/* discard the entire collection in case of errors! */ /* 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"); dev_info(dev->dev, "IR RX overrun\n");
writel(IRB_RX_OVERRUN_INT, writel(IRB_RX_OVERRUN_INT,
dev->rx_base + IRB_RX_INT_CLEAR); dev->rx_base + IRB_RX_INT_CLEAR);

View file

@ -126,7 +126,7 @@ static irqreturn_t sunxi_ir_irq(int irqno, void *dev_id)
} }
if (status & REG_RXSTA_ROI) { if (status & REG_RXSTA_ROI) {
ir_raw_event_reset(ir->rc); ir_raw_event_overflow(ir->rc);
} else if (status & REG_RXSTA_RPE) { } else if (status & REG_RXSTA_RPE) {
ir_raw_event_set_idle(ir->rc, true); ir_raw_event_set_idle(ir->rc, true);
ir_raw_event_handle(ir->rc); ir_raw_event_handle(ir->rc);

View file

@ -470,7 +470,7 @@ wbcir_irq_handler(int irqno, void *cookie)
/* RX overflow? (read clears bit) */ /* RX overflow? (read clears bit) */
if (inb(data->sbase + WBCIR_REG_SP3_LSR) & WBCIR_RX_OVERRUN) { if (inb(data->sbase + WBCIR_REG_SP3_LSR) & WBCIR_RX_OVERRUN) {
data->rxstate = WBCIR_RXSTATE_ERROR; data->rxstate = WBCIR_RXSTATE_ERROR;
ir_raw_event_reset(data->dev); ir_raw_event_overflow(data->dev);
} }
/* TX underflow? */ /* TX underflow? */

View file

@ -298,7 +298,7 @@ struct ir_raw_event {
u8 duty_cycle; u8 duty_cycle;
unsigned pulse:1; unsigned pulse:1;
unsigned reset:1; unsigned overflow:1;
unsigned timeout:1; unsigned timeout:1;
unsigned carrier_report: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); struct ir_raw_event *events, unsigned int max);
int ir_raw_encode_carrier(enum rc_proto protocol); 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; dev->idle = true;
ir_raw_event_handle(dev); ir_raw_event_handle(dev);
} }