Commit Graph

9170 Commits

Author SHA1 Message Date
Dan Carpenter
b084307c75 V4L/DVB: cx23885: strcpy() => strlcpy()
cap->driver is a 16 char buffer and dev->name is a 32 char buffer.
I don't see an actual problem, but we may as well make the static
checkers happy.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:41 -03:00
Mauro Carvalho Chehab
92f4fc10d7 V4L/DVB: cx88: Only start IR if the input device is opened
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:53:04 -03:00
Mauro Carvalho Chehab
716aab44df V4L/DVB: ir-core: Add callbacks for input/evdev open/close on IR core
Especially when IR needs to do polling, it generates lots of wakeups per
second. This makes no sense, if the input event device is closed.

Adds a callback handler to the IR hardware driver, to allow registering
an open/close ops.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:53:03 -03:00
Mauro Carvalho Chehab
e202c15b42 V4L/DVB: ir-core: rename sysfs remote controller class from ir to rc
IR is an alias for Infrared Remote, while RC is an alias for Remote
Controller.

While currently all implementations are with Infrared Remote Controller,
this subsystem is not meant to be used only by IR type of RC's. So,
as discussed on both linux-media and linux-input, the better is to
rename the subsystem as Remote Controller.

While, currently, the only application that uses the /sys/class/irrcv is
ir-keytable application, and its sysfs support works only with the
current linux-next code, it is still possible to change the userspace API
without the risk of breaking applications. So, better to rename this
sooner than later.

Later patches will be needed to rename the files and to move them away
from drivers/media, but this is not a critical issue. So, for now,
let's just change the name of the sysfs class/nodes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:53:02 -03:00
Mauro Carvalho Chehab
d89b4bd2b4 V4L/DVB: saa7134: clear warning noise
drivers/media/video/saa7134/saa7134-input.c: In function ‘saa7134_raw_decode_irq’:
drivers/media/video/saa7134/saa7134-input.c:957: warning: unused variable ‘oldpulse’
drivers/media/video/saa7134/saa7134-input.c:957: warning: unused variable ‘count’

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:53:01 -03:00
Mauro Carvalho Chehab
20d5f116ec V4L/DVB: ir-nec-decoder: Add sysfs node to enable/disable per irrcv
With the help of raw_register/raw_unregister, adds a sysfs group
associated with the decoder, inside the corresponding irrcv node.

Writing 1 to nec_decoder/enabled enables the decoder, while
writing 0 disables it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:53:01 -03:00
Mauro Carvalho Chehab
93c312ff21 V4L/DVB: ir-core: prepare to add more operations for ir decoders
Some decoders and a lirc_dev interface may need some other operations to work.
For example: IR device register/unregister and ir_keydown events may need to
be tracked.

As some operations can occur in interrupt time, and a lock is needed to prevent
un-registering a decode while decoding a key, the lock needed to be convert
into a spin lock.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:53:00 -03:00
Mauro Carvalho Chehab
995187bed3 V4L/DVB: ir-core: dynamically load the compiled IR protocols
Instead of hardcoding the protocols into ir-core, add a register interface
for the IR protocol decoders, and convert ir-nec-decoder into a client of
ir-core.

With this approach, it is possible to dynamically load the needed IR protocols,
and to add a RAW IR interface module, registered as one IR raw protocol decoder.

This patch opens a way to register a lirc_dev interface to work as an userspace
IR protocol decoder.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:59 -03:00
Mauro Carvalho Chehab
9f1547829a V4L/DVB: saa7134: don't wait too much to generate an IR event on raw_decode
At raw_decode mode, the key is processed after the end of a timer. The
previous code resets the timer every time something is received at the IR
port. While this works fine with IR's that don't implement repeat, like
Avermedia RM-JX IR, it keeps waiting until keydown, on IR's that implement
NEC repeat command, like the Terratec yellow.

The solution is to change the behaviour to do the timeout after the first
received data.

The timeout is currently set to 15 ms, as it works fine with NEC protcocol.
It may need some adjustments to support other protocols and to better handle
spurious detections that may happen with some IR sensors.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:58 -03:00
Mauro Carvalho Chehab
ada39630c7 V4L/DVB: ir-core/saa7134: Move ir keyup/keydown code to the ir-core
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:57 -03:00
Mauro Carvalho Chehab
6660de568d V4L/DVB: ir-core: add two functions to report keyup/keydown events
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:56 -03:00
Mauro Carvalho Chehab
a3572c34da V4L/DVB: ir-core: Add logic to decode IR protocols at the IR core
Adds a method to pass IR raw pulse/code events into ir-core. This is
needed in order to support LIRC. It also helps to move common code
from the drivers into the core.

