Re: [PATCH 07/19] lirc_dev: remove kmalloc in lirc_dev_fop_read()

2017-10-09 Thread David Härdeman
October 4, 2017 6:57 PM, "Mauro Carvalho Chehab" <mche...@s-opensource.com> wrote: > Em Sun, 25 Jun 2017 14:31:50 +0200 > David Härdeman <da...@hardeman.nu> escreveu: > >> lirc_zilog uses a chunk_size of 2 and ir-lirc-codec uses sizeof(int). >&g

Re: [PATCH 2/2] rc-main: remove input events for repeat messages

2017-07-04 Thread David Härdeman
On Sat, Jul 01, 2017 at 01:20:50PM +0100, Sean Young wrote: >On Thu, Jun 22, 2017 at 09:24:00PM +0200, David Härdeman wrote: >> Protocols like NEC generate around 10 repeat events per second. >> >> The input events are not very useful for userspace but still waste power

[PATCH] lirc_dev: sanitize locking (v2)

2017-06-30 Thread David Härdeman
renames the mutex at the same time (the name irctl_lock will be misleading once struct irctl goes away in later patches). V2: make sure ir->d.minor is set as well once allocated (found by Fengguang Wu <fengguang...@intel.com>) Signed-off-by: David Härdeman <da...@hardeman.nu> --- d

[PATCH 18/19] ir-lirc-codec: move the remaining fops over from lirc_dev

2017-06-25 Thread David Härdeman
ir-lirc-codec is the only user of these functions, so instead of exporting them from lirc_dev, move all of them over to ir-lirc-codec. This means that all ir-lirc-codec fops can be found next to each other in ir-lirc-codec. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/me

[PATCH 19/19] lirc_dev: consistent device registration printk

2017-06-25 Thread David Härdeman
: driver ir-lirc-codec (rc-loopback) registered at minor = 0 After: rc rc0: rc-core loopback device as /devices/virtual/rc/rc0 input: rc-core loopback device as /devices/virtual/rc/rc0/input23 lirc lirc0: rc-core loopback device as /devices/virtual/rc/rc0/lirc0 Signed-off-by: David Härdeman

[PATCH 17/19] ir-lirc-codec: merge lirc_dev_fop_ioctl into ir_lirc_ioctl

2017-06-25 Thread David Härdeman
ir_lirc_ioctl() is the only caller of lirc_dev_fop_ioctl() so merging the latter into the former makes the code more readable. At the same time, this allows the locking situation in ir_lirc_ioctl() to be fixed by holding the lirc_dev mutex during the whole ioctl call. Signed-off-by: David

[PATCH 16/19] lirc_dev: merge struct irctl into struct lirc_dev

2017-06-25 Thread David Härdeman
the lifetime of the resulting struct and simplifies the code at the same time. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/ir-lirc-codec.c| 15 +- drivers/media/rc/lirc_dev.c | 288 +-- drivers/staging/medi

[PATCH 15/19] lirc_zilog: use a dynamically allocated lirc_dev

2017-06-25 Thread David Härdeman
struct lirc_dev. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/staging/media/lirc/lirc_zilog.c | 69 ++- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/drivers/staging/media/lirc/lirc_zilog.c b/drivers/staging/media/lirc/lirc_z

[PATCH 12/19] lirc_dev: introduce lirc_allocate_device and lirc_free_device

2017-06-25 Thread David Härdeman
simplistic at this point, later patches will put more flesh on the bones of both. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/ir-lirc-codec.c |2 +- drivers/media/rc/lirc_dev.c | 13 + include/media/lirc_dev.h |9 - 3 files c

[PATCH 14/19] lirc_zilog: add a pointer to the parent device to struct IR

2017-06-25 Thread David Härdeman
lirc_zilog stashes a pointer to the parent device in struct lirc_dev and uses it for logging. It makes more sense to let lirc_zilog keep track of that pointer in its own struct (this is in preparation for subsequent patches which will remodel struct lirc_dev). Signed-off-by: David Härdeman <

[PATCH 13/19] lirc_dev: remove the BUFLEN define

2017-06-25 Thread David Härdeman
The define is only used in the lirc_zilog driver and once in lirc_dev. In lirc_dev it rather serves to make the limits on d->code_length less clear, so move the define to lirc_zilog. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c

[PATCH 10/19] lirc_dev: use an IDA instead of an array to keep track of registered devices

2017-06-25 Thread David Härdeman
Using the kernel-provided IDA simplifies the code and makes it possible to remove the lirc_dev_lock mutex. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c | 36 include/media/lirc_dev.h|1 - 2 files chang

