Commit Graph

84980 Commits

Author SHA1 Message Date
istvan_v@mailbox.hu
6e1f4df7da V4L/DVB: cx88: fix checks for analog TV inputs
The following patch fixes code that checks for CX88_VMUX_TELEVISION,
but not CX88_VMUX_CABLE. This prevented for example the audio standard
from being set when using the cable input.

Signed-off-by: Istvan Varga <istvanv@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:21 -03:00
Christoph Fritz
10f1a6e8ed V4L/DVB: pwc Kconfig dependency fix
makes USB_PWC_INPUT_EVDEV to depend also on USB_PWC

Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:20 -03:00
Bjørn Mork
dd0bbcc626 V4L/DVB: budget: Oops: "BUG: unable to handle kernel NULL pointer dereference"
Never call dvb_frontend_detach if we failed to attach a frontend. This fixes
the following oops:

[    8.172997] DVB: registering new adapter (TT-Budget S2-1600 PCI)
[    8.209018] adapter has MAC addr = 00:d0:5c:cc:a7:29
[    8.328665] Intel ICH 0000:00:1f.5: PCI INT B -> GSI 17 (level, low) -> IRQ 17
[    8.328753] Intel ICH 0000:00:1f.5: setting latency timer to 64
[    8.562047] DVB: Unable to find symbol stv090x_attach()
[    8.562117] BUG: unable to handle kernel NULL pointer dereference at 000000ac
[    8.562239] IP: [<e08b04a3>] dvb_frontend_detach+0x4/0x67 [dvb_core]

Ref http://bugs.debian.org/575207

Also clean up if we are unable to register the tuner and LNB drivers

[mchehab@redhat.com: add printk log level, to calm down chechpatch.pl]
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Reported-by: Fladischer Michael <FladischerMichael@fladi.at>
Acked-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:17 -03:00
David Härdeman
784a493168 V4L/DVB: Add RC6 support to ir-core
This patch adds an RC6 decoder (modes 0 and 6A) to ir-core.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:17 -03:00
David Härdeman
25bb10c11e V4L/DVB: Add NECx support to ir-core
This patch adds NECx support to drivers/media/IR/ir-nec-decoder.c

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:16 -03:00
David Härdeman
733419b5c4 V4L/DVB: Add RC5x support to ir-core
This patch adds RC5x support to drivers/media/IR/ir-rc5-decoder.c

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:15 -03:00
Nicolas Noirbent
450df22286 V4L/DVB: ds3000: fix divide-by-zero error in ds3000_read_snr()
Fix a divide-by-zero error in ds3000's ds3000_read_snr(), when getting
a very low signal reading (dvbs2_signal_reading >= 1). This prevents
some nasty EIPs when running szap-s2 with a very low signal strength.

Signed-off-by: Nicolas Noirbent <nicolas.noirbent@smartjog.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:15 -03:00
Mauro Carvalho Chehab
b4bc3dcbef V4L/DVB: cpia1: comment unused command_setlights()
drivers/media/video/gspca/cpia1.c:1063: warning: ‘command_setlights’ defined but not used

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:14 -03:00
Mauro Carvalho Chehab
5fa2989f78 V4L/DVB: ir-core: Remove warining noise if decoders compiled builtin
drivers/media/IR/ir-raw-event.c:55: warning: ‘wq_load’ defined but not used
drivers/media/IR/ir-raw-event.c:222: warning: ‘init_decoders’ defined but not used
drivers/media/IR/rc-map.c: In function ‘get_rc_map’:
drivers/media/IR/rc-map.c:40: warning: unused variable ‘rc’

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:14 -03:00
Andreas Bombe
dab7e3106d V4L/DVB: V4L2: Replace loops for finding max buffers in VIDIOC_REQBUFS callbacks
Due to obvious copy and paste coding a number of video capture drivers
which implement a limit on the buffer memory decremented the user
supplied buffer count in a while loop until it reaches an acceptable
value.

This is a silly thing to do when the maximum value can be directly
computed.

Signed-off-by: Andreas Bombe <aeb@debian.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:13 -03:00
Herton Ronaldo Krzesinski
0a062033f7 Revert "V4L/DVB (11906): saa7134: Use v4l bounding/alignment function"
This reverts commit bc52d6eb44.

On newer kernels, a saa7134 board stopped to display TV video output
properly. After a bisect, I found it as the commit causing the issue.
Turns out that v4l_bound_align_image isn't doing the same bounding
calculation as manually done previously in saa7134_try_fmt_vid_cap.

