Commit graph

483 commits

Author SHA1 Message Date
Hans Verkuil
c39ba33032 [media] cx88: consistently use UNSET for absent tuner
Don't mix UNSET and TUNER_ABSENT: you have to pick one or the other. For
this driver selecting UNSET to represent an absent tuner resulting in
the fewest changes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 08:35:34 -02:00
Hans Verkuil
078859a323 [media] cx88: don't allow changes while vb2_is_busy
Make sure that changing the standard or format is not allowed while
one or more of the video, vbi or mpeg vb2 queues are busy.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 08:34:33 -02:00
Hans Verkuil
fb37ab3e78 [media] cx88: drop mpeg_active field
The vb2 framework knows if streaming is in progress, no need to use
a separate field for that.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 08:33:29 -02:00
Hans Verkuil
ccd6f1d488 [media] cx88: move width, height and field to core struct
The width, height and field values are core fields since both vbi, video
and blackbird use the same video input.

Move those fields to the correct struct.

Also fix the field checks in the try_fmt functions: add V4L2_FIELD_SEQ_BT/TB
support and map incorrect field values to a correct field value instead of
returning an error.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 08:32:36 -02:00
Hans Verkuil
d386259f8e [media] cx88: don't pollute the kernel log
There is no reason to dump the sram code to the kernel log when you
stop streaming. Remove those calls to cx88_sram_channel_dump.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 08:31:01 -02:00
Hans Verkuil
b8f884164b [media] cx88: increase API command timeout
The timeout is way too small. Especially complicated command like
CX2341X_ENC_STOP_CAPTURE takes much more time than 10 ms. Increase the
timeout to 1 second, just as ivtv does (the cx88-blackbird has the
same IP core for MPEG compression as ivtv).

This solves a nasty issue where STOP_CAPTURE would timeout and the
mailbox is left in a busy state, making it impossible to start streaming
a second time without reloading the driver first.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 08:30:26 -02:00
Hans Verkuil
5e7045e3fa [media] cx88: remove dependency on btcx-risc
btcx-risc is for the bt8xx driver and other drivers shouldn't depend
on it. There is no benefit to use that module just to do a
pci_zalloc_consistent.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 08:29:51 -02:00
Hans Verkuil
999b3ceb84 [media] cx88: drop cx88_free_buffer
Remove this function. This makes all vb2 queues behave the same, which
simplifies comparing the various vb2 queue op implementations.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 08:28:30 -02:00
Hans Verkuil
eddd326320 [media] cx88: return proper errors during fw load
Don't return -1, return a proper error.

Replace dprintk(0, ...) by pr_err since firmware load errors should just be
reported as an error.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 08:27:36 -02:00
Hans Verkuil
c79a23f33d [media] cx88: fix sparse warning
drivers/media/pci/cx88/cx88-blackbird.c:476:25: warning: cast to restricted __le32

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 08:26:59 -02:00
Hans Verkuil
0b6b6302d9 [media] cx88: convert to vb2
As usual, this patch is very large due to the fact that half a vb2 conversion
isn't possible. And since this affects blackbird, alsa, core, dvb, vbi and
video the changes are all over.

What made this more difficult was the peculiar way the risc program was setup.
The driver allowed for running out of buffers in which case the DMA would stop
and restart when the next buffer was queued. There was also a complicated
timeout system for when buffers weren't filled. This was replaced by a much
simpler scheme where there is always one buffer around and the DMA will just
cycle that buffer until a new buffer is queued. In that case the previous
buffer will be chained to the new buffer. An interrupt is generated at the
start of the new buffer telling the driver that the previous buffer can be
passed on to userspace.

Much simpler and more robust.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 08:26:33 -02:00
Hans Verkuil
b2c75abde0 [media] cx88: drop videobuf abuse in cx88-alsa
The alsa driver uses videobuf low-level functions that are not
available in vb2, so replace them by driver-specific functions.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 08:21:55 -02:00
Hans Verkuil
6f11adc6a5 [media] cx88: drop the bogus 'queue' list in dmaqueue
This list is only used if the width, height and/or format of a buffer has
changed, but that can never happen. Remove it and all associated code.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 08:21:24 -02:00
Hans Verkuil
637bc20796 [media] cx88: remove fmt from the buffer struct
This is a duplicate of dev->fmt and can be removed. As a consequence a
lot of tests that check if the format has changed midstream can be
removed as well: the format cannot change midstream, so this is a bogus
check.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 08:20:45 -02:00
nibble.max
d11a383509 [media] cx23885: add IR for DVBSky T9580 Dual DVB-S2/T2/C PCIe card
DVBSky T9580 uses Integrated CX23885 IR controller to decode IR signal.
The IR type of DVBSky remote control is RC5.

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-30 16:54:26 -02:00
Olli Salonen
24e774092f [media] cx23855: add CI support for DVBSky T980C
Add CI support for DVBSky T980C card. The new host device independent CIMaX SP2 I2C driver was used to implement it.