[PATCH 11/19] lirc_dev: rename struct lirc_driver to struct lirc_dev

2017-06-25 Thread David Härdeman
This is in preparation for the later patches which do away with struct irctl entirely. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/ir-lirc-codec.c| 50 --- drivers/media/rc/lirc_dev.c | 12 --- drivers/media

[PATCH 09/19] lirc_dev: sanitize locking

2017-06-25 Thread David Härdeman
renames the mutex at the same time (the name irctl_lock will be misleading once struct irctl goes away in later patches). Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c | 164 --- 1 file changed, 91 insertions(+), 73 del

[PATCH 08/19] lirc_dev: change irctl->attached to be a boolean

2017-06-25 Thread David Härdeman
The "attached" member of struct irctl is a boolean value, so let the code reflect that. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/

[PATCH 05/19] lirc_dev: make better use of file->private_data

2017-06-25 Thread David Härdeman
t very elegant, but it's a stopgap measure which can be removed once lirc_zilog is converted to rc-core. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c | 70 +-- drivers/staging/media/lirc/lirc_zi

[PATCH 04/19] lirc_dev: use cdev_device_add() helper function

2017-06-25 Thread David Härdeman
Replace calls to cdev_add() and device_add() with the cdev_device_add() helper function. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/media/rc/lirc_d

[PATCH 06/19] lirc_dev: make chunk_size and buffer_size mandatory

2017-06-25 Thread David Härdeman
available from struct lirc_buffer). Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c | 26 +- drivers/staging/media/lirc/lirc_zilog.c |5 + include/media/lirc_dev.h|9 + 3 files chang

[PATCH 07/19] lirc_dev: remove kmalloc in lirc_dev_fop_read()

2017-06-25 Thread David Härdeman
lirc_zilog uses a chunk_size of 2 and ir-lirc-codec uses sizeof(int). Therefore, using stack memory should be perfectly fine. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c |8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/d

[PATCH 01/19] lirc_dev: clarify error handling

2017-06-25 Thread David Härdeman
If an error is generated, it is more logical to error out ASAP. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c

[PATCH 03/19] lirc_dev: remove min_timeout and max_timeout

