Commit graph

14018 commits

Author SHA1 Message Date
Hans Verkuil
4839e6c2ac [media] v4l2-ioctl.c: move a block of code down, no other changes
A block of code is moved down in the code to make later changes easier.
Do just the move without other changes to keep the diff readable for the
upcoming patch.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 17:16:26 -03:00
Thomas Betker
b61097ee1a [media] bttv-cards.c: Allow radio for CHP05x/CHP06x
Add ".has_radio = 1" for BTTV_BOARD_MAGICTVIEW061 because there are
some CHP05x/CHP06x boards with a radio tuner.

I still have an analog Askey Magic TView card (CHP051, PCI 144f:3002)
which I use for radio only. This worked fine with kernel 2.6.37
(openSUSE 11.4), but no longer works with kernel 3.1.10 (openSUSE 12.1).

The reason apparently is that ".has_radio = 1" is missing in
bttv-cards.c for BTTV_BOARD_MAGICTVIEW061; when I add this line and
recompile the kernel, radio is working again. The line is still missing
in the latest git tree, for which I have generated the attached patch.

I can't test what will happen for CHP05x/CHP06x devices without radio;
however, it seems that other cards also have the problem that there are
some boards with radio and some without, so I hope that this can be
sorted out.

Signed-off-by: Thomas Betker <thomas.betker@freenet.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 16:58:48 -03:00
Benoît Thébaudeau
ebc04047b3 [PATCH] media: add Analog Devices ADV7393 video encoder driver
Add ADV7393 I²C-based video encoder driver. This driver has been tested on
custom hardware. It has been tested for composite output. It is derived from the
ADV7343 driver.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 15:46:17 -03:00
Mauro Carvalho Chehab
993568d491 [media] [V3] stv090x: variable 'no_signal' set but not used
Remove variable and ignore return value of stv090x_chk_signal().

Tested by compilation only.

[mchehab@redhat.com: instead of reverting and applying V3,
 applied just the diff patch, for the sake of a cleaner history]
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Reviewed-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 15:28:17 -03:00
Laurent Pinchart
4807063faa [media] uvcvideo: Fix alternate setting selection
The alternate setting number is not equal to the alternate setting index
in the interface alternate settings table. Use the alternate setting
number from the interface descriptor when calling usb_set_interface().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 15:26:47 -03:00
Jayakrishnan
c854a48a97 [media] uvcvideo: Fix frame drop in bulk video stream
When video endpoint is configured as bulk, a ZLP is sent after every
video frames with size as multiple of 512 bytes. This is done so that
host can detect end of transfer and pass data for processing.
Still, frames that are multiple of 16K in size gets dropped. The ZLP
sent by camera is ignored by uvc_video_decode_bulk(). The makes sure
that the ZLP is not part of a video frame before ignoring it. If ZLP
follows a video frame, then it triggers completion callback.

[mchehab@redhat.com: Fix a small CodingStyle issue]
Signed-off-by: Jayakrishnan Memana <jayakrishnan.memana@maxim-ic.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 15:26:46 -03:00
Martin Blumenstingl
257ee97eeb [media] drxk: Improve logging
This patch simply fixes some logging calls:
- Use KERN_INFO when printing the chip status.
- Add a missing space when logging the drxk_gate_ctrl call.
- Use the same logging text as always if the scu_command in GetQAMLockStatus fails.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 14:55:13 -03:00
Mauro Carvalho Chehab
7eaf718844 fixupSigned-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> 2012-07-06 14:55:11 -03:00
Martin Blumenstingl
9e23f50a76 [media] drxk: Make the QAM demodulator command parameters configurable
Currently there are two different implementations (in the firmware) for
the QAM demodulator command: one takes 4 and the other takes 2
parameters. The driver shows an error in dmesg When using the
4-parameter command with firmware that implements the 2-parameter
command. Unfortunately this happens every time when chaning the
frequency (on DVB-C).

This patch simply makes configurable, how many command parameters will
be used. All existing drxk_config instances using the "drxk_a3.mc" were
updated because this firmware is the only loadable firmware where the
QAM demodulator command takes 4 parameters. Some firmwares in the ROM
might also use it. The drxk instances in the em28xx-dvb driver were also
updated to silence the warnings.

If no qam_demod_parameter_count is given in the drxk_config struct, then
the correct number of parameters will be auto-detected.

[mchehab@redhat.com: Fix a small CodingStyle issue at one comment]
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 14:54:43 -03:00
Dan Carpenter
22a09b439a [media] drxk: fix a '&' vs '|' bug
IQM_AF_CLKNEG_CLKNEGDATA__M is 0x2 and
IQM_AF_CLKNEG_CLKNEGDATA_CLK_ADC_DATA_POS is 0.  (clkNeg | 0x2) is never
equal to zero so the condition can never be true.

I consulted with Ralph Metzler and the '|' should be changed to a '&'.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
CC: Ralph Metzler <rjkm@metzlerbros.de>
Tested-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 14:54:32 -03:00
Mauro Carvalho Chehab
ab9cbcd36c [media] tuner-xc2028: tag the usual firmwares to help dracut
When tuner-xc2028 is not compiled as a module, dracut will
need to copy the firmware inside the initfs image.