What isn't equal is the calculation done in clamp align, while
previously it did "f->fmt.pix.width &= ~0x03", clamp_align function
does "Round to nearest aligned value" as stated in the comment, which
yields a different result. If I comment the round calculation in
clamp_align like this: "x = (x /*+ (1 << (align - 1))*/) & mask",
I get it fixed too, because this way the calculation is the same then.

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:13 -03:00
Wolfram Sang
2b0691cfc7 V4L/DVB: dvb/dib8000: fix build warning
In file included from drivers/media/dvb/dvb-usb/dib0700_devices.c:14:
  drivers/media/dvb/frontends/dib8000.h: In function 'dib8000_get_adc_power':
  drivers/media/dvb/frontends/dib8000.h:112: warning: no return statement in function returning non-void

Fixed by adding a return to the dummy function.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:11 -03:00
Huang Weiyi
d5978ed6b6 V4L/DVB: DVB: ngene, remove unused #include <linux/version.h>
Remove unused #include <linux/version.h>('s) in
  drivers/media/dvb/ngene/ngene-core.c

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:11 -03:00
Hans Verkuil
ce68025e9f V4L/DVB: ivtv: move the _IO() decoder ioctls into vidioc_default
Now that video_ioctl2 no longer clobbers the argument for _IO() ioctls we
can move these into vidioc_default where they really belong.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:10 -03:00
Hans Verkuil
6a717883e7 V4L/DVB: video_ioctl2: handle the v4l1 compat bit first and move VIDIOCGMBUF into the switch
Try to make a more sensible sequence of events in __video_do_ioctl: first
check for a valid ops pointer, then get the compat part done. The VIDIOCGMBUF
command is now part of the big switch.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:10 -03:00
Hans Verkuil
626e2acfdc V4L/DVB: w9966: convert to V4L2
Note that I have not been able to find anyone with this hardware. I tried
contacting the author without success, searched on eBay and similar places
without luck either.

So this conversion is untested. That said, it was pretty straightforward
so it is time to have this driver join the V4L2 world at last.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:09 -03:00
Hans Verkuil
fa0290eaee V4L/DVB: usbvision: remove non-working vbi device
The usbvision driver created vbi device nodes but the actual implementation
was just stubs and only returned errors to userspace.

In addition it used video_usercopy() and we want to remove that eventually.

So remove all the vbi code except for the vbi flag in the card definition
should someone ever be mad enough to work on a proper implementation for this
driver.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:07 -03:00
Hans Verkuil
3f5e18249c V4L/DVB: video_ioctl2: don't return, use break
You want to be able to reach the debug code at the end of this function,
so don't use return, use break.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:07 -03:00
Hans Verkuil
1d94aa369d V4L/DVB: video_ioctl2: do not replace arg with NULL for _IO() ioctls
If the ioctl was defined without direction (e.g. _IO('o', 25)), then
the arg as passed to vidioc_default was NULL instead of the original
argument.

Several ioctls in e.g. include/linux/dvb/video.h and audio.h use this type
of ioctl to pass simple numerical values to the driver.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:06 -03:00
Dan Carpenter
2b080c5df0 V4L/DVB: davinci: don't return under lock on error path
If the kmalloc() failed for "ccdc_cfg = kmalloc(...);" then we would exit
with the lock held.  I moved the mutex_lock() below the allocation
because it isn't protecting anything in that block and allocations are
allocations are sometimes slow.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:05 -03:00
Mauro Carvalho Chehab
3f113e3610 V4L/DVB: ir-core: move subsystem internal calls to ir-core-priv.h
ir-core.h has the kABI to be used by the bridge drivers, when needing to register
IR protocols and pass IR events. However, the same file also contains IR subsystem
internal calls, meant to be used inside ir-core and between ir-core and the raw
decoders.

Better to move those functions to an internal header, for some reasons:

1) Header will be a little more cleaner;

2) It avoids the need of recompile everything (bridge/hardware drivers, etc),
   just because a new decoder were added, or some other internal change were needed;

3) Better organize the ir-core API, splitting the functions that are internal to
   IR core and the ancillary drivers (decoders, lirc_dev) from the features that
   should be exported to IR subsystem clients.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:04 -03:00