2017-06-25 Thread David Härdeman
There are no users of this functionality (ir-lirc-codec.c has its own implementation and lirc_zilog.c doesn't use it) so remove it. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c | 18 -- include/media/lirc_dev.h|8 2

[PATCH 02/19] lirc_dev: remove support for manually specifying minor number

2017-06-25 Thread David Härdeman
All users of lirc_register_driver() uses dynamic minor allocation, therefore we can remove the ability to explicitly request a given number. This changes the function prototype of lirc_unregister_driver() to also take a struct lirc_driver pointer as the sole argument. Signed-off-by: David

[PATCH 00/19] lirc_dev modernisation

2017-06-25 Thread David Härdeman
. The locking in lirc_dev is also much improved by only having one mutex per struct lirc_dev which is used to synchronize all operations. The modifications to lirc_dev and ir-lirc-codec have been tested using rc-loopback and mceusb. The changes to lirc_zilog are only compile tested. --- David Härdeman (19

[PATCH 2/2] rc-main: remove input events for repeat messages

2017-06-22 Thread David Härdeman
Protocols like NEC generate around 10 repeat events per second. The input events are not very useful for userspace but still waste power by waking up every listener. So let's remove them (MSC_SCAN events are still generated for the initial keypress). Signed-off-by: David Härdeman <

[PATCH 0/2] rc-core: consistent rc_repeat() usage

2017-06-22 Thread David Härdeman
the keydown check into rc_repeat() where the proper locking is done. The second patch I'd consider optional, it removes the input events for repeat messages which I consider to be rather pointless. --- David Härdeman (2): rc-core: consistent use of rc_repeat() rc-main: remove input

[PATCH 1/2] rc-core: consistent use of rc_repeat()

2017-06-22 Thread David Härdeman
/Sanyo and modifying the check a bit in rc_repeat() so that no input event is generated if the key isn't pressed. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/ir-nec-decoder.c | 10 +++--- drivers/media/rc/ir-sanyo-decoder.c | 10 +++--- drivers/media/

Re: [PATCH 6/6] rc-core: add protocol to EVIOC[GS]KEYCODE_V2 ioctl

2017-06-17 Thread David Härdeman
On Sun, Jun 11, 2017 at 05:17:40PM +0100, Sean Young wrote: >On Sat, Apr 29, 2017 at 10:44:58AM +0200, David Härdeman wrote: >> >This can be implemented without breaking userspace. >> >> How? > >The current keymaps we have do not specify the protocol variant, only

Re: [PATCH 03/16] lirc_dev: correct error handling

2017-06-17 Thread David Härdeman
On Sun, May 28, 2017 at 04:04:30PM +0100, Sean Young wrote: >On Sun, May 28, 2017 at 10:23:37AM +0200, David Härdeman wrote: >> On Sun, May 21, 2017 at 09:57:13AM +0100, Sean Young wrote: >> >On Mon, May 01, 2017 at 06:03:51PM +0200, David Härdeman wrote: >> >

Re: [PATCH 3/7] rc-core: img-nec-decoder - leave the internals of rc_dev alone

2017-06-17 Thread David Härdeman
On Sun, Jun 11, 2017 at 05:02:24PM +0100, Sean Young wrote: >On Sun, May 28, 2017 at 10:28:44AM +0200, David Härdeman wrote: >> On Mon, May 22, 2017 at 09:40:30PM +0100, Sean Young wrote: >> >On Mon, May 01, 2017 at 06:10:06PM +0200, David Härdeman wrote: >> >> Obvi

Re: [PATCH 5/7] rc-core: ir-raw - leave the internals of rc_dev alone

2017-05-28 Thread David Härdeman
On Tue, May 23, 2017 at 10:20:27AM +0100, Sean Young wrote: >On Mon, May 01, 2017 at 06:10:17PM +0200, David Härdeman wrote: >> Replace the REP_DELAY value with a static value, which makes more sense. >> Automatic repeat handling in the input layer has no relevance for the

Re: [PATCH 3/7] rc-core: img-nec-decoder - leave the internals of rc_dev alone

2017-05-28 Thread David Härdeman
On Mon, May 22, 2017 at 09:40:30PM +0100, Sean Young wrote: >On Mon, May 01, 2017 at 06:10:06PM +0200, David Härdeman wrote: >> Obvious fix, leave repeat handling to rc-core >> >> Signed-off-by: David Härdeman <da...@hardeman.nu> >> --- >> d

Re: [PATCH 13/16] lirc_dev: use an ida instead of a hand-rolled array to keep track of minors

2017-05-28 Thread David Härdeman
On Mon, May 22, 2017 at 09:09:42PM +0100, Sean Young wrote: >On Mon, May 01, 2017 at 06:04:42PM +0200, David Härdeman wrote: >> Using the kernel ida facilities, we can avoid a lot of unnecessary code and >> at the same >> time get rid of lirc_dev_lock in favour of per-dev

Re: [PATCH 03/16] lirc_dev: correct error handling

2017-05-28 Thread David Härdeman
On Sun, May 21, 2017 at 09:57:13AM +0100, Sean Young wrote: >On Mon, May 01, 2017 at 06:03:51PM +0200, David Härdeman wrote: >> If an error is generated, nonseekable_open() shouldn't be called. > >There is no harm in calling nonseekable_open(), so this commit is >misleading. I'

Re: [PATCH 14/16] lirc_dev: cleanup includes

2017-05-21 Thread David Härdeman
On Fri, May 19, 2017 at 07:21:23PM +0100, Sean Young wrote: >On Mon, May 01, 2017 at 06:04:47PM +0200, David Härdeman wrote: >> Remove superfluous includes and defines. >> >> Signed-off-by: David Härdeman <da...@hardeman.nu> >> --- >> drivers/media/rc/li

Re: [PATCH] rc-core: cleanup rc_register_device (v2)

2017-05-21 Thread David Härdeman
On Sat, May 20, 2017 at 12:10:40PM +0100, Sean Young wrote: >On Wed, May 03, 2017 at 12:04:00PM +0200, David Härdeman wrote: >> The device core infrastructure is based on the presumption that >> once a driver calls device_add(), it must be ready to accept >>

Re: [PATCH] rc-core: cleanup rc_register_device (v2)

2017-05-18 Thread David Härdeman
On Wed, May 17, 2017 at 09:09:57PM +0100, Sean Young wrote: >Hi David, > >On Wed, May 03, 2017 at 12:04:00PM +0200, David Härdeman wrote: >> The device core infrastructure is based on the presumption that >> once a driver calls device_add(), it must be ready to accept >

[PATCH] rc-core: cleanup rc_register_device (v2)

2017-05-03 Thread David Härdeman
before calling device_add(). Version 2: switch the order in which rc_prepare_rx_device() and ir_raw_event_prepare() gets called so that dev->change_protocol() gets called before device_add(). Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/rc-core-priv.h |2 +

Re: [PATCH 2/6] rc-core: cleanup rc_register_device

2017-05-03 Thread David Härdeman
On Tue, May 02, 2017 at 09:48:26PM +0100, Sean Young wrote: >On Tue, May 02, 2017 at 08:53:02PM +0200, David Härdeman wrote: >> On Mon, May 01, 2017 at 07:47:25PM +0200, David Härdeman wrote: >> >On Mon, May 01, 2017 at 05:49:53PM +0100, Sean Young wrote: >> >>On T

Re: [PATCH 2/6] rc-core: cleanup rc_register_device

2017-05-02 Thread David Härdeman
On Mon, May 01, 2017 at 07:47:25PM +0200, David Härdeman wrote: >On Mon, May 01, 2017 at 05:49:53PM +0100, Sean Young wrote: >>On Thu, Apr 27, 2017 at 10:34:03PM +0200, David Härdeman wrote: >>> The device core infrastructure is based on the presumption that >>> onc

Re: [PATCH 15/16] lirc_dev: remove name from struct lirc_driver

2017-05-02 Thread David Härdeman
On Tue, May 02, 2017 at 06:04:18PM +0100, Sean Young wrote: >On Mon, May 01, 2017 at 06:04:52PM +0200, David Härdeman wrote: >> The name is only used for a few debug messages and the name of the parent >> device as well as the name of the lirc device (e.g. "lirc0")

Re: [PATCH 2/6] rc-core: cleanup rc_register_device

2017-05-01 Thread David Härdeman
On Mon, May 01, 2017 at 05:49:53PM +0100, Sean Young wrote: >On Thu, Apr 27, 2017 at 10:34:03PM +0200, David Härdeman wrote: >> The device core infrastructure is based on the presumption that >> once a driver calls device_add(), it must be ready to accept >>

[PATCH 6/7] rc-core: cx231xx - leave the internals of rc_dev alone

2017-05-01 Thread David Härdeman
Just some debug statements to change. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/usb/cx231xx/cx231xx-input.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-input.c b/drivers/media/usb/cx231xx/cx231xx-i

[PATCH 7/7] rc-core: tm6000 - leave the internals of rc_dev alone

2017-05-01 Thread David Härdeman
Not sure what the driver is trying to do, however, IR handling seems incomplete ATM so deleting the offending parts shouldn't affect functionality Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/usb/tm6000/tm6000-input.c |4 1 file changed, 4 deletions(-) diff

[PATCH 3/7] rc-core: img-nec-decoder - leave the internals of rc_dev alone

2017-05-01 Thread David Härdeman
Obvious fix, leave repeat handling to rc-core Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/ir-nec-decoder.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/media/rc/ir-nec-decoder.c b/drivers/media/rc/ir-nec-decoder.c

[PATCH 5/7] rc-core: ir-raw - leave the internals of rc_dev alone

2017-05-01 Thread David Härdeman
Replace the REP_DELAY value with a static value, which makes more sense. Automatic repeat handling in the input layer has no relevance for the drivers idea of "a long time". Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/rc-ir-raw.c |4 +--- 1

[PATCH 2/7] rc-core: img-ir - leave the internals of rc_dev alone

2017-05-01 Thread David Härdeman
Changing the protocol does not imply that the keymap changes. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/img-ir/img-ir-hw.c |4 1 file changed, 4 deletions(-) diff --git a/drivers/media/rc/img-ir/img-ir-hw.c b/drivers/media/rc/img-ir/img-ir-hw.c

[PATCH 0/7] rc: don't poke around in rc_dev internals

2017-05-01 Thread David Härdeman
The following patch series fixes up various drivers which go poking around in struct rc_dev for no good reason. --- David Härdeman (7): rc-core: ati_remote - leave the internals of rc_dev alone rc-core: img-ir - leave the internals of rc_dev alone rc-core: img-nec-decoder

[PATCH 1/7] rc-core: ati_remote - leave the internals of rc_dev alone

2017-05-01 Thread David Härdeman
The REP_DELAY setting on the input device is independent of hardware. This change should not change how to driver works (as it does a keydown/keyup and has no real repeat handling). Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/ati_remote.c |3 --- 1 file chan

[PATCH 4/7] rc-core: sanyo - leave the internals of rc_dev alone

2017-05-01 Thread David Härdeman
Leave repeat handling to rc-core. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/ir-sanyo-decoder.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/media/rc/ir-sanyo-decoder.c b/drivers/media/rc/ir-sanyo-decoder.c

[PATCH 12/16] lirc_dev: return POLLHUP and POLLERR when device is gone

2017-05-01 Thread David Härdeman
Most drivers return both values when the device is gone. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index 57d212

[PATCH 14/16] lirc_dev: cleanup includes

2017-05-01 Thread David Härdeman
Remove superfluous includes and defines. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index 7db7d4c57991..4ba6c7

[PATCH 16/16] lirc_dev: cleanup header

2017-05-01 Thread David Härdeman
Remove some stuff from lirc_dev.h which is not used anywhere. Signed-off-by: David Härdeman <da...@hardeman.nu> --- include/media/lirc_dev.h | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h index 11f455

[PATCH 15/16] lirc_dev: remove name from struct lirc_driver

2017-05-01 Thread David Härdeman
The name is only used for a few debug messages and the name of the parent device as well as the name of the lirc device (e.g. "lirc0") are sufficient anyway. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/ir-lirc-codec.c|2 -- drivers/med

[PATCH 13/16] lirc_dev: use an ida instead of a hand-rolled array to keep track of minors

2017-05-01 Thread David Härdeman
Using the kernel ida facilities, we can avoid a lot of unnecessary code and at the same time get rid of lirc_dev_lock in favour of per-device locks (the irctls array was used throughout lirc_dev so this patch necessarily touches a lot of code). Signed-off-by: David Härdeman <da...@hardeman

[PATCH 11/16] lirc_dev: remove unused module parameter

2017-05-01 Thread David Härdeman
The "debug" parameter isn't actually used anywhere. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c |5 - 1 file changed, 5 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index 34bd3f8bf30d..57d

[PATCH 10/16] lirc_dev: remove superfluous get/put_device() calls

2017-05-01 Thread David Härdeman
device_add() and friends alredy manage the references to the parent device so these calls aren't necessary. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c |4 1 file changed, 4 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/me

[PATCH 08/16] lirc_zilog: remove module parameter minor

2017-05-01 Thread David Härdeman
Remove the "minor" module parameter in preparation for the next patch. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/staging/media/lirc/lirc_zilog.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/staging/media/lirc

[PATCH 09/16] lirc_dev: remove lirc_irctl_init() and lirc_cdev_add()

2017-05-01 Thread David Härdeman
These two functions only make the logic in lirc_register_driver() harder to follow. (Note that almost no other driver calls kobject_set_name() on their cdev so I simply removed that part). Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c

[PATCH 07/16] lirc_dev: merge lirc_register_driver() and lirc_allocate_driver()

2017-05-01 Thread David Härdeman
Merging the two means that lirc_allocate_buffer() is called before device_add() and cdev_add() which makes more sense. This also simplifies the locking slightly because lirc_allocate_buffer() will always be called with lirc_dev_lock held. Signed-off-by: David Härdeman <da...@hardeman

[PATCH 06/16] lirc_dev: make fops mandatory

2017-05-01 Thread David Härdeman
Every caller of lirc_register_driver() passes their own fops and there are no users of lirc_dev_fop_write() in the kernel tree. Thus we can make fops mandatory and remove lirc_dev_fop_write(). Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c

[PATCH 05/16] lirc_dev: clarify error handling

2017-05-01 Thread David Härdeman
out_sysfs is misleading, sysfs only comes into play after device_add(). Also, calling device_init() before the rest of struct dev is filled out is clearer. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c |6 +++--- 1 file changed, 3 insertions

[PATCH 04/16] lirc_dev: remove sampling kthread

2017-05-01 Thread David Härdeman
There are no drivers which use this functionality. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c | 94 +-- drivers/staging/media/lirc/lirc_zilog.c |1 include/media/lirc_dev.h| 16 - 3

[PATCH 02/16] lirc_dev: remove unused set_use_inc/set_use_dec

2017-05-01 Thread David Härdeman
Since there are no users of this functionality, it can be removed altogether. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/ir-lirc-codec.c |2 -- drivers/media/rc/lirc_dev.c | 24 ++-- include/media/lirc_dev.h |6 ---

[PATCH 01/16] lirc_dev: remove pointless functions

2017-05-01 Thread David Härdeman
drv->set_use_inc and drv->set_use_dec are already optional so we can remove all dummy functions. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/ir-lirc-codec.c| 14 ++ drivers/staging/media/lirc/lirc_zilog.c | 11 --- 2 file

[PATCH 00/16] lirc_dev spring cleaning

2017-05-01 Thread David Härdeman
locks. I think this is about as much as can be done right now before lirc_zilog is either removed or ported to rc-core. --- David Härdeman (16): lirc_dev: remove pointless functions lirc_dev: remove unused set_use_inc/set_use_dec lirc_dev: correct error handling lirc_dev

[PATCH 03/16] lirc_dev: correct error handling

2017-05-01 Thread David Härdeman
If an error is generated, nonseekable_open() shouldn't be called. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/lirc_dev.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c

[PATCH] ir-lirc-codec: let lirc_dev handle the lirc_buffer (v3)

2017-05-01 Thread David Härdeman
ted buffer is communicated back to ir-lirc-codec so that ir_lirc_decode() can use it. Version 3: set chunk_size and buffer_size in ir-lirc-codec. CC: sta...@vger.kernel.org Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/ir-lirc-codec.c | 25 +++--

Re: [PATCH] ir-lirc-codec: let lirc_dev handle the lirc_buffer (v2)

2017-05-01 Thread David Härdeman
On Mon, May 01, 2017 at 01:22:21PM +0100, Sean Young wrote: >On Sat, Apr 29, 2017 at 11:22:28PM +0200, David Härdeman wrote: >> ir_lirc_register() currently creates its own lirc_buffer before >> passing the lirc_driver to lirc_register_driver(). >> >> When

Re: [PATCH] [RFC] rc-core: report protocol information to userspace

2017-05-01 Thread David Härdeman
On Mon, May 01, 2017 at 11:38:30AM +0100, Sean Young wrote: >On Sat, Apr 29, 2017 at 12:52:12PM +0200, David Härdeman wrote: >> Whether we decide to go for any new keytable ioctl():s or not in rc-core, we >> should provide the protocol information of keypresses to userspa

Re: [PATCH] rc-core: export the hardware type to sysfs

2017-05-01 Thread David Härdeman
On Mon, May 01, 2017 at 11:36:13AM +0100, Sean Young wrote: >On Sat, Apr 29, 2017 at 12:03:29PM +0200, David Härdeman wrote: >> Exporting the hardware type makes it possible for userspace applications >> to know what to expect from the hardware. >> >> This makes it

[PATCH] ir-lirc-codec: let lirc_dev handle the lirc_buffer (v2)

2017-04-29 Thread David Härdeman
ted buffer is communicated back to ir-lirc-codec so that ir_lirc_decode() can use it. CC: sta...@vger.kernel.org Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/ir-lirc-codec.c | 23 +-- drivers/media/rc/lirc_dev.c | 13 - 2 f

Re: [PATCH] ir-lirc-codec: let lirc_dev handle the lirc_buffer

2017-04-29 Thread David Härdeman
On Fri, Apr 28, 2017 at 07:04:09PM +0200, David Härdeman wrote: >ir_lirc_register() currently creates its own lirc_buffer before >passing the lirc_driver to lirc_register_driver(). > >When a module is later unloaded, ir_lirc_unregister() gets called >which performs a call to lirc_un

[PATCH] [RFC] rc-core: report protocol information to userspace

2017-04-29 Thread David Härdeman
Whether we decide to go for any new keytable ioctl():s or not in rc-core, we should provide the protocol information of keypresses to userspace. Note that this means that the RC_TYPE_* definitions become part of the userspace <-> kernel API/ABI (meaning a full patch should maybe move those

[PATCH] rc-core: export the hardware type to sysfs

2017-04-29 Thread David Härdeman
enough for one more group. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/rc-main.c | 43 +++ 1 file changed, 43 insertions(+) diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index 85f95441b85b..e0f9b3

Re: [PATCH 6/6] rc-core: add protocol to EVIOC[GS]KEYCODE_V2 ioctl

2017-04-29 Thread David Härdeman
On Fri, Apr 28, 2017 at 08:42:13PM +0100, Sean Young wrote: >On Fri, Apr 28, 2017 at 06:59:11PM +0200, David Härdeman wrote: >> On Fri, Apr 28, 2017 at 08:31:33AM -0300, Mauro Carvalho Chehab wrote: >> >Em Thu, 27 Apr 2017 22:34:23 +0200 >> >David Härdeman &

Re: [PATCH] ir-lirc-codec: let lirc_dev handle the lirc_buffer

2017-04-28 Thread David Härdeman
On Fri, Apr 28, 2017 at 07:04:09PM +0200, David Härdeman wrote: >ir_lirc_register() currently creates its own lirc_buffer before >passing the lirc_driver to lirc_register_driver(). > >When a module is later unloaded, ir_lirc_unregister() gets called >which performs a call to lirc_un

[PATCH] ir-lirc-codec: let lirc_dev handle the lirc_buffer

2017-04-28 Thread David Härdeman
ch creates its own lirc_buffer is quite likely to be buggy as well, but that seems to only concern staging. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/ir-lirc-codec.c | 23 +-- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/dri

[PATCH] rc-core: add protocol to EVIOC[GS]KEYCODE_V2 ioctl (alternative approach)

2017-04-28 Thread David Härdeman
y which might need to change is ir-keytable. Userspace programs which simply consume input events (i.e. the vast majority) won't have to change. I haven't tested the patch yet, consider it a basis for discussion. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/ati_re

Re: [PATCH 6/6] rc-core: add protocol to EVIOC[GS]KEYCODE_V2 ioctl

2017-04-28 Thread David Härdeman
On Fri, Apr 28, 2017 at 08:31:33AM -0300, Mauro Carvalho Chehab wrote: >Em Thu, 27 Apr 2017 22:34:23 +0200 >David Härdeman <da...@hardeman.nu> escreveu: ... >> This patch changes how the "input_keymap_entry" struct is interpreted >> by rc-core by casting it t

Re: [PATCH 6/6] rc-core: add protocol to EVIOC[GS]KEYCODE_V2 ioctl

2017-04-28 Thread David Härdeman
On Fri, Apr 28, 2017 at 12:40:53PM +0100, Sean Young wrote: >On Thu, Apr 27, 2017 at 10:34:23PM +0200, David Härdeman wrote: ... >> This patch changes how the "input_keymap_entry" struct is interpreted >> by rc-core by casting it to "rc_keymap_entry": >&g

Re: [PATCH 5/6] rc-core: use the full 32 bits for NEC scancodes

2017-04-28 Thread David Härdeman
On Fri, Apr 28, 2017 at 12:58:32PM +0100, Sean Young wrote: >On Thu, Apr 27, 2017 at 10:34:18PM +0200, David Härdeman wrote: >> Using the full 32 bits for all kinds of NEC scancodes simplifies rc-core >> and the nec decoder without any loss of functionality. At the same tim

[PATCH 6/6] rc-core: add protocol to EVIOC[GS]KEYCODE_V2 ioctl

2017-04-27 Thread David Härdeman
es. However, that is somewhat mitigated by the fact that the "only" userspace binary which might need to change is ir-keytable. Userspace programs which simply consume input events (i.e. the vast majority) won't have to change. Signed-off-by: David Härdeman <da...@hardeman.nu> --- driver

[PATCH 4/6] rc-core: use the full 32 bits for NEC scancodes in wakefilters

2017-04-27 Thread David Härdeman
preparation for the next patch which moves the rest of rc-core over to only using NEC32. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/rc-main.c | 17 - drivers/media/rc/winbond-cir.c | 32 ++-- 2 files chan

[PATCH 5/6] rc-core: use the full 32 bits for NEC scancodes

2017-04-27 Thread David Härdeman
). Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/pci/cx88/cx88-input.c |4 + drivers/media/pci/saa7134/saa7134-input.c |4 + drivers/media/rc/igorplugusb.c|4 + drivers/media/rc/img-ir/img-ir-nec.c

[PATCH 0/6] rc-core - protocol in keytables

2017-04-27 Thread David Härdeman
to skip the introduction part :) --- David Härdeman (6): rc-core: fix input repeat handling rc-core: cleanup rc_register_device rc-core: cleanup rc_register_device pt2 rc-core: use the full 32 bits for NEC scancodes in wakefilters rc-core: use the full 32 bits for NEC

[PATCH 1/6] rc-core: fix input repeat handling

2017-04-27 Thread David Härdeman
The call to input_register_device() needs to take place before the repeat parameters are set or the input subsystem repeat handling will be disabled (as was already noted in the comments in that function). Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/rc-main.c

[PATCH 3/6] rc-core: cleanup rc_register_device pt2

2017-04-27 Thread David Härdeman
iner_of give a NULL value???). Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/rc-main.c | 67 +++- include/media/rc-core.h|2 - 2 files changed, 10 insertions(+), 59 deletions(-) diff --git a/drivers/media/rc/rc-mai