IRQ handling is not implemented at this point. It could be used to detect the CAM insertion/removal instantly.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-30 11:50:49 -02:00
Olli Salonen
e450de45f4 [media] cx23885: add I2C client for CI into state and handle unregistering
If the CI chip has an I2C driver, we need to store I2C client into state.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-30 11:48:39 -02:00
Olli Salonen
82c10276d4 [media] cx23855: add support for DVBSky T980C (no CI support)
This patch adds basic support for DVBSky T980C card. CI interface is not supported.

DVBSky T980C is a PCIe card with the following components:
- CX23885 PCIe bridge
- Si2168-A20 demodulator
- Si2158-A20 tuner
- CIMaX SP2 CI chip

The demodulator and tuner need firmware. They're the same as used with TT CT2-4650 CI:
https://www.mail-archive.com/linux-media@vger.kernel.org/msg78033.html

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-30 11:46:04 -02:00
Hans Verkuil
f2d90e6479 [media] tw68: remove bogus I2C_ALGOBIT dependency
tw68 doesn't use i2c at all, so remove this bogus dependency to prevent
this warning:

warning: (CAN_PEAK_PCIEC && SFC && IGB && VIDEO_TW68 && DRM && FB_DDC && FB_VIA) selects I2C_ALGOBIT which has unmet direct dependencies (I2C)
   CC [M]  drivers/i2c/algos/i2c-algo-bit.o
../drivers/i2c/algos/i2c-algo-bit.c: In function 'i2c_bit_add_bus':
../drivers/i2c/algos/i2c-algo-bit.c:658:33: error: 'i2c_add_adapter' undeclared (first use in this function)
../drivers/i2c/algos/i2c-algo-bit.c:658:33: note: each undeclared identifier is reported only once for each function it appears in
../drivers/i2c/algos/i2c-algo-bit.c: In function 'i2c_bit_add_numbered_bus':
../drivers/i2c/algos/i2c-algo-bit.c:664:33: error: 'i2c_add_numbered_adapter' undeclared (first use in this function)
../drivers/i2c/algos/i2c-algo-bit.c: In function 'i2c_bit_add_bus':
../drivers/i2c/algos/i2c-algo-bit.c:659:1: warning: control reaches end of non-void function [-Wreturn-type]
../drivers/i2c/algos/i2c-algo-bit.c: In function 'i2c_bit_add_numbered_bus':
../drivers/i2c/algos/i2c-algo-bit.c:665:1: warning: control reaches end of non-void function [-Wreturn-type]

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-24 09:30:55 -02:00
Fabian Frederick
a4789e6fc2 [media] tw68: remove deprecated IRQF_DISABLED
See include/linux/interrupt.h:
"This flag is a NOOP and scheduled to be removed"

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-24 09:29:53 -02:00
Olli Salonen
143800a577 [media] cx23885: initialize config structs for T9580
The config structs used for DVBSky T9580 were not initialized. This patch fixes that.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-21 08:54:42 -02:00
Antti Palosaari
cf3167cf1e [media] pt3: fix DTV FE I2C driver load error paths
Get rid of 'module_is_live' usage.

on x86_64:
when CONFIG_MODULES is not enabled:

../drivers/media/pci/pt3/pt3.c: In function 'pt3_attach_fe':
../drivers/media/pci/pt3/pt3.c:433:6: error: implicit declaration of function 'module_is_live' [-Werror=implicit-function-declaration]

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Akihiro Tsukada <tskd08@gmail.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-28 22:23:42 -03:00
Mauro Carvalho Chehab
339f06c5d3 [media] pci drivers: use %zu instead of %zd
size_t is unsigned.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-26 06:51:00 -03:00
Mauro Carvalho Chehab
84babee8fe [media] cx88: remove return after BUG()
As reported by smatch:

