Commit graph

21352 commits

Author SHA1 Message Date
Mauro Carvalho Chehab
2f684b239c [media] dvb: get rid of enum dmx_success
This enum is not actually used anymore. The only value used from
the enum is DMX_OK, passed as a parameter on two callbacks.

Yet, this value is not used anywhere. So, just remove it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-06 19:53:02 -03:00
Mauro Carvalho Chehab
4bc645df7d [media] DocBook: finish documenting struct dmx_demux
There are two callbacks still not documented:
	.//drivers/media/dvb-core/demux.h:422: warning: No description found for parameter 'get_pes_pids'
	.//drivers/media/dvb-core/demux.h:422: warning: No description found for parameter 'get_stc'

The purpose of first one is clear. The second one is used only
on the obsolete av7110 driver, and its purpose is not clear,
as it just returns a 64-bit word from the firmware to userspace.

Let's document get_pes_pids and mark get_stc as private, adding
a comment to not use it, while this is not documented.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-06 18:53:10 -03:00
Mauro Carvalho Chehab
1e92bbe08a [media] dvb: don't keep support for undocumented features
There are two DVB demux callbacks and ioctls that aren't documented
and aren't used at all by the DVB core or by any DVB driver upstream.

Let's comment out the code for those two ioctls and remove on some
future version.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-06 18:49:37 -03:00
Mauro Carvalho Chehab
28cff82ce2 [media] DocBook: update documented fields at struct dmx_demux
There are a few inconsistencies between the old documentation
that got imported into the header and the current status.

Update them, and use the proper doc-nano nomenclature for
struct artuments "@", instead of foo().

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-06 18:40:02 -03:00
Mauro Carvalho Chehab
95abfdb942 [media] DocBook: Move struct dmx_demux kABI doc to demux.h
The DocBook/media/dvb/kdapi.xml contains the description of
the kABI for DVB. The problem is that, by being maintained
on a separate file and not being updated for years, it got
outdated. So, for example, some callback parameters were
changed, but the DocBook were still using the old stuff.

As a first step to fix it, let's move the documentation of
struct dmx_demux into demux.h and fix the parameters used
there.

For now, don't document any other field nor touch the
descriptions that got moved, letting this job to other
patches. That makes easier to review the patch.

PS.: Please notice that an additional patch will be needed
in order to fix the return values (some uses non-existent
return codes) and to the functions and callbacks mentioned at
the descriptions.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-06 18:40:02 -03:00
Mauro Carvalho Chehab
bdbbf13e04 [media] dvb_ca_en50221.h: Make checkpatch.pl happy
There are several CodingStyle violations at the DVB code. While
we won't be fixing them as a hole, let's fix at least the
headers, as we're touching on them already in order to properly
document them.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-06 18:40:01 -03:00
Mauro Carvalho Chehab
d7061f836f [media] DocBook: document struct dvb_ca_en50221
This struct is already documented at the header file, but it is
not using Kernel doc-nano format. Convert to it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-06 18:40:01 -03:00
Rasmus Villemoes
f4f24d1fd0 [media] drxd: use kzalloc in drxd_attach()
This saves a little .text and removes the sizeof(...) style
inconsistency. Use sizeof(*state) in accordance with CodingStyle.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-03 11:44:32 -03:00
Fengguang Wu
edf8875f21 [media] i2c: fix platform_no_drv_owner.cocci warnings
drivers/media/i2c/ml86v7667.c:430:3-8: No need to set .owner here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-03 11:39:48 -03:00
Ezequiel Garcia
6903acde49 [media] vivid: Add an option to configure the maximum number of devices
The vivid driver currently has a hard-coded limit of 64 devices,
however there's nothing that prevents the creation of even more devices.
This commit adds a new driver option (which defaults to 64) to
allow this maximum number to be configurable.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-03 11:36:24 -03:00
Ezequiel Garcia
a5d42b8c3b [media] vivid: Fix iteration in driver removal path
When the diver is removed and all the resources are deallocated,
we should be iterating through the created devices only.

