Commit Graph

85002 Commits

Author SHA1 Message Date
Bee Hock Goh c16dd82b48 V4L/DVB: TM6000: Fix code which cause memory corruption
The driver was doing malloc when buf is null causing memory corruption.

The analog part is still pretty much broken but at least fixing this
will stop it from crashing the machine when streamon.

Signed-off-by: Bee Hock Goh <beehock@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:33 -03:00
HIRANO Takahito 4d1f413e82 V4L/DVB: pt1: Support Earthsoft PT2
Support Earthsoft PT2.

Signed-off-by: HIRANO Takahito <hiranotaka@zng.info>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:32 -03:00
Stefan Ringel 2f79088486 V4L/DVB: tm6000: request labeling board version check
request labeling board version check

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:32 -03:00
Stefan Ringel f1434f4e90 V4L/DVB: tm6000: tm6000_i2c_xfer: request labeling
labeling the request after tuner reading and writeing

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:31 -03:00
Dan Carpenter a41b2ea73a V4L/DVB: cx88: improve error handling
Return -EINVAL if we don't find the right query control id.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:31 -03:00
Dan Carpenter 8e47567f7d V4L/DVB: cx231xx: improve error handling
Return -EINVAL if we don't find the control id.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:30 -03:00
Randy Dunlap f76280154c V4L/DVB: [-next] gspca: fix build for INPUT=m or INPUT=n
Handle case of GSPCA=m, INPUT=m when building gspca core;
also handle case of INPUT=n by using stubs.

drivers/media/video/gspca/gspca.c:662: error: implicit declaration of function 'gspca_input_destroy_urb'
drivers/media/video/gspca/gspca.c:668: error: implicit declaration of function 'gspca_input_create_urb'
drivers/media/video/gspca/gspca.c:2284: error: implicit declaration of function 'gspca_input_connect'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:30 -03:00
Dmitri Belimov b400f09246 V4L/DVB: Fix default state Beholder H6 tuner
The hybrid tuner FMD1216MEX_MK3 after cold start has disabled IF. This
tuner has internal I2C switch. This switch switch I2C bus between DVB-T
and IF part. Default state is DVB-T. When module saa7134 is load it
can't find IF tda9887 and disable analog TV mode.

Sets internal I2C switch of the tuner to IF by send special value to the
tuner as for receive analog TV from low band. It can be usefule for
other cards.

I didn't set configure a tuner by a tuner model because this tuner can
have different I2C address. May be we can do it later after discuss for
more robust support a tuners.

Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:29 -03:00
Stefan Ringel b57f432c28 V4L/DVB: tm6000: add gpios for tm6010 generic board
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:28 -03:00
Stefan Ringel 2edab1ee86 V4L/DVB: tm6000: add gpios to board struct
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:28 -03:00
Stefan Ringel 32a2232bfd V4L/DVB: tm6000: switch to gpio strcut
switch to a gpio structure

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:27 -03:00
Dan Carpenter 124371e33c V4L/DVB: video/sn9c102: improve error handling
Return an error if the controller is not found.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:27 -03:00
Dan Carpenter 67e13e7709 V4L/DVB: video/et61x251: improve error handling
The original code doesn't handle the situation where the controller is
not found.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:26 -03:00
Dan Carpenter f24350b48e V4L/DVB: video/zc0301: improve error handling
Return an error if the controller is not found.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:26 -03:00
Dan Carpenter a9fac6b148 V4L/DVB: video/cx231xx: cleanup. remove unneed null checks
"dev" is never NULL here so there is no need to check.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:25 -03:00
Dean Anderson 3a67b5cc6f V4L/DVB: s2255drv: adding v4l2_device structure. video_register_device cleanup
adding v4l2_device structure.
if one video_register_device call fails, allows use of other devices
or channels.

Signed-off-by: Dean Anderson <dean@sensoray.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:25 -03:00
Dean Anderson 85b85482c2 V4L/DVB: s2255drv: cleanup of debug messages
Signed-off-by: Dean Anderson <dean@sensoray.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:24 -03:00
Dean Anderson a5ef91c9a5 V4L/DVB: s2255drv: removal of big kernel lock
big kernel lock removed from open function.
v4l2 code does not require locking the open function except
to check asynchronous firmware load state, which is protected
by a mutex

Signed-off-by: Dean Anderson <dean@sensoray.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:23 -03:00
Dean Anderson c0a2ec956d V4L/DVB: s2255drv: video_device_alloc call not checked fix
call to video_device_alloc was not being checked in probe function.
code simplified and uses video_device inside device structure.

Signed-off-by: Dean Anderson <dean@sensoray.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:23 -03:00
Dean Anderson ab85c6a33c V4L/DVB: s2255drv: code cleanup
removal of unused pipe array (of size one).

Signed-off-by: Dean Anderson <dean@sensoray.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:22 -03:00
Dean Anderson ff7e22dfa1 V4L/DVB: s2255drv: cleanup of driver disconnect code
simplifies use of kref in driver

Signed-off-by: Dean Anderson <dean@sensoray.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:22 -03:00
Dan Carpenter f5e20c34e9 V4L/DVB: video/au0828: off by one bug
The "AUVI_INPUT(tmp)" macro uses "tmp" as an index of an array with
AU0828_MAX_INPUT elements.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:21 -03:00
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