Commit graph

7 commits

Author SHA1 Message Date
Mauro Carvalho Chehab e27d38112e V4L/DVB (13612): IR: Move common IR code to drivers/media/IR
This is the first step of creating a common code for IR that can be
used by other input devices.

For now, keep IR dir at drivers/media, to easy the movement of the IR files,
but later patches may move it to drivers/IR or drivers/input/IR.

No functional changes is done on this patch.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16 00:18:42 -02:00
Mauro Carvalho Chehab 05395a3d86 V4L/DVB (13576): ir-common: fix an oops caused by the usage of an initialized drvdata
As reported by Sander Eikelenboom <linux@eikelemboon.it>:

> Tried to update my v4l-dvb modules today, but got a bug with my pinnacle
> card, seems to be related to the recent changes in the ir code.
>
> Dec  5 23:30:25 security kernel: [    5.735698] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
> Dec  5 23:30:25 security kernel: [    5.735716] IP: [<ffffffffa00997be>] :ir_common:ir_input_free+0x26/0x3e

Thanks-to: Sander Eikelenboom <linux@eikelemboon.it> for reporting and testing the fix.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16 00:18:09 -02:00
Mauro Carvalho Chehab e97f467796 V4L/DVB (13542): ir-keytable: Allow dynamic table change
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:42:23 -02:00
Mauro Carvalho Chehab 7fee03e487 V4L/DVB (13540): ir-common: Cleanup get key evdev code
The same loop to seek for a key were used on different places. Also,
no spinlock were protecting it to avoid the risk of replacing a keycode
while seeking for a new code.

This cleanup does:
	- create an unique function to seek for a code;
	- adds an spinlock to protect the table lookup;
	- remove some unused code;
	- simplifies to code to make it easier to understand.

Basically no change in behavior should be noticed after this patch.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:42:22 -02:00
Mauro Carvalho Chehab f6fc504940 V4L/DVB (13538): ir-common: Use a dynamic keycode table
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:42:21 -02:00
Mauro Carvalho Chehab 8573b74af2 V4L/DVB (13533): ir: use dynamic tables, instead of static ones
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:42:19 -02:00
Mauro Carvalho Chehab ef53a1159d V4L/DVB (13532): ir-common: Add infrastructure to use a dynamic keycode table
V4L drivers use an static keycode vector with 128 entries, where the scancode
indexes the keycode. While this works, it limits the scancodes to have only
7 bits, not allowing for example full RC5 codes.

Instead of implementing the same code on every V4L driver, provide a common
infrastructure to handle the bigger tables, minimizing the changes inside
each driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:42:19 -02:00