[PATCH 2/6] rc-core: cleanup rc_register_device

2017-04-27 Thread David Härdeman
before calling device_add(). Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/rc-core-priv.h |2 + drivers/media/rc/rc-ir-raw.c| 34 -- drivers/media/rc/rc-main.c | 75 +-- 3 files changed, 73 inse

Re: [PATCH] rc-core: use the full 32 bits for NEC scancodes

2017-04-25 Thread David Härdeman
April 24, 2017 5:58 PM, "Sean Young" <s...@mess.org> wrote: > On Tue, Apr 18, 2017 at 05:50:27PM +0200, David Härdeman wrote: >> Using the full 32 bits for all kinds of NEC scancodes simplifies rc-core >> and the nec decoder without any loss of functionality.

Re: [PATCH] rc-core: use the full 32 bits for NEC scancodes in wakefilters

2017-04-25 Thread David Härdeman
April 24, 2017 6:02 PM, "Sean Young" <s...@mess.org> wrote: > On Tue, Apr 18, 2017 at 10:31:04PM +0200, David Härdeman wrote: > >> The new sysfs wakefilter API will expose the difference between the NEC >> protocols to userspace for no good reason and onc

[PATCH] rc-core: use the full 32 bits for NEC scancodes in wakefilters

2017-04-18 Thread David Härdeman
. This is the minimalistic version of the full NEC32 patch posted here: http://www.spinics.net/lists/linux-media/msg114603.html Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/rc-main.c | 17 - drivers/media/rc/winbond-cir.c | 32 ++-- 2