David Härdeman
724e249550 V4L/DVB: Teach drivers/media/IR/ir-raw-event.c to use durations
drivers/media/IR/ir-raw-event.c is currently written with the assumption
that all "raw" hardware will generate events only on state change (i.e.
when a pulse or space starts).

However, some hardware (like mceusb, probably the most popular IR receiver
out there) only generates duration data (and that data is buffered so using
any kind of timing on the data is futile).

Furthermore, using signed int's to represent pulse/space durations is a
well-known approach when writing ir decoders.

With this patch:

- s64 int's are used to represent pulse/space durations in ns

- a workqueue is used to decode the ir protocols outside of interrupt context

- #defines are added to make decoders clearer

- decoder reset is implemented by passing a zero duration to the kfifo queue
  and decoders are updated accordingly

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:03 -03:00
Mauro Carvalho Chehab
d22e546ea1 V4L/DVB: ir-core: fix gcc warning noise
drivers/media/IR/ir-sysfs.c: In function ‘store_protocol’:
drivers/media/IR/ir-sysfs.c:93: warning: suggest parentheses around assignment used as truth value

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:03 -03:00
Mauro Carvalho Chehab
b320f80a6a V4L/DVB: ir-core: properly present the supported and current protocols
Hardware decoders have a more limited set of decoders than software ones.
In general, they support just one protocol at a given time, but allow
changing between a few options.

Rename the previous badly named "current_protocol" as just "protocol",
meaning the current protocol(s) accepted by the driver, and
add a "support_protocols" to represent the entire universe of supported
protocols by that specific hardware.

As commented on http://lwn.net/Articles/378884/, the "one file, one value"
rule doesn't fit nor does make much sense for bitmap or enum values. So, the
supported_protocols will enum all supported protocols, and the protocol
will present all active protocols.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:02 -03:00
Mauro Carvalho Chehab
626cf6979e V4L/DVB: ir-core: Distinguish sysfs attributes for in-hardware and raw decoders
Some devices have in-hardware Remote Controller decoder, while others
need a software decoder to get the IR code. As each software decoder
can be enabled/disabled individually, allowing multiple protocol
decoding capability.

On the other hand, hardware decoders have a limited protocol
support, often being able of decoding just one protocol each time.
So, each type needs a different set of capabilities to control the
supported protocol(s).

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:02 -03:00
David Härdeman
de88f31cef V4L/DVB: rename sysfs remote controller devices from rcrcv to rc
When the remote controller class is anyway being renamed from ir to rc
this would be a good time to also rename the devices from rcrcvX to rcX.

I know we haven't reached any agreement on whether transmission will
eventually be handled by the same device, but this change will at
least make the device name non-receive-specific which will make it
possible in the future (and if a different approach is finally
agreed upon, the device name still works).

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:01 -03:00
Mauro Carvalho Chehab
6eb9435b87 V4L/DVB: ir: Make sure that the spinlocks are properly initialized
Some spinlocks are not properly initialized on ir core:

[  471.714132] BUG: spinlock bad magic on CPU#0, modprobe/1899
[  471.719838]  lock: f92a08ac, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
[  471.727301] Pid: 1899, comm: modprobe Not tainted 2.6.33 #36
[  471.733062] Call Trace:
[  471.735537]  [<c1498793>] ? printk+0x1d/0x22
[  471.739866]  [<c12694e3>] spin_bug+0xa3/0xf0
[  471.744224]  [<c126962d>] do_raw_spin_lock+0x7d/0x160
[  471.749364]  [<f92a01ff>] ? ir_rc5_register+0x6f/0xf0 [ir_rc5_decoder]

So, use static initialization for the static spinlocks, instead of the
dynamic ones (currently used), as proposed by David Härdeman on one
of his RFC patches.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:01 -03:00
Mauro Carvalho Chehab
c373cabfbb V4L/DVB: em28xx: fix a regression caused by the rc-map changes
The patch that adds the rc-map changes didn't take into account that an
a table with IR_TYPE_UNKNOWN would make change_protocol to return -EINVAL.

As this function is fundamental to initialize some data, including a
callback to the getkey function, this caused the driver to stop working,
hanging the machine most of the times.