Currently, the iteration ends when vivid_devs[i] is NULL. Since
the array contains VIVID_MAX_DEVS elements, it will oops if
n_devs=VIVID_MAX_DEVS because in that case, no element is NULL.

Fixes: c88a96b023 ('[media] vivid: add core driver code')

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-03 11:35:44 -03:00
Andrzej Hajda
d2d04834d9 [media] media: am437x-vpfe: fix handling platform_get_irq result
The function can return negative value.

The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-03 11:34:52 -03:00
Andrzej Hajda
e54560d963 [media] cx231xx: fix handling cx231xx_read_i2c_data result
The function can return negative value.

The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-03 11:32:32 -03:00
Erik Andresen
2788052a8a [media] Add Terratec H7 Revision 4 to DVBSky driver
Adds Terratec H7 Rev. 4 with USB id 0ccd:10a5 to DVBSky driver.

Signed-off-by: Erik Andresen <erik@vontaene.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-03 11:08:12 -03:00
Geert Uytterhoeven
f84456466c [media] VIDEO_RENESAS_JPU should depend on HAS_DMA
If NO_DMA=y:

    warning: (VIDEO_STI_BDISP && VIDEO_RENESAS_JPU && VIDEO_DM365_VPFE && VIDEO_OMAP4) selects VIDEOBUF2_DMA_CONTIG which has unmet direct dependencies (MEDIA_SUPPORT && HAS_DMA)

    drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_mmap’:
    drivers/media/v4l2-core/videobuf2-dma-contig.c:207: error: implicit declaration of function ‘dma_mmap_coherent’
    drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_get_base_sgt’:
    drivers/media/v4l2-core/videobuf2-dma-contig.c:390: error: implicit declaration of function ‘dma_get_sgtable’

VIDEO_RENESAS_JPU selects VIDEOBUF2_DMA_CONTIG, which bypasses its
dependency on HAS_DMA.  Make VIDEO_RENESAS_JPU depend on HAS_DMA to fix
this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-03 10:01:48 -03:00
Graham Eccleston
702c287082 [media] Compro U650F support
Added Compro U650F to the rtl28xxu devices.

Signed-off-by: Graham Eccleston <grahameccleston_@hotmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-03 09:36:55 -03:00
Mauro Carvalho Chehab
996347612d [media] rcar_jpu: Fix namespace for two __be16 vars
Fixes those sparse warnings:
	drivers/media/platform/rcar_jpu.c:1150:51: warning: incorrect type in assignment (different base types)
	drivers/media/platform/rcar_jpu.c:1150:51:    expected unsigned short [unsigned] [short] [usertype] <noident>
	drivers/media/platform/rcar_jpu.c:1150:51:    got restricted __be16 [usertype] <noident>
	drivers/media/platform/rcar_jpu.c:1152:50: warning: incorrect type in assignment (different base types)
	drivers/media/platform/rcar_jpu.c:1152:50:    expected unsigned short [unsigned] [short] [usertype] <noident>
	drivers/media/platform/rcar_jpu.c:1152:50:    got restricted __be16 [usertype] <noident>

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 19:10:55 -03:00
Mauro Carvalho Chehab
5347f97c65 [media] c8sectpfe: fix namespace on memcpy/memset
Solves those sparse warnings:

drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c:1087:9: warning: incorrect type in argument 1 (different address spaces)
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c:1087:9:    expected void *<noident>
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c:1087:9:    got void [noderef] <asn:2>*<noident>
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c:1090:9: warning: incorrect type in argument 1 (different address spaces)
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c:1090:9:    expected void *<noident>
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c:1090:9:    got void [noderef] <asn:2>*

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 19:07:32 -03:00
Mauro Carvalho Chehab
de2ce8fd84 [media] mipi-csis: make sparse happy
Fix the namespace issue that causes this warning:

