Source
dev_info(&dev->dev, "lirc_dev: driver %s registered at minor = %d, %s receiver, %s transmitter",
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* LIRC base driver
*
* by Artur Lipowski <alipowski@interia.pl>
*/
static dev_t lirc_base_dev;
/* Used to keep track of allocated lirc devices */
static DEFINE_IDA(lirc_ida);
/* Only used for sysfs but defined to void otherwise */
static struct class *lirc_class;
/**
* ir_lirc_raw_event() - Send raw IR data to lirc to be relayed to userspace
*
* @dev: the struct rc_dev descriptor of the device
* @ev: the struct ir_raw_event descriptor of the pulse/space
*/
void ir_lirc_raw_event(struct rc_dev *dev, struct ir_raw_event ev)
{
unsigned long flags;
struct lirc_fh *fh;
int sample;
/* Packet start */
if (ev.reset) {
/*
* 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
* 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");
/* Carrier reports */
} else if (ev.carrier_report) {
sample = LIRC_FREQUENCY(ev.carrier);
dev_dbg(&dev->dev, "carrier report (freq: %d)\n", sample);
/* Packet end */
} else if (ev.timeout) {
if (dev->gap)