The fix were simply to add a handler for the IR type, but, to avoid further
issues, explicitly call change_protocol and handle the error before
initializing the IR. Also, let input_dev to start/stop IR handling,
after the opening of the input device.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:00 -03:00
Mauro Carvalho Chehab
9b09df51b8 V4L/DVB: ir-rc5-decoder: fix state machine
Reimplement the RC-5 decoder state machine. Code is now clear, and works
properly. It is also simpler than the previous implementations.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:00 -03:00
Mauro Carvalho Chehab
7f20d32d44 V4L/DVB: re-add enable/disable check to the IR decoders
A previous cleanup patch removed more than needed. Re-add the logic that
disable the decoders.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:59 -03:00
Mauro Carvalho Chehab
9dfe4e8339 V4L/DVB: ir-core: Add support for badly-implemented hardware decoders
A few hardware Remote Controller decoders, even using a standard protocol,
aren't able to provide the entire scancode. Due to that, the capability
of using other IR's are limited on those hardware.

Adds a way to indicate to ir-core what are the bits that the hardware
provides, from a scancode, allowing the addition of a complete IR table
to the kernel and allowing a limited support for changing the Remote
Controller on those devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:58 -03:00
Mauro Carvalho Chehab
587835a4b0 V4L-DVB: ir-core: remove the ancillary buffer
Now that the decoders are state machine, there's no need to create
an ancillary buffer while decoding the protocol. Just call the decoders
code directly, event by event.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:57 -03:00
Mauro Carvalho Chehab
26d5683d36 V4L/DVB: cx88: don't handle IR on Pixelview too fast
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:57 -03:00
Mauro Carvalho Chehab
db1423a6c7 V4L-DVB: ir-rc5-decoder: Add a decoder for RC-5 IR protocol
This decoder is also based on a state machine, just like the NEC protocol
decoder. It is pedantic in the sense that accepts only 14 bits. As there
are some variants that outputs less bits, it needs to be improved to also
handle those.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:56 -03:00
Mauro Carvalho Chehab
67780d6a23 V4L/DVB: ir-nec-decoder: Cleanups
Remove dead code and properly name a few constants

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:56 -03:00
Mauro Carvalho Chehab
2f16f6315f V4L/DVB: ir-nec-decoder: Reimplement the entire decoder
Thanks to Andy Walls <awalls@md.metrocast.net> for pointing me his
code, that gave me some ideas to better implement it.

After some work with saa7134 bits, I found a way to catch both IRQ
edge pulses. By enabling it, the NEC decoder can now take both
pulse and spaces into account, making it more precise.

Instead of the old strategy of handling the events all at once,
this code implements a state machine. Due to that, it handles
individual pulse or space events, validating them against the
protocol, producing a much more reliable decoding.

With the new implementation, the protocol trailer bits are properly
handled, making possible for the repeat key to work.

Also, the code is now capable of handling both NEC and NEC extended
IR devices. With NEC, it produces a 16 bits code, while with NEC
extended, a 24 bits code is returned.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:55 -03:00
David Härdeman
13c2449708 V4L/DVB: Convert drivers/media/dvb/ttpci/budget-ci.c to use ir-core
Converts drivers/media/dvb/ttpci/budget-ci.c to use ir-core rather than
rolling its own keydown timeout handler and reporting keys via
drivers/media/IR/ir-functions.c.

[mchehab@redhat.com: Drop the call to ir_input_init() as it is no longer needed]

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:54 -03:00
David Härdeman
a374fef443 V4L/DVB: ir-core: improve keyup/keydown logic
Rewrites the keyup/keydown logic in drivers/media/IR/ir-keytable.c.