drivers/media/platform/exynos4-is/mipi-csis.c:709:17: warning: incorrect type in argument 2 (different address spaces)
drivers/media/platform/exynos4-is/mipi-csis.c:709:17:    expected void const *<noident>
drivers/media/platform/exynos4-is/mipi-csis.c:709:17:    got void [noderef] <asn:2>*

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 19:05:46 -03:00
Mauro Carvalho Chehab
340ccedb76 [media] netup_unidvb_ci: Fix dereference of noderef expression
Fix those sparse warnings:
	drivers/media/pci/netup_unidvb/netup_unidvb_ci.c:150:40: warning: dereference of noderef expression
	drivers/media/pci/netup_unidvb/netup_unidvb_ci.c:165:31: warning: dereference of noderef expression
	drivers/media/pci/netup_unidvb/netup_unidvb_ci.c:174:36: warning: dereference of noderef expression
	drivers/media/pci/netup_unidvb/netup_unidvb_ci.c:189:27: warning: dereference of noderef expression

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 19:02:45 -03:00
Mauro Carvalho Chehab
d91b1d912e [media] netup_unidvb: remove most of the sparse warnings
There is a mess at the namespace on netup_unidvb:

drivers/media/pci/netup_unidvb/netup_unidvb_core.c:192:41: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:192:41:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:192:41:    got restricted __le32 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:194:26: warning: cast removes address space of expression
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:194:26: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:194:26:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:194:26:    got unsigned short [usertype] *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:196:41: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:196:41:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:196:41:    got restricted __le32 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:198:26: warning: cast removes address space of expression
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:198:26: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:198:26:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:198:26:    got unsigned short [usertype] *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:210:37: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:210:37:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:210:37:    got restricted __le32 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:211:32: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:211:32:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:211:32:    got restricted __le32 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:213:33: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:213:33:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:213:33:    got restricted __le32 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:528:49: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:528:49:    expected void const volatile [noderef] <asn:2>*src
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:528:49:    got unsigned char [usertype] *
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:541:49: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:541:49:    expected void const volatile [noderef] <asn:2>*src
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:541:49:    got unsigned char [usertype] *
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:647:22: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:647:22:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:647:22:    got unsigned char [usertype] *addr_virt
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:650:22: warning: cast removes address space of expression
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:654:59: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:654:59:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:654:59:    got restricted __le32 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:655:56: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:655:56:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:655:56:    got restricted __le32 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:656:23: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:656:23:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:656:23:    got restricted __le32 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:658:31: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:658:31:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:658:31:    got restricted __le32 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:660:33: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:660:33:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:660:33:    got restricted __le32 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:81:25: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:81:25:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:81:25:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:82:38: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:82:38:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:82:38:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:104:33: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:104:33:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:104:33:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:105:47: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:105:47:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:105:47:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:112:33: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:112:33:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:112:33:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:113:47: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:113:47:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:113:47:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:132:36: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:132:36:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:132:36:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:133:32: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:133:32:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:133:32:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:134:32: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:134:32:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:134:32:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:135:32: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:135:32:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:135:32:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:136:27: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:136:27:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:136:27:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:137:27: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:137:27:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:137:27:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:144:28: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:144:28:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:144:28:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:150:34: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:150:34:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:150:34:    got unsigned char *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:157:34: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:157:34:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:157:34:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:158:29: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:158:29:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:158:29:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:165:35: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:165:35:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:165:35:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:170:34: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:170:34:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:170:34:    got unsigned char *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:181:34: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:181:34:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:181:34:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:182:29: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:182:29:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:182:29:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:189:29: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:189:29:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:189:29:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:191:37: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:191:37:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:191:37:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:192:35: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:192:35:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:192:35:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:194:21: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:194:21:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:194:21:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:195:9: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:195:9:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:195:9:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:195:9: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:195:9:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:195:9:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:195:9: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:195:9:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:195:9:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:205:47: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:205:47:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:205:47:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:206:29: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:206:29:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:206:29:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:272:53: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:272:53:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:272:53:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:274:53: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:274:53:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:274:53:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:323:22: warning: cast removes address space of expression
drivers/media/pci/netup_unidvb/netup_unidvb_ci.c:229:38: warning: cast removes address space of expression
drivers/media/pci/netup_unidvb/netup_unidvb_ci.c:229:38: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_ci.c:229:38:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_ci.c:229:38:    got unsigned short [usertype] *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:89:25: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:89:25:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:89:25:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:96:46: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:96:46:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:96:46:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:97:25: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:97:25:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:97:25:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:98:49: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:98:49:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:98:49:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:116:44: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:116:44:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:116:44:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:117:23: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:117:23:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:117:23:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:132:48: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:132:48:    expected void volatile [noderef] <asn:2>*dst
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:132:48:    got unsigned char *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:136:46: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:136:46:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:136:46:    got unsigned char *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:144:37: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:144:37:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:144:37:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:145:25: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:145:25:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:145:25:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:154:52: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:154:52:    expected void const volatile [noderef] <asn:2>*src
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:154:52:    got unsigned char *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:205:23: warning: cast removes address space of expression
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:206:24: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:206:24:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:206:24:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:243:25: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:243:25:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:243:25:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:244:46: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:244:46:    expected void volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:244:46:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:245:25: warning: incorrect type in argument 1 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:245:25:    expected void const volatile [noderef] <asn:2>*addr
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:245:25:    got restricted __le16 *<noident>
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:246:49: warning: incorrect type in argument 2 (different address spaces)
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c:246:49:    expected void volatile [noderef] <asn:2>*addr