[PATCH] rc-core: use the full 32 bits for NEC scancodes

2017-04-18 Thread David Härdeman
to change the logic. Signed-off-by: David Härdeman <da...@hardeman.nu> --- drivers/media/rc/igorplugusb.c |4 + drivers/media/rc/img-ir/img-ir-nec.c | 92 +++--- drivers/media/rc/ir-nec-decoder.c| 63 --- drivers/media/rc/rc-

Re: [PATCH v2 5/7] [media] ir-lirc-codec: don't wait any transmitting time for tx only devices

2016-10-31 Thread David Härdeman
October 27, 2016 4:36 PM, "Sean Young" wrote: > Since we have to be able to switch between waiting and not waiting, > we need some sort of ABI for this. I think this warrants a new ioctl; > I'm not sure how else it can be done. I'll be sending out a patch > shortly. Hi Sean, have

Re: [media] winbond-cir: Move assignments for three variables in wbcir_shutdown()

2016-10-19 Thread David Härdeman
October 19, 2016 3:38 PM, "SF Markus Elfring" wrote: >>> Move the setting for the local variables "mask", "match" and "rc6_csl" >>> behind the source code for a condition check by this function >>> at the beginning. >> >> Again, I can't see what the point is? > >

Re: [PATCH 2/5] [media] winbond-cir: Move a variable assignment in wbcir_tx()