drivers/media/pci/cx88/cx88-video.c:699 get_queue() info: ignoring unreachable code.
drivers/media/pci/cx88/cx88-video.c:714 get_resource() info: ignoring unreachable code.
drivers/media/pci/cx88/cx88-video.c:815 video_read() info: ignoring unreachable code.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-26 06:47:57 -03:00
Mauro Carvalho Chehab
e2392d347e [media] cx88: fix cards table CodingStyle
This is actually a coding style issue, but it was generating lots
of smatch warnings:

drivers/media/pci/cx88/cx88-cards.c:1513:37: warning: Initializer entry defined twice
drivers/media/pci/cx88/cx88-cards.c:1517:19:   also defined here
drivers/media/pci/cx88/cx88-cards.c:1533:36: warning: Initializer entry defined twice
drivers/media/pci/cx88/cx88-cards.c:1538:19:   also defined here
...

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-26 06:47:56 -03:00
Mauro Carvalho Chehab
5a9ff85dc1 [media] saa7164-core: declare symbols as static
Those symbols are used only at saa7164-core.

drivers/media/pci/saa7164/saa7164-core.c:55:14: warning: symbol 'fw_debug' was not declared. Should it be static?
drivers/media/pci/saa7164/saa7164-core.c:75:14: warning: symbol 'print_histogram' was not declared. Should it be static?
drivers/media/pci/saa7164/saa7164-core.c:83:14: warning: symbol 'guard_checking' was not declared. Should it be static?

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-26 06:47:54 -03:00
Mauro Carvalho Chehab
87f4ebcd06 [media] sta2x11_vip: fix address space casting
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38: warning: incorrect type in argument 1 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38: warning: incorrect type in argument 1 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38: warning: incorrect type in argument 1 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38: warning: incorrect type in argument 1 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38: warning: incorrect type in argument 1 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38: warning: incorrect type in argument 1 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:1140:30: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:1140:30:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:1140:30:    got void volatile [noderef] <asn:2>*iomem
drivers/media/pci/sta2x11/sta2x11_vip.c:1184:30: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:1184:30:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:1184:30:    got void volatile [noderef] <asn:2>*iomem
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38: warning: incorrect type in argument 1 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38: warning: incorrect type in argument 1 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38: warning: incorrect type in argument 1 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38: warning: incorrect type in argument 1 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:226:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38: warning: incorrect type in argument 2 (different modifiers)
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    expected void [noderef] <asn:2>*<noident>
drivers/media/pci/sta2x11/sta2x11_vip.c:221:38:    got void volatile [noderef] <asn:2>*

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-26 06:47:53 -03:00
Olli Salonen
2944226622 [media] cx23855: add support for DVBSky T9580 DVB-C/T2/S2 tuner
DVBSky T9580 is a dual tuner card with one DVB-T2/C tuner and one DVB-S2 tuner. It contains the following components:

- PCIe bridge: Conexant CX23885
- Demod for terrestrial/cable: Silicon Labs Si2168-A30
- Tuner for terrestrial/cable: Silicon Labs Si2158-A20
- Demod for sat: Montage DS3103
- Tuner for sat: Montage TS2022

This patch depends on Max Nibble's patch for m88ds3103 (see patchwork 25312: https://patchwork.linuxtv.org/patch/25312/ ).

3 firmwares are needed:
- Si2168-A30 demod and Si2158-A20 tuner: same as TechnoTrend CT2-4400, https://www.mail-archive.com/linux-media@vger.kernel.org/msg76944.html
- Montage DS3103 demod: same as PCTV 461e, Antti has it on his LinuxTV project page: http://palosaari.fi/linux/v4l-dvb/firmware/M88DS3103/

IR receiver is not supported.