Fix the above sparse warnings.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 18:57:35 -03:00
Mauro Carvalho Chehab
c84a71c85b [media] s5c73m3: fix a sparse warning
drivers/media/i2c/s5c73m3/s5c73m3-core.c:170:39: warning: incorrect type in argument 1 (different base types)
drivers/media/i2c/s5c73m3/s5c73m3-core.c:170:39:    expected restricted __be16 const [usertype] *p
drivers/media/i2c/s5c73m3/s5c73m3-core.c:170:39:    got unsigned short [usertype] *<noident>

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 18:12:39 -03:00
Mauro Carvalho Chehab
ef69ee1bc2 [media] media-entity.c: get rid of var length arrays
Fix those sparse warnings:
	drivers/media/media-entity.c:238:17: warning: Variable length array is used.
	drivers/media/media-entity.c:239:17: warning: Variable length array is used.

That allows sparse and other code check tools to verify if the
function is using more stack than allowed.

It also solves a bad Kernel pratice of using var length arrays
at the stack.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 18:10:05 -03:00
Mauro Carvalho Chehab
ca739eb086 Revert "[media] rcar_vin: call g_std() instead of querystd()"
As pointed by Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
this patch depends on two adv7180 patches that got rejected.

This reverts commit f00ae754c5.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 15:49:17 -03:00
Mauro Carvalho Chehab
5a11cb1cd4 [media] dvbdev: Remove two cut-and-paste errors
Those two came from dvb_register_adapter cut-and-paste:

	.//drivers/media/dvb-core/dvbdev.h:199: warning: Excess function parameter 'device' description in 'dvb_register_device'
	.//drivers/media/dvb-core/dvbdev.h:199: warning: Excess function parameter 'adapter_nums' description in 'dvb_register_device'

Remove them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 09:18:09 -03:00
Mauro Carvalho Chehab
b0dcc5f612 [media] s5p-jpeg: remove unused var
changeset 6c96dbbc2a added a new function that seems to be
a modified version of an existing function. That's ok, but
it was adding a "word" var from the previous code that it is
not used on the new function. So, remove this left-over.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 09:10:06 -03:00
Junghak Sung
2d7007153f [media] media: videobuf2: Restructure vb2_buffer
Remove v4l2 stuff - v4l2_buf, v4l2_plane - from struct vb2_buffer.

