[media] media: lirc_dev: make chunk_size and buffer_size mandatory

Make setting chunk_size and buffer_size mandatory for drivers which
expect lirc_dev to allocate the lirc_buffer (i.e. ir-lirc-codec) and
don't set them in lirc-zilog (which creates its own buffer).

Also remove an unnecessary copy of chunk_size in struct irctl (the
same information is already available from struct lirc_buffer).

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
David Härdeman
2017-06-25 09:31:45 -03:00
committed by Mauro Carvalho Chehab
parent 615cd3fe6c
commit b145ef94f6
3 changed files with 19 additions and 21 deletions

View File

@@ -121,13 +121,14 @@ static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf,
*
* @code_length: length of the remote control key code expressed in bits.
*
* @buffer_size: Number of FIFO buffers with @chunk_size size. If zero,
* creates a buffer with BUFLEN size (16 bytes).
*
* @features: lirc compatible hardware features, like LIRC_MODE_RAW,
* LIRC_CAN\_\*, as defined at include/media/lirc.h.
*
* @buffer_size: Number of FIFO buffers with @chunk_size size.
* Only used if @rbuf is NULL.
*
* @chunk_size: Size of each FIFO buffer.
* Only used if @rbuf is NULL.
*
* @data: it may point to any driver data and this pointer will
* be passed to all callback functions.
@@ -162,9 +163,9 @@ struct lirc_driver {
char name[40];
unsigned int minor;
__u32 code_length;
unsigned int buffer_size; /* in chunks holding one code each */
__u32 features;
unsigned int buffer_size; /* in chunks holding one code each */
unsigned int chunk_size;
void *data;