14a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson/*
24a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * LIRC base driver
34a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson *
44a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * by Artur Lipowski <alipowski@interia.pl>
54a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson *        This code is licensed under GNU GPL
64a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson *
74a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson */
84a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
94a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson#ifndef _LINUX_LIRC_DEV_H
104a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson#define _LINUX_LIRC_DEV_H
114a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
128de111e27688798623b9e9062235bb0cac29f599Jarod Wilson#define MAX_IRCTL_DEVICES 8
134a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson#define BUFLEN            16
144a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
154a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson#define mod(n, div) ((n) % (div))
164a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
174a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson#include <linux/slab.h>
184a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson#include <linux/fs.h>
194a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson#include <linux/ioctl.h>
204a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson#include <linux/poll.h>
214a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson#include <linux/kfifo.h>
224a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson#include <media/lirc.h>
234a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
244a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilsonstruct lirc_buffer {
254a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	wait_queue_head_t wait_poll;
264a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	spinlock_t fifo_lock;
274a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	unsigned int chunk_size;
284a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	unsigned int size; /* in chunks */
294a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	/* Using chunks instead of bytes pretends to simplify boundary checking
304a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	 * And should allow for some performance fine tunning later */
314a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	struct kfifo fifo;
324a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	u8 fifo_initialized;
334a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson};
344a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
354a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilsonstatic inline void lirc_buffer_clear(struct lirc_buffer *buf)
364a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson{
374a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	unsigned long flags;
384a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
394a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	if (buf->fifo_initialized) {
404a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson		spin_lock_irqsave(&buf->fifo_lock, flags);
414a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson		kfifo_reset(&buf->fifo);
424a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson		spin_unlock_irqrestore(&buf->fifo_lock, flags);
434a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	} else
444a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson		WARN(1, "calling %s on an uninitialized lirc_buffer\n",
454a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson		     __func__);
464a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson}
474a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
484a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilsonstatic inline int lirc_buffer_init(struct lirc_buffer *buf,
494a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson				    unsigned int chunk_size,
504a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson				    unsigned int size)
514a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson{
524a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	int ret;
534a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
544a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	init_waitqueue_head(&buf->wait_poll);
554a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	spin_lock_init(&buf->fifo_lock);
564a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	buf->chunk_size = chunk_size;
574a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	buf->size = size;
584a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	ret = kfifo_alloc(&buf->fifo, size * chunk_size, GFP_KERNEL);
594a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	if (ret == 0)
604a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson		buf->fifo_initialized = 1;
614a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
624a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	return ret;
634a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson}
644a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
654a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilsonstatic inline void lirc_buffer_free(struct lirc_buffer *buf)
664a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson{
674a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	if (buf->fifo_initialized) {
684a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson		kfifo_free(&buf->fifo);
694a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson		buf->fifo_initialized = 0;
704a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	} else
714a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson		WARN(1, "calling %s on an uninitialized lirc_buffer\n",
724a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson		     __func__);
734a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson}
744a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
754a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilsonstatic inline int lirc_buffer_len(struct lirc_buffer *buf)
764a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson{
774a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	int len;
784a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	unsigned long flags;
794a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
804a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	spin_lock_irqsave(&buf->fifo_lock, flags);
814a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	len = kfifo_len(&buf->fifo);
824a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	spin_unlock_irqrestore(&buf->fifo_lock, flags);
834a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
844a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	return len;
854a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson}
864a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
874a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilsonstatic inline int lirc_buffer_full(struct lirc_buffer *buf)
884a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson{
894a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	return lirc_buffer_len(buf) == buf->size * buf->chunk_size;
904a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson}
914a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
924a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilsonstatic inline int lirc_buffer_empty(struct lirc_buffer *buf)
934a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson{
944a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	return !lirc_buffer_len(buf);
954a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson}
964a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
974a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilsonstatic inline int lirc_buffer_available(struct lirc_buffer *buf)
984a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson{
994a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	return buf->size - (lirc_buffer_len(buf) / buf->chunk_size);
1004a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson}
1014a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
1024a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilsonstatic inline unsigned int lirc_buffer_read(struct lirc_buffer *buf,
1034a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson					    unsigned char *dest)
1044a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson{
1054a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	unsigned int ret = 0;
1064a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
1074a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	if (lirc_buffer_len(buf) >= buf->chunk_size)
1084a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson		ret = kfifo_out_locked(&buf->fifo, dest, buf->chunk_size,
1094a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson				       &buf->fifo_lock);
1104a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	return ret;
1114a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
1124a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson}
1134a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
1144a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilsonstatic inline unsigned int lirc_buffer_write(struct lirc_buffer *buf,
1154a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson					     unsigned char *orig)
1164a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson{
1174a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	unsigned int ret;
1184a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
1194a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	ret = kfifo_in_locked(&buf->fifo, orig, buf->chunk_size,
1204a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson			      &buf->fifo_lock);
1214a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
1224a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	return ret;
1234a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson}
1244a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
1254a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilsonstruct lirc_driver {
1264a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	char name[40];
1274a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	int minor;
128be1f985ffa49467f604318182616678b3e5184fdJarod Wilson	__u32 code_length;
1294a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	unsigned int buffer_size; /* in chunks holding one code each */
1304a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	int sample_rate;
131be1f985ffa49467f604318182616678b3e5184fdJarod Wilson	__u32 features;
1324a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
1334a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	unsigned int chunk_size;
1344a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
1354a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	void *data;
1364a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	int min_timeout;
1374a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	int max_timeout;
1384a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	int (*add_to_buf) (void *data, struct lirc_buffer *buf);
1394a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	struct lirc_buffer *rbuf;
1404a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	int (*set_use_inc) (void *data);
1414a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	void (*set_use_dec) (void *data);
142ca7a722db1c90dfe0dba165ecef01d6ac8cfee0dSrinivas Kandagatla	struct rc_dev *rdev;
14322c00854f3db563427527a8f71c20bd3943b13e0Geert Uytterhoeven	const struct file_operations *fops;
1444a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	struct device *dev;
1454a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson	struct module *owner;
1464a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson};
1474a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
1484a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson/* name:
1494a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * this string will be used for logs
1504a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson *
1514a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * minor:
1524a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * indicates minor device (/dev/lirc) number for registered driver
1534a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * if caller fills it with negative value, then the first free minor
1544a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * number will be used (if available)
1554a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson *
1564a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * code_length:
1574a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * length of the remote control key code expressed in bits
1584a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson *
1594a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * sample_rate:
1604a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson *
1614a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * data:
1624a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * it may point to any driver data and this pointer will be passed to
1634a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * all callback functions
1644a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson *
1654a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * add_to_buf:
1664a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * add_to_buf will be called after specified period of the time or
1674a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * triggered by the external event, this behavior depends on value of
1684a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * the sample_rate this function will be called in user context. This
1694a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * routine should return 0 if data was added to the buffer and
1704a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * -ENODATA if none was available. This should add some number of bits
1714a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * evenly divisible by code_length to the buffer
1724a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson *
1734a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * rbuf:
1744a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * if not NULL, it will be used as a read buffer, you will have to
1754a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * write to the buffer by other means, like irq's (see also
1764a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * lirc_serial.c).
1774a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson *
1784a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * set_use_inc:
1794a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * set_use_inc will be called after device is opened
1804a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson *
1814a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * set_use_dec:
1824a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * set_use_dec will be called after device is closed
1834a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson *
1844a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * fops:
1854a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * file_operations for drivers which don't fit the current driver model.
1864a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson *
1874a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * Some ioctl's can be directly handled by lirc_dev if the driver's
1884a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * ioctl function is NULL or if it returns -ENOIOCTLCMD (see also
1894a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * lirc_serial.c).
1904a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson *
1914a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * owner:
1924a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * the module owning this struct
1934a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson *
1944a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson */
1954a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
1964a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
1974a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson/* following functions can be called ONLY from user context
1984a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson *
1994a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * returns negative value on error or minor number
2004a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * of the registered device if success
2014a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * contents of the structure pointed by p is copied
2024a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson */
2034a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilsonextern int lirc_register_driver(struct lirc_driver *d);
2044a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
2054a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson/* returns negative value on error or 0 if success
2064a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson*/
2074a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilsonextern int lirc_unregister_driver(int minor);
2084a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
2094a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson/* Returns the private data stored in the lirc_driver
2104a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * associated with the given device file pointer.
2114a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson */
2124a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilsonvoid *lirc_get_pdata(struct file *file);
2134a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
2144a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson/* default file operations
2154a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson * used by drivers if they override only some operations
2164a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson */
2174a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilsonint lirc_dev_fop_open(struct inode *inode, struct file *file);
2184a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilsonint lirc_dev_fop_close(struct inode *inode, struct file *file);
2194a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilsonunsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait);
220044e5878c2158d701e6f47a9604910589a384ee2Arnd Bergmannlong lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
2210e835087dfe7db19f1f072046f5e116d4ec6662bDan Carpenterssize_t lirc_dev_fop_read(struct file *file, char __user *buffer, size_t length,
2224a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson			  loff_t *ppos);
2230e835087dfe7db19f1f072046f5e116d4ec6662bDan Carpenterssize_t lirc_dev_fop_write(struct file *file, const char __user *buffer,
2240e835087dfe7db19f1f072046f5e116d4ec6662bDan Carpenter			   size_t length, loff_t *ppos);
2254a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson
2264a62a5ab59742331a4e17ccaa894968d40ed9b16Jarod Wilson#endif
227