Add new member variables - bytesused, length, offset, userptr, fd,
data_offset - to struct vb2_plane in order to cover all information
of v4l2_plane.
struct vb2_plane {
        <snip>
        unsigned int            bytesused;
        unsigned int            length;
        union {
                unsigned int    offset;
                unsigned long   userptr;
                int             fd;
        } m;
        unsigned int            data_offset;
}

Replace v4l2_buf with new member variables - index, type, memory - which
are common fields for buffer management.
struct vb2_buffer {
        <snip>
        unsigned int            index;
        unsigned int            type;
        unsigned int            memory;
        unsigned int            num_planes;
        struct vb2_plane        planes[VIDEO_MAX_PLANES];
        <snip>
};

v4l2 specific fields - flags, field, timestamp, timecode,
sequence - are moved to vb2_v4l2_buffer in videobuf2-v4l2.c
struct vb2_v4l2_buffer {
        struct vb2_buffer       vb2_buf;

        __u32                   flags;
        __u32                   field;
        struct timeval          timestamp;
        struct v4l2_timecode    timecode;
        __u32                   sequence;
};

Signed-off-by: Junghak Sung <jh1009.sung@samsung.com>
Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com>
Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 09:04:43 -03:00
Junghak Sung
c139990e84 [media] media: videobuf2: Replace videobuf2-core with videobuf2-v4l2
Make videobuf2-v4l2 as a wrapper of videobuf2-core for v4l2-use.
And replace videobuf2-core.h with videobuf2-v4l2.h.
This renaming change should be accompanied by the modifications
of all device drivers that include videobuf2-core.h.
It can be done with just running this shell script.

replace()
{
str1=$1
str2=$2
dir=$3
for file in $(find $dir -name *.h -o -name *.c -o -name Makefile)
do
    echo $file
    sed "s/$str1/$str2/g" $file > $file.out
    mv $file.out $file
done
}

replace "videobuf2-core" "videobuf2-v4l2" "include/media/"
replace "videobuf2-core" "videobuf2-v4l2" "drivers/media/"
replace "videobuf2-core" "videobuf2-v4l2" "drivers/usb/gadget/"
replace "videobuf2-core" "videobuf2-v4l2" "drivers/staging/media/"

Signed-off-by: Junghak Sung <jh1009.sung@samsung.com>
Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com>
Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:48:18 -03:00
Benoit Parrot
a807773405 [media] media: v4l2-ctrls: Fix 64bit support in get_ctrl()
When trying to use v4l2_ctrl_g_ctrl_int64() to retrieve a
V4L2_CTRL_TYPE_INTEGER64 type value the internal helper function
get_ctrl() would prematurely exit because for this control type
the 'is_int' flag is not set. This would result in v4l2_ctrl_g_ctrl_int64
always returning 0.

Also v4l2_ctrl_g_ctrl_int64() is reading and returning the 32bit value
member instead of the 64bit version, so fixing that as well.

This patch extends the condition check to allow the V4L2_CTRL_TYPE_INTEGER64
type to continue processing instead of exiting.

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org>      # for v3.17 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:43:41 -03:00
Luis de Bethencourt
d275d93590 [media] cx25821, cx88, tm6000: use SNDRV_DEFAULT_ENABLE_PNP
Instead of manually initializing the bool array enable, use the
SNDRV_DEFAULT_ENABLE_PNP macro. As most drivers do.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:42:52 -03:00
Hans Verkuil
fc88dd16a0 [media] cobalt: fix Kconfig dependency
The cobalt driver should depend on VIDEO_V4L2_SUBDEV_API.

This fixes this kbuild error:

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   99bc7215bc
commit: 85756a069c [media] cobalt: add new driver
config: x86_64-randconfig-s0-09201514 (attached as .config)
reproduce:
  git checkout 85756a069c
  # save the attached .config to linux build tree
  make ARCH=x86_64

All error/warnings (new ones prefixed by >>):

   drivers/media/i2c/adv7604.c: In function 'adv76xx_get_format':