All knowledge of keystates etc is now internal to ir-keytable.c
and not scattered around ir-raw-event.c and ir-nec-decoder.c (where
it doesn't belong).

In addition, I've changed the API slightly so that ir_input_dev is
passed as the first argument rather than input_dev. If we're ever
going to support multiple keytables we need to move towards making
ir_input_dev the main interface from a driver POV and obscure away
the input_dev as an implementational detail in ir-core.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:54 -03:00
Mauro Carvalho Chehab
354389467b V4L/DVB: ir-core: re-add some debug functions for keytable changes
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:53 -03:00
David Härdeman
b3074c0a3f V4L/DVB: drivers/media/IR - improve keytable code
The attached patch rewrites much of the keytable code in
drivers/media/IR/ir-keytable.c.

The scancodes are now inserted into the array in sorted
order which allows for a binary search on lookup.

The code has also been shrunk by about 150 lines.

In addition it fixes the following bugs:

Any use of ir_seek_table() was racy.

ir_dev->driver_name is leaked between ir_input_register() and
ir_input_unregister().

ir_setkeycode() unconditionally does clear_bit() on dev->keybit
when removing a mapping, but there might be another mapping with
a different scancode and the same keycode.

This version has been updated to incorporate patch feedback from
Mauro Carvalho Chehab.

[mchehab@redhat.com: Fix a conflict with RC keytable breakup patches and input changes]

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:53 -03:00
Mauro Carvalho Chehab
bdf1c98e42 V4L/DVB: saa7134: Add support for both positive and negative edge IRQ
The code that enables IRQ for the Remote Controller on saa7134 is a little
messy: it is outside saa7134-input, it checks if RC is GPIO based, and
it mixes both serial raw decode with parallel reads from a hardware-based
IR decoder.

Also, currently, it doesn't allow to trigger both transition edges at GPIO16
and GPIO18 lines. A rework on the code is needed to provide a better way
to specify what saa7134-input needs, maybe even moving part of the code from
saa7134-core and saa7134-cards into saa7134-input.

Yet, as a large rework is happening at RC core, it is better to wait until
the core changes stablize, in order to rework saa7134 RC internals.While
this don't happen, let's just change the logic a little bit to allow
enabling IRQ to be generated on both edge transitions, in order to better
support pulse/space raw decoders.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:52 -03:00
Mauro Carvalho Chehab
3629e1dadf V4L/DVB: saa7134: Fix IRQ2 bit names for the register map
There's an error at the IRQ2 bit map registers. Also, it doesn't
show what bits are needed for positive and for negative edge.

In the case of IR raw decoding, for some protocols, it is important
to detect both positive and negative edges. So, a latter patch
will need to use the other values.

Also, the code that detects problems on IRQ handling is incomplete,
as it disables only one of the IRQ bits for GPIO16 and GPIO18.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:52 -03:00
Mauro Carvalho Chehab
bd7261d3d7 V4L/DVB: ir-common: remove keymap tables from the module
Now that the remote keymaps were broken into separate modules,
get rid of the keycode tables that were hardcoded into ir-common.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:51 -03:00
Mauro Carvalho Chehab
02858eedcb V4L/DVB: ir-core: Make use of the new IR keymap modules
Instead of using the ugly keymap sequences, use the new rc-*.ko keymap
files. For now, it is still needed to have one keymap loaded, for the
RC code to work. Later patches will remove this depenency.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:50 -03:00
Mauro Carvalho Chehab
b2245ba164 V4L/DVB: ir: prepare IR code for a parameter change at register function
A latter patch will reuse the ir_input_register with a different meaning.
Before it, change all occurrences to a temporary name.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:50 -03:00
Mauro Carvalho Chehab
6686fa6917 V4L/DVB: Break Remote Controller keymaps into modules
The original Remote Controller approach were very messy: a big file,
that were part of ir-common kernel module, containing 64 different
RC keymap tables, used by the V4L/DVB drivers.

Better to break each RC keymap table into a separate module,
registering them into rc core on a process similar to the fs/nls tables.

As an userspace program is now in charge of loading those tables,
adds an option to allow the complete removal of those tables from
kernelspace.

Yet, on embedded devices like Set Top Boxes and TV sets, maybe the
only available input device is the IR. So, we should keep allowing
the usage of in-kernel tables, but a latter patch should change
the default to 'n', after giving some time for distros to add
the v4l-utils with the ir-keytable program, to allow the table
load via userspace.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:49 -03:00
Mauro Carvalho Chehab
9ce50c1a5f V4L/DVB: ir-core: Add support for RC map code register
Instead of having all RC tables hardcoded on one file with
all tables there, add infrastructure for registering and dynamically
load the table(s) when needed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:49 -03:00
Mauro Carvalho Chehab
77b7422d48 V4L/DVB: ir-common: move IR tables from ir-keymaps.c to a separate file
Instead of having one big file with lots of keytables, create one include
file for each IR keymap.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:48 -03:00
Mauro Carvalho Chehab
dce4a3e3b2 V4L/DVB: ir-common: Use macros to define the keytables
The usage of macros ensures that the proper namespace is being used
by all tables. It also makes easier to associate a keytable with
the name used inside the drivers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:47 -03:00
Mauro Carvalho Chehab
e27e971c69 V4L/DVB: rename all *_rc_keys to ir_codes_*_nec_table
Several DVB drivers use a different name convention. As we're moving
the keytables, we need to use the same convention on all places.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:46 -03:00