In order to allow testing, it implements a simple NEC protocol decoder
at ir-nec-decoder.c file. The logic is about the same used at saa7134
driver that handles Avermedia M135A and Encore FM53 boards.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:56 -03:00
Mauro Carvalho Chehab
0210894956 V4L/DVB: saa7134: add code to allow changing IR protocol
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:55 -03:00
Mauro Carvalho Chehab
d152b8b624 V4L/DVB: saa7134: use a full scancode table for M135A
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:54 -03:00
Mauro Carvalho Chehab
ecf6e72da3 V4L/DVB: ir-core: be less pedantic with RC protocol name
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:53 -03:00
Laurent Pinchart
ed3de6015a V4L/DVB: uvcvideo: Use POLLOUT and POLLWRNORM for output devices
The V4L2 specification requires drivers to use the write events in the
file operations poll handler for output devices. The uvcvideo driver
erroneously used read events for all devices. Fix this.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:52 -03:00
Laurent Pinchart
35a00c41ea V4L/DVB: uvcvideo: Support iris absolute and relative controls
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:52 -03:00
Laurent Pinchart
48213fe3f9 V4L/DVB: v4l: Add V4L2_CID_IRIS_ABSOLUTE and V4L2_CID_IRIS_RELATIVE controls
Those control, as their names imply, control the camera aperture
settings.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:51 -03:00
Laurent Pinchart
f129b03ba2 V4L/DVB: uvcvideo: Add support for Packard Bell EasyNote MX52 integrated webcam
The camera requires the STREAM_NO_FID quirk. Add a corresponding entry
in the device IDs list.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:50 -03:00
Laurent Pinchart
1e4d05bc95 V4L/DVB: uvcvideo: Add support for unbranded Arkmicro 18ec:3290 webcams
The camera requires the PROBE_DEF quirk. Add a corresponding entry in
the device IDs list.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:49 -03:00
Jean-François Moine
dbad345e6a V4L/DVB: sn9c102 / zc0301: Handle webcams when no gspca subdriver conflict
Some webcams handled by both sn9c102 or zc0301 and some gspca subdrivers
(sonixb, sonixj and zc3xx) were not handled when gspca was generated but
not the associated subdrivers.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:49 -03:00
Costantino Leandro
be1da9ee83 V4L/DVB: gspca - t613: Add color controls
- Rename controls to fit real behaviour
- Add global gain , r/b balance.

Signed-off-by: Costantino Leandro <lcostantino@gmail.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:48 -03:00
Vaibhav Hiremath
63b59cecb2 V4L/DVB: V4L: tvp514x: Add Powerup sequence during s_input to lock the signal properly
For the sequence streamon -> streamoff and again s_input, it fails
to lock the signal, since streamoff puts TVP514x into power off state
which leads to failure in sub-sequent s_input.