>> drivers/media/i2c/adv7604.c:1853:9: error: implicit declaration of function 'v4l2_subdev_get_try_format' [-Werror=implicit-function-declaration]
      fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
            ^
   drivers/media/i2c/adv7604.c:1853:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
      fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
          ^
   drivers/media/i2c/adv7604.c: In function 'adv76xx_set_format':
   drivers/media/i2c/adv7604.c:1882:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
      fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
          ^
   cc1: some warnings being treated as errors

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:42:32 -03:00
Javier Martinez Canillas
c7d97499cc [media] tvp5150: add support for asynchronous probing
Allow the subdevice to be probed asynchronously.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:42:00 -03:00
Joe Perches
f5b5fbd387 [media] s5p-mfc: Correct misuse of %0x<decimal>
Correct misuse of 0x%d in logging message.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:41:29 -03:00
Andrzej Pietrasiewicz
6c96dbbc2a [media] s5p-jpeg: add support for 5433
JPEG IP found in Exynos5433 is similar to what is in Exynos4, but
there are some subtle differences which this patch takes into account.

The most important difference is in what is processed by the JPEG IP and
what has to be provided to it. In case of 5433 the IP does not parse
Huffman and quantisation tables, so this has to be performed with the CPU
and the majority of the code in this patch does that.

A small but important difference is in what address is passed to the JPEG
IP. In case of 5433 it is the SOS (start of scan) position, which is
natural, because the headers must be parsed elsewhere.

There is also a difference in how the hardware is put to work in
device_run.

Data structures are extended as appropriate to accommodate the above
changes.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Reviewed-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:40:04 -03:00
Marek Szyprowski
b95a24d6b1 [media] s5p-jpeg: generalize clocks handling
Allow jpeg codec variants declare clocks they need.
Before this patch is applied jpeg-core gets jpeg->sclk
"speculatively": if it is not there, we assume no problem.

This patch eliminates this by explicitly declaring
what clocks are needed for each variant.

This is a preparation for adding Exynos 5433 variant support, which
needs 4 clocks of names not compatible with any previous version of
jpeg hw module.

[Rebase and commit message]

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Reviewed-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:35:08 -03:00
Javier Martinez Canillas
5bcc0dd790 [media] go7007: Fix returned errno code in gen_mjpeghdr_to_package()
The driver is using -1 instead of the -ENOMEM defined macro to specify
that a buffer allocation failed. Since the error number is propagated,
the caller will get a -EPERM which is the wrong error condition.

Also, the smatch tool complains with the following warning:

gen_mjpeghdr_to_package() warn: returning -1 instead of -ENOMEM is sloppy

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:32:52 -03:00
Javier Martinez Canillas
5aa2ccfc37 [media] s5c73m3: Export OF module alias information
The SPI core always reports the MODALIAS uevent as "spi:<modalias>"
regardless of the mechanism that was used to register the device
(i.e: OF or board code) and the table that is used later to match
the driver with the device (i.e: SPI id table or OF match table).

So drivers needs to export the SPI id table and this be built into
the module or udev won't have the necessary information to autoload
the needed driver module when the device is added.

But this means that OF-only drivers needs to have both OF and SPI id
tables that have to be kept in sync and also the dev node compatible
manufacturer prefix is stripped when reporting the MODALIAS. Which can
lead to issues if two vendors use the same SPI device name for example.

To avoid the above, the SPI core behavior may be changed in the future
to not require an SPI device table for OF-only drivers and report the
OF module alias. So, it's better to also export the OF table even when
is unused now to prevent breaking module loading when the core changes.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:32:20 -03:00
Hans Verkuil
35204e2e84 [media] v4l2-ctrls: arrays are also considered compound controls
Array controls weren't skipped when only V4L2_CTRL_FLAG_NEXT_CTRL was
provided (so no V4L2_CTRL_FLAG_NEXT_COMPOUND was set). This is wrong
since arrays are also considered compound controls (i.e. with more than
one value), and applications that do not know about arrays will not
be able to handle such controls.