Values in cx23885_gpio_setup, cx23885_card_setup and dvbsky_t9580_set_voltage as well as the EEPROM read function are taken from the manufacturer provided semi-open source driver. The drivers in question are Linux GPL'd media tree drivers for cx23885 modified by Max Nibble (nibble.max@gmail.com) with proprietary tuner/demod drivers. Max is aware of this patch and has approved my use of the values in this patch.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23 21:33:16 -03:00
Olli Salonen
5cd3b6b40d [media] cx23855: add frontend set voltage function into state
Setting the LNB voltage requires setting some GPIOs on the cx23885 with some boards before calling the actual set_voltage function in the demod driver. Add a function pointer into state for that case.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23 21:30:43 -03:00
Olli Salonen
b0b12e63f9 [media] cx23885: add i2c client handling into dvb_unregister and state
Prepare cx23885 driver for handling I2C client that is needed for certain demodulators and tuners (for example Si2168 and Si2157). I2C client for tuner and demod stored in state and unregistering of the I2C devices added into dvb_unregister.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23 21:30:24 -03:00
Mauro Carvalho Chehab
49310ed0ab [media] pt3: make pt3_pm_ops() static
drivers/media/pci/pt3/pt3.c:862:1: warning: symbol 'pt3_pm_ops' was not declared. Should it be static?

Cc: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23 18:47:17 -03:00
Akihiro Tsukada
f5a98f37a5 [media] pt3: add support for Earthsoft PT3 ISDB-S/T receiver card
This patch adds support for PT3 PCIe cards.
PT3 has an FPGA PCIe bridge chip, a TC90522 demod chip and
a VA4M6JC2103 tuner module which contains two QM1D1C0042 chips for ISDB-S
and two MxL301RF's for ISDB-T.
It can receive and deliver 4 (2x ISDB-S, 2x ISDB-T) streams simultaneously,
and a kthread is used per stream to poll incoming data,
because PT3 does not have interrupts.

As an antenna input for each delivery system is split in the tuner module
and shared between the corresponding two tuner chips,
LNB/LNA controls that the FPGA chip provides are (naturally) shared as well.
The tuner chips also share the power line in the tuner module,
which is controlled on/off by a GPIO pin of the demod chip.