So add powerup sequence in s_routing (if disabled), since it is
important to lock the signal at this stage.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Signed-off-by: Muralidharan Karicheri <mkaricheri@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:47 -03:00
Vaibhav Hiremath
844cc0dcb5 V4L/DVB: V4L: vpfe_capture: Add support for USERPTR mode of operation
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Muralidharan Karicheri <mkaricheri@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:46 -03:00
Vaibhav Hiremath
e333bab73e V4L/DVB: V4L: dm644x_ccdc: Add Suspend/Resume Support
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Muralidharan Karicheri <mkaricheri@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:45 -03:00
Vaibhav Hiremath
aa2dc90348 V4L/DVB: V4L: vpfe_capture: Return 0 from suspend/resume
Now Suspend/Resume functionality is being handled by respective CCDC
code, so return true (0) from bridge suspend/resume function.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Muralidharan Karicheri <mkaricheri@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:45 -03:00
Vaibhav Hiremath
21aa300e16 V4L/DVB: V4L: dm644x_ccdc: Add 10bit BT support
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Muralidharan Karicheri <mkaricheri@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:44 -03:00
Vaibhav Hiremath
085b54a24f V4L/DVB: V4L: vpfe_capture: Add call back function for interrupt clear for vpfe_cfg
For the devices like AM3517, it is expected that driver clears the
interrupt in ISR. Since this is device spcific, callback function
added to the platform_data.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Muralidharan Karicheri <mkaricheri@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:43 -03:00
Vaibhav Hiremath
fcc63274e6 V4L/DVB: V4L: dm644x_ccdc: Debug register read prints removed
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Muralidharan Karicheri <mkaricheri@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:42 -03:00
Hans Verkuil
b8e56b6f6e V4L/DVB: arv: convert to V4L2
Converted this old V4L1 driver to V4L2.
I would like to thank Takeo Takahashi who very kindly tested this
driver for me. Much appreciated!

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Tested-by: Takeo Takahashi <takahashi.takeo@renesas.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:42 -03:00
Hans Verkuil
debff5a795 V4L/DVB: zoran: remove V4L1 videodev.h include
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:41 -03:00
Hans Verkuil
51270617a5 V4L/DVB: meye: remove last V4L1 remnants from the code and add v4l2_device
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:52:36 -03:00
Hans Verkuil
c1f2b0f29e V4L/DVB: w9966: remove camelCase
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:31 -03:00
Hans Verkuil
271922c0ce V4L/DVB: w9966: reorganize the order of functions
Get rid of completely unnecessary function prototypes.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:30 -03:00
Hans Verkuil
467422678e V4L/DVB: pms: remove unnecessary exclusive open/close
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:30 -03:00
Hans Verkuil
4bfdd58604 V4L/DVB: w9966: coding style cleanup
Clean up the coding style before we convert this driver to V4L2.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:28 -03:00
Hans Verkuil
88f4423454 V4L/DVB: arv: coding style cleanup
Clean up the coding style before we convert this driver to V4L2.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:27 -03:00
Hans Verkuil
1d61aac099 V4L/DVB: bw-qcam: coding style cleanup
Clean up the coding style before we convert this driver to V4L2.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:26 -03:00
Hans Verkuil
51224aa436 V4L/DVB: c-qcam: coding style cleanup
Clean up the coding style before we convert this driver to V4L2.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:26 -03:00
Jonathan Corbet
380de498e2 V4L/DVB: ov7670: silence some compiler warnings
Get rid of some "unused variable" warnings.  These were the result of
sloppiness and should not have happened; I'll go stand in the corner now.

Reported-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:25 -03:00
Jonathan Corbet
a8e68c37c8 V4L/DVB: ov7670: Always rewrite clkrc when setting format
That makes frame rate configuration persistent.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:24 -03:00
Jonathan Corbet
467142093d V4L/DVB: ov7670: Restore SMBUS I/O for the XO 1.0
The Cafe controller doesn't do non-SMBUS I/O, so we have to use it there.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:23 -03:00
Jonathan Corbet
364e93372f V4L/DVB: ov7670: wire up controls for exposure and autoexposure
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:22 -03:00
Jonathan Corbet
8189867124 V4L/DVB: ov7670: Wire up V4L2_CID_GAIN and V4L2_CID_AUTOGAIN
Allow applications to play with the gain settings.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:21 -03:00
Jonathan Corbet
2bf7de4888 V4L/DVB: ov7670: Don't use SMBUS I/O
Contrary to my earlier belief, the ov7670 is not actually an SMBUS device,
though it will pretend to be one if it's in a good mood.  Unfortunately,
it's rarely in a good mood, especially on the XO 1.5.  So use low-level i2c
I/O instead.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:21 -03:00
Jonathan Corbet
d8d201552f V4L/DVB: ov7670: Avoid reading clkrc
Reading the clkrc register creates flaky behavior in some situations, and
we can easily track its state separately.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:20 -03:00
Jonathan Corbet
97693f9178 V4L/DVB: ov7670: Use CCIR601 in all video modes
Also provide for a longer delay after reset - the XO 1.5 needs it.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:19 -03:00
Dan Carpenter
4a3eaee4d0 V4L/DVB: em28xx: "Empia Em28xx Audio" too long
card->driver is 15 characters and a NULL.  The original code
goes past the end of the array.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:18 -03:00
Dan Carpenter
935539c97e V4L/DVB: cx231xx: card->driver "Conexant cx231xx Audio" too long
card->driver is 15 characters and a NULL, the original code could
cause a buffer overflow.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:17 -03:00
Dan Carpenter
d72d7c1df9 V4L/DVB: ivtv: sizeof() => ARRAY_SIZE()
This fixes a smatch warning:
drivers/media/video/ivtv/ivtv-vbi.c +138 ivtv_write_vbi(43)
	error: buffer overflow 'vi->cc_payload' 256 <= 1023

Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Andy Walls <awalls@radix.net>
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:50:26 -03:00