Fix the test to include arrays.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Cc: <stable@vger.kernel.org>      # for v3.17 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:30:25 -03:00
Arnd Bergmann
5ba0e2c3ad [media] use v4l2_get_timestamp where possible
This is a preparation for a change to the type of v4l2 timestamps.
v4l2_get_timestamp() is a helper function that reads the monotonic
time and stores it into a 'struct timeval'. Multiple drivers implement
the same thing themselves for historic reasons.

Changing them all to use v4l2_get_timestamp() is more consistent
and reduces the amount of code duplication, and most importantly
simplifies the following changes.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
[hans.verkuil@cisco.com: dropped the v4l2-dev.c patch that didn't belong here]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:29:23 -03:00
Arnd Bergmann
2ef3b6fe9e [media] exynos4-is: use monotonic timestamps as advertized
The exynos4 fimc capture driver claims to use monotonic
timestamps but calls ktime_get_real_ts(). This is both
an incorrect API use, and a bad idea because of the y2038
problem and the fact that the wall clock time is not reliable
for timestamps across suspend or settimeofday().

This changes the driver to use the normal v4l2_get_timestamp()
function like all other drivers.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:27:59 -03:00
Sergei Shtylyov
280e87b2e6 [media] ml86v7667: implement g_std() method
The driver was written with the 'soc_camera' use in mind, however the g_std()
video method was forgotten. Implement it at last...

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:27:22 -03:00
Hans Verkuil
225b783b38 [media] saa7164: video and vbi ports share the same input/tuner/std
The vbi port should pass any tuner/input/standard information on
to the video port since in the input and tuner are shared between
the two.

There is no reason to duplicate this code, just pass the ioctls on
to the video encoder port.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:26:53 -03:00
Hans Verkuil
6b99612606 [media] saa7164: fix input and tuner compliance problems
- the frequency range was never set
- there was no initial frequency
- missing index/tuner checks
- inconsistent standard reporting
- removed unnecessary tuner type checks (the core handles that)
- clamp frequency to the valid frequency range as per the V4L2 spec

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:25:53 -03:00
Hans Verkuil
4e203f7fdd [media] saa7164: remove unused videobuf references
This driver includes videobuf headers and selects VIDEOBUF_DVB, but
videobuf isn't used at all.

Remove this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:25:06 -03:00
Hans Verkuil
031d229772 [media] saa7164: fix format ioctls
Fix various v4l2-compliance issues in the formatting ioctls:

- the vbi device implemented video format ioctls which make no senses
  for a vbi device, remove them.
- remove the unused ts_packet_size and ts_packet_count fields.
- fill in colorspace and field.
- fill in sizeimage with a default value.
- for the video node the get, set and try format functions all do the
  same thing, so combine into a single function.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:24:40 -03:00
Hans Verkuil
245b5ae95f [media] saa7164: add support for control events
Now that saa7164 uses v4l2_fh and that poll() has been fixed, it is
trivial to add support for control events.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:23:29 -03:00
Hans Verkuil
45053edc05 [media] saa7164: fix poll bugs
- poll doesn't return negative values, so you can't return -EINVAL.
  Instead return POLLERR.
- poll can't be called if !video_is_registered(), so this test can
  be dropped.
- poll can never do a blocking wait, so remove that check.
- poll shouldn't attempt to start streaming if the caller isn't interested
  in read events.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:22:41 -03:00
Hans Verkuil
d6d3fe2fe1 [media] saa7164: add v4l2_fh support
Control events require the use of struct v4l2_fh. Add this to saa7164.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:13:58 -03:00
Hans Verkuil
1a708ea013 [media] saa7164: convert to the control framework
Convert this driver to the control framework. Note that the VBI device
nodes have no controls as there is nothing to control.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 08:13:26 -03:00
Ricardo Ribalda
28c5029275 [media] media/v4l2-compat-ioctl32: Simple stylechecks
The next patches on the series need this modifications to pass clean
checkpath.pl.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01 07:51:43 -03:00