So, use MODULE_FIRMWARE() to indicate such need.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 14:15:41 -03:00
Mauro Carvalho Chehab
81059812c2 [media] uvc/Kconfig: Fix INPUT/EVDEV dependencies
USB_VIDEO_CLASS_INPUT_EVDEV should be dependent on the UVC
selection, as otherwise, when UVC is unselected, this dependent
config still appears.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 10:52:43 -03:00
Mauro Carvalho Chehab
94f7476716 [media] rc/Kconfig: Move a LIRC sub-option to the right place
The IR to LIRC option were at the wrong sub-menu. Move it to the right
place.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 09:21:13 -03:00
Mauro Carvalho Chehab
c455f5c85a [media] Kconfig: Split the core support options from the driver ones
Better arrange the remote controller driver items to happen after the
core support, on their proper menus, and making clerarer what is media
core options and what is media driver options.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 09:12:59 -03:00
David Dillow
cd5534be6b [media] cx231xx: don't DMA to random addresses
Commit 7a6f6c29d2 (cx231xx: use
URB_NO_TRANSFER_DMA_MAP) was intended to avoid mapping the DMA buffer
for URB twice. This works for the URBs allocated with usb_alloc_urb(),
as those are allocated from cohernent DMA pools, but the flag was also
added for the VBI and audio URBs, which have a manually allocated area.
This leaves the random trash in the structure after allocation as the
DMA address, corrupting memory and preventing VBI and audio from
working. Letting the USB core map the buffers solves the problem.

Signed-off-by: David Dillow <dave@thedillows.org>
Cc: Sri Deevi <srinivasa.deevi@conexant.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 01:46:18 -03:00
David Dillow
460a4de77d [media] cx231xx: use TRANSFER_TYPE enum for cleanup
Most calls to cx231xx_capture_start() already use the values from
TRANSFER_TYPE, but cx231xx_capture_start() and
cx231xx_initialize_stream_xfer() were hand coding the values.
Use the named values (81 is never passed in), and simplify
cx231xx_capture_start(), as the switch statements were identical and
pcb_config->config_num is a u8, so any non-zero config got the same
result.

Signed-off-by: David Dillow <dave@thedillows.org>
Cc: Sri Deevi <srinivasa.deevi@conexant.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 01:45:43 -03:00
Mauro Carvalho Chehab
cc831f843c [media] v4l2-compat-ioctl32: fix compilation breakage
changeset 2b719d7baf (v4l: drop v4l2_buffer.input and V4L2_BUF_FLAG_INPUT)
broke compilation on x86_64:

	v4l2-compat-ioctl32.c: In function 'get_v4l2_buffer32':
	v4l2-compat-ioctl32.c:391:4: error: expected ')' before 'return'
	...
	v4l2-compat-ioctl32.c: In function 'put_v4l2_buffer32':
	v4l2-compat-ioctl32.c:475:4: error: expected ')' before 'return'
	...

Add the missing close parenthesis character.

Cc: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 21:58:48 -03:00
Mauro Carvalho Chehab
724f4a321f [media] media: only show V4L devices based on device type selection
After this patch, the MEDIA*_SUPPORT will be used as a filter,
exposing only devices that are pertinent to one of the 3
V4L types: webcam/grabber, radio, analog TV.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 18:22:53 -03:00
Mauro Carvalho Chehab
8cfd9dccf2 [media] media: Remove VIDEO_MEDIA Kconfig option
In the past, it was possible to have either DVB or V4L2 core
as module and the other as builtin. Such config never make much
sense, and created several issues in order to make the Kconfig
dependency to work, as all drivers that depend on both (most
TV drivers) would need to be compiled as 'm'. Due to that,
the VIDEO_MEDIA config option were added.

Instead of such weird approach, let's just use the MEDIA_SUPPORT
=y or =m to select if the media subsystem core will be either
builtin or module, simplifying the building system logic.

Also, fix the tuners configuration, by enabling them only if
a tuner is required. So, if just webcam/grabbers support is
selected, no tuner option will be selected. Also, if only digital
TV is selected, no analog tuner support is selected.

That removes the need of using EXPERT customise options, when
analog TV is not selected.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 18:21:53 -03:00
Mauro Carvalho Chehab
b4c184e506 [media] media: reorganize the main Kconfig items
Change the main items to:

<m> Multimedia support  --->
   [ ]   Cameras/video grabbers support
   [ ]   Analog TV support
   [ ]   Digital TV support
   [ ]   AM/FM radio receivers/transmitters support
   [ ]   Remote Controller support

This provides an interface that is clearer to end users that
are compiling the Kernel, and will allow the building system
to automatically unselect drivers for unused functions.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 18:21:28 -03:00
Sakari Ailus
2b719d7baf [media] v4l: drop v4l2_buffer.input and V4L2_BUF_FLAG_INPUT
Remove input field in struct v4l2_buffer and flag V4L2_BUF_FLAG_INPUT which
tells the former is valid. The flag is used by no driver currently.