2016-10-19 Thread David Härdeman
October 14, 2016 1:42 PM, "SF Markus Elfring" wrote: > From: Markus Elfring > Date: Fri, 14 Oct 2016 07:34:46 +0200 > > Move the assignment for the local variable "data" behind the source code > for a memory allocation by this

Re: [PATCH 1/5] [media] winbond-cir: Use kmalloc_array() in wbcir_tx()

2016-10-19 Thread David Härdeman
ndicated that an array data structure should be processed. > Thus use the corresponding function "kmalloc_array". > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring <elfr...@users.sourceforge.net> Sure...why not... Signed-o

Re: [PATCH 5/5] [media] winbond-cir: Move a variable assignment in two functions

2016-10-19 Thread David Härdeman
October 14, 2016 1:45 PM, "SF Markus Elfring" wrote: > From: Markus Elfring > Date: Fri, 14 Oct 2016 13:13:11 +0200 > > Move the assignment for the local variable "data" behind the source code > for condition checks by these

Re: [PATCH 4/5] [media] winbond-cir: One variable and its check less in wbcir_shutdown() after error detection

2016-10-19 Thread David Härdeman
October 15, 2016 3:30 PM, "Sean Young" wrote: > On Fri, Oct 14, 2016 at 01:44:02PM +0200, SF Markus Elfring wrote: > >> From: Markus Elfring >> Date: Fri, 14 Oct 2016 12:48:41 +0200 >> >> The local variable "do_wake" was set to "false" after an

Re: [PATCH 4/5] [media] winbond-cir: One variable and its check less in wbcir_shutdown() after error detection

2016-10-19 Thread David Härdeman
October 15, 2016 6:42 PM, "SF Markus Elfring" wrote: >>> + /* Set CEIR_EN */ >>> + wbcir_set_bits(data->wbase + WBCIR_REG_WCEIR_CTL, 0x01, 0x01); >>> +set_irqmask: >>> /* >>> * ACPI will set the HW disable bit for SP3 which means that the >>> * output signals are

Re: [PATCH 3/5] [media] winbond-cir: Move assignments for three variables in wbcir_shutdown()

2016-10-19 Thread David Härdeman
October 14, 2016 1:43 PM, "SF Markus Elfring" wrote: > From: Markus Elfring > Date: Fri, 14 Oct 2016 10:40:12 +0200 > > Move the setting for the local variables "mask", "match" and "rc6_csl" > behind the source code for a condition

  1   2   3   4   5   6   >