As with the demod chip and the ISDB-T tuner chip,
the init sequences/register settings for those chips are not disclosed
and stored in a private memory of the FPGA,
PT3 driver executes the init of those chips on behalf of their drivers.

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23 17:04:01 -03:00
Mauro Carvalho Chehab
8eb988f1be [media] saa7134: Remove unused status var
drivers/media/pci/saa7134/saa7134-go7007.c: In function ‘saa7134_go7007_interface_reset’:
drivers/media/pci/saa7134/saa7134-go7007.c:147:6: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
2014-09-23 16:13:48 -03:00
Mauro Carvalho Chehab
23ea6ec078 [media] saa7134: Remove some casting warnings
drivers/media/pci/saa7134/saa7134-go7007.c:247:17: warning: incorrect type in argument 1 (different base types)
drivers/media/pci/saa7134/saa7134-go7007.c:247:17:    expected unsigned int [unsigned] val
drivers/media/pci/saa7134/saa7134-go7007.c:247:17:    got restricted __le32 [usertype] <noident>
drivers/media/pci/saa7134/saa7134-go7007.c:252:17: warning: incorrect type in argument 1 (different base types)
drivers/media/pci/saa7134/saa7134-go7007.c:252:17:    expected unsigned int [unsigned] val
drivers/media/pci/saa7134/saa7134-go7007.c:252:17:    got restricted __le32 [usertype] <noident>
drivers/media/pci/saa7134/saa7134-go7007.c:299:9: warning: incorrect type in argument 1 (different base types)
drivers/media/pci/saa7134/saa7134-go7007.c:299:9:    expected unsigned int [unsigned] val
drivers/media/pci/saa7134/saa7134-go7007.c:299:9:    got restricted __le32 [usertype] <noident>
drivers/media/pci/saa7134/saa7134-go7007.c:300:9: warning: incorrect type in argument 1 (different base types)
drivers/media/pci/saa7134/saa7134-go7007.c:300:9:    expected unsigned int [unsigned] val
drivers/media/pci/saa7134/saa7134-go7007.c:300:9:    got restricted __le32 [usertype] <noident>

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23 16:13:47 -03:00
Mauro Carvalho Chehab
aff440fa61 [media] saa7134: Fix compilation breakage when go7007 is not selected
All error/warnings:

   drivers/built-in.o: In function `saa7134_go7007_fini':
>> saa7134-go7007.c:(.text+0x3b628b): undefined reference to `go7007_snd_remove'
   drivers/built-in.o: In function `saa7134_go7007_interface_reset':
>> saa7134-go7007.c:(.text+0x3b659a): undefined reference to `go7007_read_interrupt'
   drivers/built-in.o: In function `saa7134_go7007_init':
>> saa7134-go7007.c:(.text+0x3b65fa): undefined reference to `go7007_alloc'
>> saa7134-go7007.c:(.text+0x3b66ed): undefined reference to `go7007_boot_encoder'
>> saa7134-go7007.c:(.text+0x3b66fe): undefined reference to `go7007_register_encoder'
   drivers/built-in.o: In function `saa7134_go7007_irq_ts_done':
>> saa7134-go7007.c:(.text+0x3b6c2a): undefined reference to `go7007_parse_video_stream'
>> saa7134-go7007.c:(.text+0x3b6c86): undefined reference to `go7007_parse_video_stream'

This happens when:
 - VIDEO_SAA7134 is either 'm' or 'y'
 - VIDEO_GO7007 is not selected.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23 16:13:47 -03:00
Hans Verkuil
452015de2e [media] saa7134: add saa7134-go7007
This patch adds support to saa7134 for 'WIS Voyager or compatible' PCI boards
such as the Sensoray model 614 with which this patch was tested. It is a
saa7134-based PCI board with a go7007 MPEG encoder. This was a patch when the
go7007 was still in staging and was not applied when go7007 was moved to
drivers/media since it needed more work.

That work is now done and this last piece of go7007 support can now go in.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23 16:13:46 -03:00
Hans Verkuil
033d008821 [media] saa7134: also capture the WSS signal for 50 Hz VBI capture
The saa7134 driver missed capturing line 23 of the VBI area for the
50 Hz formats. Include that line in the VBI capture.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23 16:13:46 -03:00
Hans Verkuil
1c5eaa23d8 [media] cx23885: fix size helper functions
The norm_swidth function was unused and is dropped. It's not clear
what the purpose of that function was.

The norm_maxh function was changed so it tests for 60 Hz standards
rather than for 50 Hz standards. The is the preferred order.

The norm_maxw function was poorly written and used: it gives the maximum
allowed line width for the given standard. For 60 Hz that's 720, but
for 50 Hz that's 768 which allows for 768x576 which gives you square
pixels. For 60 Hz formats it is 640x480 that gives square pixels, so
there is no need to go beyond 720.

The initial width was set using norm_maxh(), which was wrong. Just set
to 720, that's what you normally use. Since the initial standard was
NTSC anyway the initial width was always 720 anyway.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 20:42:29 -03:00
Hans Verkuil
420b217619 [media] cx23885: fix VBI support
Tested VBI support and discovered that the wrong offset was used.
After this change it is now working. Verified with CC/XDS for NTSC
and WSS/Teletext on PAL.

It also reported the wrong start lines for the second field. That's
now fixed as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 20:41:34 -03:00
Mauro Carvalho Chehab
3cf0c6bd68 Merge remote-tracking branch 'linus/master' into patchwork
There are some patches that depends on media-v3.16-rc6.
So, merge back from upstream before applying them.

* linus/master: (1123 commits)
  drm/nouveau: ltc/gf100-: fix cbc issues on certain boards
  drm/bochs: add missing drm_connector_register call
  drm/cirrus: add missing drm_connector_register call
  staging: vt6655: buffer overflow in ioctl
  USB: storage: Add quirks for Entrega/Xircom USB to SCSI converters
  USB: storage: Add quirk for Ariston Technologies iConnect USB to SCSI adapter
  USB: storage: Add quirk for Adaptec USBConnect 2000 USB-to-SCSI Adapter
  USB: EHCI: unlink QHs even after the controller has stopped
  [SCSI] fix for bidi use after free
  [SCSI] fix regression that accidentally disabled block-based tcq
  [SCSI] libiscsi: fix potential buffer overrun in __iscsi_conn_send_pdu
  drm/radeon: Fix typo 'addr' -> 'entry' in rs400_gart_set_page
  drm/nouveau/runpm: fix module unload
  drm/radeon/px: fix module unload
  vgaswitcheroo: add vga_switcheroo_fini_domain_pm_ops
  drm/radeon: don't reset dma on r6xx-evergreen init
  drm/radeon: don't reset sdma on CIK init
  drm/radeon: don't reset dma on NI/SI init
  drm/radeon/dpm: fix resume on mullins
  drm/radeon: Disable HDP flush before every CS again for < r600
  ...
2014-09-21 16:40:04 -03:00
Hans Verkuil
91f96e8b72 [media] tw68: drop bogus cpu_to_le32() call
tw_writel maps to writel which maps to __raw_writel(__cpu_to_le32(b),addr).
So tw_writel already calls cpu_to_le32 and it shouldn't be called again
in the code.

Reported-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-08 16:40:54 -03:00
Hans Verkuil
947b38bb11 [media] tw68: simplify tw68_buffer_count
The code to calculate the maximum number of buffers allowed in 4 MB
is 1) wrong if PAGE_SIZE != 4096 and 2) unnecessarily complex.

Fix and simplify the code.

Reported-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-08 16:40:16 -03:00
Hans Verkuil
f1b6a73532 [media] cx23885: Add busy checks before changing formats
Before you can change the standard or the capture format, make sure the
various vb2_queues aren't in use since you cannot change the buffer size from
underneath a a busy vb2_queue.

Also make sure that the return code of cx23885_set_tvnorm is returned
correctly, otherwise the -EBUSY will be lost.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-08 10:01:01 -03:00
Hans Verkuil
4d63a25c45 [media] cx23885: remove btcx-risc dependency
It's just as easy to do it in the driver. This dependency only uses a
fraction of the btcx-risc module and doing it directly in the driver
adds only a few lines. The btcx-risc module is really meant for the
bttv driver, not for other drivers.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-08 10:01:00 -03:00
Hans Verkuil
96f233e975 [media] cx23885: fix field handling
Add missing SEQ_BT/TB support, bottom field is first for all 60 Hz formats,
not just NTSC, restore an overwritten field value and initialize dev->field
correctly.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-08 10:01:00 -03:00
Hans Verkuil
453afdd9ce [media] cx23885: convert to vb2
As usual, this patch is very large due to the fact that half a vb2 conversion
isn't possible. And since this affects 417, alsa, core, dvb, vbi and video the
changes are all over.

What made this more difficult was the peculiar way the risc program was setup.
The driver allowed for running out of buffers in which case the DMA would stop
and restart when the next buffer was queued. There was also a complicated
timeout system for when buffers weren't filled. This was replaced by a much
simpler scheme where there is always one buffer around and the DMA will just
cycle that buffer until a new buffer is queued. In that case the previous
buffer will be chained to the new buffer. An interrupt is generated at the
start of the new buffer telling the driver that the previous buffer can be
passed on to userspace.

Much simpler and more robust. The old code seems to be copied from the
cx88 driver. But it didn't fit the vb2 ops very well and replacing it with
the new scheme made the code easier to understand. Not to mention that this
patch removes 600 lines of code.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-08 10:00:59 -03:00
Mauro Carvalho Chehab
04da2daee3 [media] ngene: properly handle __user ptr
Sparse is complaining about ngene's bad usage of a __user ptr:

>> drivers/media/pci/ngene/ngene-dvb.c:62:48: sparse: incorrect type in argument 2 (different address spaces)
   drivers/media/pci/ngene/ngene-dvb.c:62:48:    expected unsigned char const [usertype] *buf
   drivers/media/pci/ngene/ngene-dvb.c:62:48:    got char const [noderef] <asn:1>*buf

As this is intercepting a .write() file ops, we can't just memcpy. We need to use
copy_from_user.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-08 10:00:52 -03:00
Mauro Carvalho Chehab
ce9e1ac1b9 [media] tw68: make tw68_pci_tbl static and constify
drivers/media/pci/tw68/tw68-core.c:72:22: warning: symbol 'tw68_pci_tbl' was not declared. Should it be static?

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-04 11:31:58 -03:00
Hans Verkuil
e15d1c12c5 [media] tw68: refactor and cleanup the tw68 driver
Refactor and clean up the tw68 driver. It's now using the proper
V4L2 core frameworks.

Tested with my Techwell tw6805a and tw6816 grabber boards.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-04 11:30:53 -03:00
Hans Verkuil
5740f4e75f [media] tw68: add original tw68 code
This tw68 driver has been out-of-tree for many years on gitorious:
https://gitorious.org/tw68/tw68-v2.

This copies that code to the kernel as a record of that original code.

Note that William Brack's email address in these sources is no longer
valid and I have not been able to contact him. However, all the code is
standard GPL.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-04 11:25:01 -03:00