Also change the documentation accordingly.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 18:00:32 -03:00
Mauro Carvalho Chehab
5cf73ce15f [media] xc5000: Add support for DMB-TH and ISDB-T
xc5000 is just a tuner, not a decoder, so both DMB-TH and ISDB-T should
work properly there: it is just a matter of teaching the driver what
saw filter should be used and how to calculate the center frequency.

Requested-by: Choi Wing Chan <chanchoiwing@gmail.com>
Cc: Steven Toth <stoth@linuxtv.org>
Cc: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 14:22:13 -03:00
Dmitry Lifshitz
8cd0d4caa1 [media] tvp5150: fix kernel crash if chip is unavailable
tvp5150 driver probe function doesn't check if the chip is present.
Thus the driver can be loaded without having a device.
This is dangerous and can cause kernel crash like this:

Kernel BUG at c03c0964 [verbose debug info unavailable]
Internal error: Oops - BUG: 0 [#1] PREEMPT ARM
Modules linked in:
CPU: 0    Tainted: G        W     (3.4.0-cm-t3730+ #2)
PC is at media_entity_create_link+0xe4/0xf4
LR is at isp_register_entities+0x228/0x2f4
pc : [<c03c0964>]    lr : [<c03f3b30>]    psr: 60000013
sp : cf02de50  ip : 00000000  fp : c079405c
r10: 00000000  r9 : 00000000  r8 : cf33c800
r7 : c0794834  r6 : 00000000  r5 : 00000000  r4 : cf365b48
r3 : 00000000  r2 : cf365b48  r1 : 00000000  r0 : cf33c800
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5387d  Table: 80004019  DAC: 00000015
Process swapper (pid: 1, stack limit = 0xcf02c2f0)
Stack: (0xcf02de50 to 0xcf02e000)
de40:                                     cf360000 cf366f28 cf366218 c0794834
de60: cf365b48 00000000 cf33c800 c03f3b30 00000000 00000000 cf360890 cf3668a0
de80: 00000003 cf360000 c0785a58 00000000 cf360528 00000000 00000000 00003fff
dea0: cf360500 c03f4cdc c06cc1f4 cf360000 c0785a58 c0d27808 c07d55ec c0785a58
dec0: c031f0e0 c07d55ec c0776900 000000bb 00000000 c032040c c03203f4 c031ef0c
dee0: c0785a58 c07d55ec c0785a8c c031f0e0 c075e670 c031f0c8 cf02deb8 c0785a58
df00: c07d55ec c031f174 c07d55ec 00000000 cf02df18 c031d7a0 cf01d4a8 cf068b10
df20: 00000000 c07d55ec c07c74d0 cf34bcc0 00000000 c031ded8 c0672340 c054cd38
df40: 00000000 c07e68c0 c07d55ec 00000000 00000000 c075e670 c0776900 000000bb
df60: 00000000 c031f770 c07e68c0 00000007 c07e68c0 00000000 c075e670 c0008790
df80: 000000bb 00000006 00000006 c066e650 cf02dfa4 c07689b8 c07689b8 00000007
dfa0: c07e68c0 c073f2e8 c07689c0 000000bb 00000000 c073f2bc 00000006 00000006
dfc0: c073f2e8 00000000 c077649c c077649c c00150cc 00000013 00000000 00000000
dfe0: 00000000 c073f3cc cf02dfe8 00000000 c073f368 c00150cc 00000000 00000000
[<c03c0964>] (media_entity_create_link+0xe4/0xf4) from [<c03f3b30>] (isp_register_entities+0x228/0x2f4)
[<c03f3b30>] (isp_register_entities+0x228/0x2f4) from [<c03f4cdc>] (isp_probe+0x7ac/0x9b8)
[<c03f4cdc>] (isp_probe+0x7ac/0x9b8) from [<c032040c>] (platform_drv_probe+0x18/0x1c)
[<c032040c>] (platform_drv_probe+0x18/0x1c) from [<c031ef0c>] (really_probe+0x64/0x1d8)
[<c031ef0c>] (really_probe+0x64/0x1d8) from [<c031f0c8>] (driver_probe_device+0x48/0x60)
[<c031f0c8>] (driver_probe_device+0x48/0x60) from [<c031f174>] (__driver_attach+0x94/0x98)
[<c031f174>] (__driver_attach+0x94/0x98) from [<c031d7a0>] (bus_for_each_dev+0x54/0x80)
[<c031d7a0>] (bus_for_each_dev+0x54/0x80) from [<c031ded8>] (bus_add_driver+0xac/0x2a8)
[<c031ded8>] (bus_add_driver+0xac/0x2a8) from [<c031f770>] (driver_register+0x78/0x180)
[<c031f770>] (driver_register+0x78/0x180) from [<c0008790>] (do_one_initcall+0x34/0x184)
[<c0008790>] (do_one_initcall+0x34/0x184) from [<c073f2bc>] (do_basic_setup+0x9c/0xc8)
[<c073f2bc>] (do_basic_setup+0x9c/0xc8) from [<c073f3cc>] (kernel_init+0x64/0xec)
[<c073f3cc>] (kernel_init+0x64/0xec) from [<c00150cc>] (kernel_thread_exit+0x0/0x8)
Code: e1c812b6 e8bd87f0 e7f001f2 eafffffe (e7f001f2)

---[ end trace 3ed3c618b26ff3e8 ]---
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

This patch fixes the tvp5150_read() function to return an error in case
the I2C transaction fails.
tvp5150_probe() and other relevant driver callbacks changed to check the
status of the I2C read operations.
In case of a read error throw an error message with v4l2_err()
instead of v4l2_dbg().

[mchehab@redhat.com: Fix a small typo breaking compilation]
Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 14:22:12 -03:00
Tomasz Moń
800728715c [media] v4l: mem2mem_testdev: Add horizontal and vertical flip
Add horizontal and vertical flip to the mem2mem_testdev driver.
Flip modes can be enabled either separately or simultaneously.

Signed-off-by: Tomasz Moń <desowin@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 13:54:07 -03:00
Peter Meerwald
e9da6b3ca5 [media] media: remove unused element datawidth from struct mt9m111
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 13:03:50 -03:00
Antti Palosaari
acc4e826fc [media] a8293: use Kernel dev_* logging
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 13:01:47 -03:00
Antti Palosaari
f3e16df60b [media] a8293: fix register 00 init value
Value 0x00 was written instead of 0x10 which was aim.

Bit4 is overcurrent disable timer - ODT. According to datasheet ODT
functions are always enabled but setting it 1 is still recommended.

Thanks to Aubin Constans to pointing that bug.

Reported-by: Aubin Constans <aconstans@wyplay.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 13:01:01 -03:00
Antti Palosaari
279bba0fbd [media] tda10071: convert Kernel dev_* logging
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 13:00:43 -03:00
Antti Palosaari
21c8ba39ab [media] tda10071: use decimal numbers for indexes and lengths
Dan asked "Btw, why are the sizes specified in hex instead of
decimal here?". After looking code, I agree also decimal
presentation is clearer. So lets change those.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 13:00:15 -03:00
Antti Palosaari
84431c2ae5 [media] tda10071: fix DiSEqC message len check
Message length check was wrong which could cause garbage sent to LNB,
but only in case garbage got from the userspace application.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 12:59:20 -03:00
Thomas Mair
36ad92e06e [media] rtl28xxu: support Terratec Noxon DAB/DAB+ stick
Signed-off-by: Hans-Frieder Vogt <hfvogt@gmx.net>
Signed-off-by: Thomas Mair <thomas.mair86@googlemail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 12:59:00 -03:00
Thomas Mair
ea76600fd4 [media] rtl28xxu: support Delock USB 2.0 DVB-T
Signed-off-by: Thomas Mair <thomas.mair86@googlemail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 12:58:50 -03:00
Thomas Mair
40a2d3c762 [media] rtl28xxu: renamed rtl2831_rd/rtl2831_wr to rtl28xx_rd/rtl28xx_wr
Signed-off-by: Thomas Mair <thomas.mair86@googlemail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 12:58:26 -03:00
Thomas Mair
5cf6631e52 [media] rtl28xxu: support for the rtl2832 demod driver
This only adds support for the Terratec Cinergy T Stick Black device.

Changes from previous patches:
- fixed compiler warnings
- added fc0013 tuner handling to this patch

Signed-off-by: Thomas Mair <thomas.mair86@googlemail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 12:58:16 -03:00
Mauro Carvalho Chehab
298f18a3e2 [media] rtl2832: save some data space by using a macro instead of a table
Instead of using a table for reg bitmask, use a macro. This should save
some data segment space.

Cc: Thomas Mair <thomas.mair86@googlemail.com>
Cc: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 12:16:26 -03:00
Thomas Mair
82041c0a15 [media] RTL2832 DVB-T demodulator driver
Changelog for ver. 0.5:
- fixed code style and naming errors

Changelog for ver. 0.4:
- removed statistics as their calculation was wrong
- fixed bug in Makefile
- indentation and code style improvements

Signed-off-by: Thomas Mair <thomas.mair86@googlemail.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 12:05:37 -03:00
Luis Henriques
b31b021988 [media] ene_ir: Fix driver initialisation
commit 9ef449c6b3 ("[media] rc: Postpone ISR
registration") fixed an early ISR registration on several drivers.  It did
however also introduced a bug by moving the invocation of pnp_port_start()
to the end of the probe function.

This patch fixes this issue by moving the invocation of pnp_port_start() to
an earlier stage in the probe function.

Cc: stable@vger.kernel.org
Cc: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05 11:14:21 -03:00
Mauro Carvalho Chehab
1d432a3d77 [media] tuner, xc2028: add support for get_afc()
Implement API support to return AFC frequency shift, as this device
supports it. The only other driver that implements it is tda9887,
and the frequency there is reported in Hz. So, use Hz also for this
tuner.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-04 02:46:58 -03:00
Mauro Carvalho Chehab
90acb85fb4 [media] tuner-xc2028: Fix signal strength report
There are several bugs at the signal strength algorithm:

	- It is using logical OR, instead of bit OR;
	- It doesn't wait up to 18 ms as it should;
	- the strength range is not ok.

Rework on it, in order to make it work.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-04 02:01:07 -03:00
Mauro Carvalho Chehab
030755bde4 [media] tuner-core: call has_signal for both TV and radio
If g_tuner is called and the tuner is able to return the signal strength
via has_signal(), call the tunner callback to retrieve such data for all
tuner types, not only for radio ones.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-04 01:54:31 -03:00
Mauro Carvalho Chehab
61a96113de [media] tuner-xc2028: use request_firmware_nowait()
Change the firmware logic to use request_firmware_nowait(), and
to preserve the loaded firmwares in memory, to reduce the risk
of troubles with buggy userspace apps.

With this change, while the firmware is being loaded, the driver
will return -EAGAIN to any calls. If, for some reason, firmware
failed to be loaded from userspace, it will return -ENODEV.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-30 14:26:06 -03:00
Mauro Carvalho Chehab
704a28e88a [media] drxk: prevent doing something wrong when init is not ok
If firmware is not loaded for some reason, or if it is not ready
yet, it makes no sense to honour to any DVB callbacks.

So, return -EAGAIN, as the error condition may be temporary.
If the device doesn't initialize, either because it requires a
firmware or because there's an error during init_drxk, returns
-ENODEV, to indicate such error, on all DVB callbacks.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-29 19:04:32 -03:00
Mauro Carvalho Chehab
20bfe7ae08 [media] drxk: Lock I2C bus during firmware load
Don't allow other devices at the same I2C bus to use it during
firmware load, in order to prevent using the device while it is
not on a sane state.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-29 19:04:21 -03:00
Mauro Carvalho Chehab
2a5f6720ff [media] drxk: pass drxk priv struct instead of I2C adapter to i2c calls
As it will be using the unlocked version of i2c_transfer during
firmware loads, make sure that the priv state routine will be
used on all I2C calls, in preparation for the next patch that
will implement an exclusive lock mode to be used during firmware
load, at drxk_init.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-29 19:04:12 -03:00
Mauro Carvalho Chehab
177bc7dade [media] drxk: change it to use request_firmware_nowait()
The firmware blob may not be available when the driver probes.

Instead of blocking the whole kernel use request_firmware_nowait() and
continue without firmware.

This shouldn't be that bad on drx-k devices, as they all seem to have an
internal firmware. So, only the firmware update will take a little longer
to happen.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-29 19:03:56 -03:00
Mauro Carvalho Chehab
a99817ca60 Merge branch 'v4l_for_linus' into staging/for_v3.6
* v4l_for_linus: (44 commits)
  [media] smia: Fix compile failures
  [media]  Fix VIDIOC_DQEVENT docbook entry
  [media] s5p-fimc: Fix control creation function
  [media] s5p-mfc: Fix checkpatch error in s5p_mfc_shm.h file
  [media] s5p-mfc: Fix setting controls
  [media] v4l/s5p-mfc: added image size align in VIDIOC_TRY_FMT
  [media] v4l/s5p-mfc: corrected encoder v4l control definitions
  [media] v4l: mem2mem_testdev: Fix race conditions in driver
  [media] s5p-mfc: Bug fix of timestamp/timecode copy mechanism
  [media] cxd2820r: Fix an incorrect modulation type bitmask
  [media] em28xx: Show a warning if the board does not support remote controls
  [media] em28xx: Add remote control support for Terratec's Cinergy HTC Stick HD
  [media] USB: Staging: media: lirc: initialize spinlocks before usage
  [media] Revert "[media] media: mx2_camera: Fix mbus format handling"
  [media] bw-qcam: driver and pixfmt documentation fixes
  [media] cx88: fix firmware load on big-endian systems
  [media] cx18: support big-endian systems
  [media] ivtv: fix support for big-endian systems
  [media] tuner-core: return the frequency range of the correct tuner
  [media] v4l2-dev.c: fix g_parm regression in determine_valid_ioctls()
  ...

Conflicts:
	Documentation/DocBook/media/v4l/vidioc-create-bufs.xml
	drivers/media/video/em28xx/em28xx-cards.c
2012-06-27 08:57:09 -03:00
Benoît Thébaudeau
81d75e9f56 [media] media: gpio-ir-recv: switch to module_platform_driver
Cc: Ravi Kumar V <kumarrav@codeaurora.org>
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-25 16:15:36 -03:00
Benoît Thébaudeau
2bd237b8a4 [media] media: gpio-ir-recv: add map name
Make it possible for gpio-ir-recv users to choose a map name.

Cc: Ravi Kumar V <kumarrav@codeaurora.org>
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-25 14:37:52 -03:00
Benoît Thébaudeau
975ef32e7e [media] media: gpio-ir-recv: fix missing udev by-path entry
Add missing information so that udev can create an entry for gpio-ir-recv under
/dev/input/by-path/ .

Cc: Ravi Kumar V <kumarrav@codeaurora.org>
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-25 14:37:46 -03:00
Ondrej Zary
6b39023a36 [media] radio-sf16fmi: Use LM7000 driver
Convert radio-sf16fmi to use generic LM7000 driver.
Tested with SF16-FMI, SF16-FMP and SF16-FMD.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-25 11:08:33 -03:00
Ondrej Zary
39cca6b821 [media] radio-aimslab: Use LM7000 driver
Convert radio-aimslab to use generic LM7000 driver.
Tested with Reveal RA300.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-25 11:07:50 -03:00
Ondrej Zary
72a770c94d [media] radio: Add Sanyo LM7000 tuner driver
Add very simple driver for Sanyo LM7000 AM/FM tuner chip. Only FM is supported
as there is no known HW with AM implemented.

This will be used by radio-aimslab and radio-sf16fmi.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-25 11:07:27 -03:00
Mauro Carvalho Chehab
f6d1b15c15 Revert "[media] radio: Add Sanyo LM7000 tuner driver"
This reverts commit 4ecbb69414.

As requested by Hans Verkuil:
> You accidentally merged the wrong first version of the lm7000 patch series.
>
> These are the correct second version patches:
>
> http://patchwork.linuxtv.org/patch/11689/
> http://patchwork.linuxtv.org/patch/11690/
> http://patchwork.linuxtv.org/patch/11691/
>
> The second version is much simpler and doesn't require the creation of a whole
> new driver.

Requested-by: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-25 11:06:59 -03:00
Mauro Carvalho Chehab
8f7fa3c801 Revert "[media] radio-aimslab: Use LM7000 driver"
This reverts commit bece083a6b.

As requested by Hans Verkuil:
> You accidentally merged the wrong first version of the lm7000 patch series.
>
> These are the correct second version patches:
>
> http://patchwork.linuxtv.org/patch/11689/
> http://patchwork.linuxtv.org/patch/11690/
> http://patchwork.linuxtv.org/patch/11691/
>
> The second version is much simpler and doesn't require the creation of a whole
> new driver.

Requested-by: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-25 11:06:54 -03:00
Mauro Carvalho Chehab
6d642d2606 Revert "[media] radio-sf16fmi: Use LM7000 driver"
This reverts commit 1e70a6cf7e.

As requested by Hans Verkuil:
> You accidentally merged the wrong first version of the lm7000 patch series.
>
> These are the correct second version patches:
>
> http://patchwork.linuxtv.org/patch/11689/
> http://patchwork.linuxtv.org/patch/11690/
> http://patchwork.linuxtv.org/patch/11691/
>
> The second version is much simpler and doesn't require the creation of a whole
> new driver.

Requested-by: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-25 11:05:15 -03:00
Daniel Glöckner
7bcfdf0f70 [media] tvaudio: rename getmode and setmode
This is basically s/getmode/getrxsubchans/ and s/setmode/setaudmode/
with some whitespace adjustment in affected lines to please the eye.
The rename is done to point out their relation to the rxsubchans and
audmode fields of struct v4l2_tuner.

I also corrected a commented out call to v4l_dbg in one of the lines.

Signed-off-by: Daniel Glöckner <daniel-gl@gmx.net>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-25 11:01:29 -03:00
Peter Senna Tschudin
3f7c0a69ab [media] s5h1420: Unused variable clock_setting
The switch/case was setting clock_setting that is not being used. Both switch/case and the variable definition were removed.

Currently clock is being calculated by the formula:
(state->fclk/1000000 - 8)

Tested by compilation only.

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 18:01:54 -03:00
Peter Senna Tschudin
59f6a93fae [media] stv090x: variable 'no_signal' set but not used
Tested by compilation only.

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 17:58:05 -03:00
Peter Senna Tschudin
df1ec0272f [media] stv0367: variable 'tps_rcvd' set but not used
Tested by compilation only.

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 17:57:22 -03:00
Peter Senna Tschudin
3e9e0ca227 [media] saa7164: Variable set but not used
In function saa7164_api_i2c_read variable regval was set but not used.

Tested by compilation only.

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 17:54:17 -03:00
Peter Senna Tschudin
503d194956 [media] pvrusb2: Variables set but not used
Tested by compilation only.

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 17:07:08 -03:00
Peter Senna Tschudin
adb609666b [media] cx231xx: Paranoic stack memory save
Saves 255 bytes of stack memory on cx231xx_usb_probe() by removing a char array.

Tested by compilation only.

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 17:05:13 -03:00
Peter Meerwald
22cf83fa43 [media] [trivial] v4l drivers: typo, change ctruct to struct in comment
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 16:30:09 -03:00
Paul Bolle
17bd27bd78 [media] stradis: remove unused V4L1 headers
Commit 39c3d48845 ("[media] cpia, stradis:
remove deprecated V4L1 drivers") removed the last file including these
five headers. Apparently it was just an oversight to keep them in the
tree. They can safely be removed now.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 14:43:04 -03:00
Martin Blumenstingl
c8dce0088a [media] em28xx: Improve support for the Terratec Cinergy HTC Stick HD
The windows driver used different values for the GPIOs and analog
decoder configuration. The values from the windows driver are now
used.
It also seems that the windows driver has LNA always disabled.
Thus we are doing the same (using the same flags as on windows).

I (only) tested with DVB-T and it worked quite well.

[mchehab@redhat.com: Fix merge conflicts and tested with DVB-C]
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 14:31:10 -03:00
Martin Blumenstingl
729841ed0f [media] em28xx: Add the DRX-K at I2C address 0x29 to the list of known I2C devices
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 12:20:22 -03:00
Ondrej Zary
1e70a6cf7e [media] radio-sf16fmi: Use LM7000 driver
Convert radio-sf16fmi to use generic LM7000 driver.
Tested with SF16-FMI, SF16-FMP and SF16-FMD.

radio.");
@@ -48,37 +50,40 @@ struct fmi
 	bool mute;
 	unsigned long curfreq; /* freq in kHz */
 	struct mutex lock;
+	struct lm7000 lm;
 };

 static struct fmi fmi_card;
 static struct pnp_dev *dev;
 bool pnp_attached;

-/* freq is in 1/16 kHz to internal number, hw precision is 50 kHz */
-/* It is only useful to give freq in interval of 800 (=0.05Mhz),
- * other bits will be truncated, e.g 92.7400016 -> 92.7, but
- * 92.7400017 -> 92.75
- */
-#define RSF16_ENCODE(x)	((x) / 800 + 214)
 #define RSF16_MINFREQ (87 * 16000)
 #define RSF16_MAXFREQ (108 * 16000)

-static void outbits(int bits, unsigned int data, int io)
+#define FMI_BIT_TUN_CE		(1 << 0)
+#define FMI_BIT_TUN_CLK		(1 << 1)
+#define FMI_BIT_TUN_DATA	(1 << 2)
+#define FMI_BIT_VOL_SW		(1 << 3)
+#define FMI_BIT_TUN_STRQ	(1 << 4)
+
+void fmi_set_pins(struct lm7000 *lm, u8 pins)
 {
-	while (bits--) {
-		if (data & 1) {
-			outb(5, io);
-			udelay(6);
-			outb(7, io);
-			udelay(6);
-		} else {
-			outb(1, io);
-			udelay(6);
-			outb(3, io);
-			udelay(6);
-		}
-		data >>= 1;
-	}

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 12:12:40 -03:00
Ondrej Zary
bece083a6b [media] radio-aimslab: Use LM7000 driver
Convert radio-aimslab to use generic LM7000 driver.
Tested with Reveal RA300.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 12:12:13 -03:00
Ondrej Zary
4ecbb69414 [media] radio: Add Sanyo LM7000 tuner driver
Add very simple driver for Sanyo LM7000 AM/FM tuner chip. Only FM is supported
as there is no known HW with AM implemented.

This will be used by radio-aimslab and radio-sf16fmi.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 12:12:03 -03:00
Ezequiel García
61bdbef063 [media] em28xx: Make a few drxk_config structs static
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 11:56:32 -03:00
Ezequiel García
9f98f7bbaf [media] em28xx: Remove unused AC97 register definitions
There is a specific header sound/ac97_codec.h that defines these.
All drivers should use it instead of rolling its own set of macros.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 11:29:04 -03:00
Ezequiel García
67b8d03309 [media] em28xx: Rename AC97 registers to use sound/ac97_codec.h definitions
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 11:28:48 -03:00
Ezequiel García
2acde1d95f [media] em28xx: Fix wrong AC97 mic register usage
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 11:28:31 -03:00
Hans Verkuil
587a5765b2 [media] zr364xx: add suspend/resume support
And fix initial control setup.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 11:27:52 -03:00
Hans Verkuil
a065729d12 [media] zr364xx: allow multiple opens
This driver allowed only one open filehandle. This is against the spec, so
fix the driver by assigning proper ownership when streaming.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 11:27:21 -03:00
Hans Verkuil
5d317abe7b [media] zr364xx: add support for control events
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 11:26:32 -03:00
Hans Verkuil
df462902ea [media] zr364xx: fix querycap and fill in colorspace
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 11:25:37 -03:00
Hans Verkuil
1fc21a1979 [media] zr364xx: convert to the control framework
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 11:25:19 -03:00
Hans Verkuil
a906f62f57 [media] zr364xx: introduce v4l2_device
Implement struct v4l2_device: use the core lock and use the v4l2_device
release() callback.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 11:24:35 -03:00
Hans Verkuil
2b99251f17 [media] zr364xx: embed video_device and register it at the end of probe
Embed the video_device struct instead of allocating it and register it as
the last thing in probe().

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21 11:23:09 -03:00
Hans Verkuil
54f6019b58 [media] S_HW_FREQ_SEEK: set capability flags and return ENODATA instead of EAGAIN
Set the new capability flags in G_TUNER and return ENODATA if no channels
were found.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 20:52:51 -03:00
Daniel Glöckner
1884e298c1 [media] tvaudio: don't report mono when stereo is received
The V4L2 spec says reporting mono and stereo at the same time means
the hardware can not distinguish between the two. So when we can,
we should report only one of them.

Signed-off-by: Daniel Glöckner <daniel-gl@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 20:46:42 -03:00
Daniel Glöckner
9e019e075e [media] tvaudio: support V4L2_TUNER_MODE_LANG1_LANG2
Many of the audio decoders handled by the driver support this mode,
so the driver should support it as well.

Coding style errors are done to blend into the surrounding code.

Signed-off-by: Daniel Glöckner <daniel-gl@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 20:46:41 -03:00
Daniel Glöckner
e21adca897 [media] tvaudio: obey V4L2 tuner audio matrix
V4L2 specifies the audio mode to use for combinations of possible
(rxsubchans) and requested (audmode) audio modes. Up to now tvaudio
has made these decisions automatically based on the possible audio
modes from setting of the frequency until VIDIOC_S_TUNER was called.
It then forced the hardware to use the mode requested by the user.
With this patch it continues to adjust the audio mode while taking
the requested mode into account.

Signed-off-by: Daniel Glöckner <daniel-gl@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 20:46:40 -03:00
Daniel Glöckner
3322a59e09 [media] tvaudio: use V4L2_TUNER_SUB_* for bitfields
The V4L2_TUNER_MODE_* constants are not suited for use in bitfields.

Signed-off-by: Daniel Glöckner <daniel-gl@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 20:46:39 -03:00
Daniel Glöckner
f3647b14ff [media] tvaudio: don't use thread for TA8874Z
Judging from the data sheet it will automatically switch to the next
best audio mode in accordance with the V4L2 tuner audio matrix.

Signed-off-by: Daniel Glöckner <daniel-gl@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 20:46:38 -03:00
Daniel Glöckner
c799cfc57c [media] tvaudio: remove watch_stereo
It is never read and only assigned 0.

Signed-off-by: Daniel Glöckner <daniel-gl@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 20:46:37 -03:00
Daniel Glöckner
00fb18503f [media] tvaudio: use V4L2_TUNER_MODE_SAP for TDA985x SAP
As V4L2_TUNER_MODE_SAP == V4L2_TUNER_MODE_LANG2, we make
V4L2_TUNER_MODE_LANG1 equal to V4L2_TUNER_MODE_STEREO.

Signed-off-by: Daniel Glöckner <daniel-gl@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 20:46:36 -03:00
Daniel Glöckner
f952848ddd [media] tvaudio: fix tda8425_setmode
The passed audio mode is not a bitfield.

Signed-off-by: Daniel Glöckner <daniel-gl@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 20:46:34 -03:00
Daniel Glöckner
d59a14e2f9 [media] tvaudio: fix TDA9873 constants
These constants were unused so far but need | instead of &.

Signed-off-by: Daniel Glöckner <daniel-gl@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 20:46:33 -03:00
Peter Senna Tschudin
cb4f6818f8 [media] saa7146: Variable set but not used
In function fops_open variable type was set but not used. Tested by compilation only.

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Acked-by: Michael Hunold <michael@mihu.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 20:18:00 -03:00
Ezequiel García
87edb566ae [media] em28xx: Make em28xx_ir_change_protocol a static function
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 20:15:54 -03:00
Alan Cox
099987f0aa [media] smia: Fix compile failures
Fix compile of smia code.

Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=43337

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 19:52:05 -03:00
Kamil Debski
4c4ed22632 [media] s5p-fimc: Fix control creation function
Fixed the size of the V4L2_CID_COLORFX control cluster.
Prior to this fix V4L2_CID_ROTATE was also icluded in
the cluster preventing application from enabling rotation.

Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 19:49:27 -03:00
Sachin Kamat
618a2a3a72 [media] s5p-mfc: Fix checkpatch error in s5p_mfc_shm.h file
Fixes the following error:
ERROR: open brace '{' following enum go on the same line
+enum MFC_SHM_OFS
+{

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 19:49:06 -03:00
Kamil Debski
f60935c17f [media] s5p-mfc: Fix setting controls
Fixed s_ctrl function when setting the following controls:
- V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER
- V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 19:48:43 -03:00
Andrzej Hajda
0749ae3501 [media] v4l/s5p-mfc: added image size align in VIDIOC_TRY_FMT
Image size for MFC encoder should have size between
8x4 and 1920x1080 with even width and height.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 19:48:14 -03:00
Andrzej Hajda
afd14f48a7 [media] v4l/s5p-mfc: corrected encoder v4l control definitions
Patch corrects definition of H264 level control and
changes bare numbers to enums in two other cases.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 19:47:48 -03:00
Tomasz Moń
9f4161a6b8 [media] v4l: mem2mem_testdev: Fix race conditions in driver
The mem2mem_testdev allows multiple instances to be opened in parallel.
Source and destination queue data are being shared between all
instances, which can lead to kernel oops due to race conditions (most
likely to happen inside device_run()).

Attached patch fixes mentioned problem by storing queue data per device
context.

Signed-off-by: Tomasz Moń <desowin@gmail.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 19:45:59 -03:00
Kamil Debski
4e6bb2a5fb [media] s5p-mfc: Bug fix of timestamp/timecode copy mechanism
Fixed the code copying timecode/timestamp to corresponding
frames between OUTPUT and CAPTURE.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18 19:44:46 -03:00