Commit graph

20180 commits

Author SHA1 Message Date
Lars-Peter Clausen d5d51a827b [media] adv7180: Add media controller support
Add media controller support to the adv7180 driver by registering a media
entity instance for it as well as implementing pad ops for configuring the
format.

As there currently don't seem to be any users of the video ops format
operations those are removed as well in this patch.

Also set the V4L2_SUBDEV_FL_HAS_DEVNODE flag for the subdevice so it is
possible to create a subdevice device node.

Since the driver now depends on VIDEO_V4L2_SUBDEV_API all drivers which
select the driver need to depend on that symbol as well.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:45:35 -02:00
Lars-Peter Clausen c18818e990 [media] adv7180: Reset the device before initialization
Reset the device when initializing it so it is in a good known state and the
assumed register settings matches the actual register settings.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:40:50 -02:00
Lars-Peter Clausen 3999e5d01d [media] adv7180: Do implicit register paging
The ad7180 has multiple register pages which can be switched between by
writing to a register. Currently the driver manually switches between pages
whenever a register outside of the default register map is accessed and
switches back after it has been accessed. This is a bit tedious and also
potential source for bugs.

This patch adds two helper functions that take care of switching between
pages and reading/writing the register. The register numbers for registers
are updated to encode both the page (in the upper 8-bits) and the register
(in the lower 8-bits) numbers.

Having multiple pages means that a register access is not a single atomic
i2c_smbus_write_byte_data() or i2c_smbus_read_byte_data() call and we need
to make sure that concurrent register access does not race against each
other.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:40:14 -02:00
Lars-Peter Clausen 029d617791 [media] adv7180: Cleanup register define naming
Consistently prefix register defines with ADV7180_REG. Also remove the "ADI"
from register names, the ADV7180 prefix should provide enough of a namespace
separation.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:30:32 -02:00
Lars-Peter Clausen f3e991d418 [media] adv7180: Pass correct flags to request_threaded_irq()
Most IRQ controllers support different types of interrupts. The adv7180
generates falling edge interrupts, so make sure to pass IRQF_TRIGGER_FALLING
to request_threaded_irq() so the IRQ controller is configured for the
correct mode.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:15:53 -02:00
Lars-Peter Clausen fa5721d159 [media] adv7180: Do not request the IRQ again during resume
Currently the IRQ is requested from within the init_device() function. This
function is not only called during device probe, but also during resume
causing the driver to try to request the IRQ again. Move requesting the IRQ
from init_device() to the probe function to make sure that it is only
requested once.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:15:03 -02:00
Arnd Bergmann 24692801a4 [media] davinci: add V4L2 dependencies
The davinci media drivers use videobuf2, which they enable through
a 'select' statement. If one of these drivers is built-in, but
the v4l2 core is a loadable modules, we end up with a link
error:

drivers/built-in.o: In function `vb2_fop_mmap':
:(.text+0x113e84): undefined reference to `video_devdata'
drivers/built-in.o: In function `vb2_ioctl_create_bufs':
:(.text+0x114710): undefined reference to `video_devdata'
drivers/built-in.o: In function `vb2_ioctl_reqbufs':
:(.text+0x114ed8): undefined reference to `video_devdata'
drivers/built-in.o: In function `vb2_ioctl_querybuf':
:(.text+0x115530): undefined reference to `video_devdata'

To solve this, we need to add a dependency on VIDEO_V4L2,
which enforces that the davinci drivers themselves can only
be loadable modules if V4L2 is not built-in, and they do
not cause the videobuf2 code to be built-in.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:09:02 -02:00
Hans Verkuil eb79dbf6c2 [media] vivid: use consistent colorspace/Y'CbCr Encoding strings
Keep the colorspace and encoding names consistent with what is
used elsewhere (primarily the utilities in v4l-utils.git).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:08:28 -02:00
Arnd Bergmann 68998ea253 [media] siano: fix Kconfig dependencies
The USB and MMC front-ends to the siano driver both only make
sense when combined with the SMS_SIANO_MDTV driver. That driver
already requires RC_CORE to not be a module, so we also need
to add that dependency here.

drivers/built-in.o: In function `smssdio_remove':
:(.text+0x155bd8): undefined reference to `smscore_putbuffer'
:(.text+0x155bdc): undefined reference to `smscore_unregister_device'
drivers/built-in.o: In function `smssdio_interrupt':
:(.text+0x155e4c): undefined reference to `smsendian_handle_rx_message'
:(.text+0x155e50): undefined reference to `smscore_onresponse'
:(.text+0x155e54): undefined reference to `smscore_getbuffer'
:(.text+0x155e58): undefined reference to `smscore_putbuffer'
drivers/built-in.o: In function `smssdio_sendrequest':
:(.text+0x155f20): undefined reference to `smsendian_handle_tx_message'
drivers/built-in.o: In function `smssdio_probe':
:(.text+0x15610c): undefined reference to `sms_get_board'
:(.text+0x156114): undefined reference to `smscore_register_device'
:(.text+0x156118): undefined reference to `smscore_set_board_id'
:(.text+0x156128): undefined reference to `smscore_unregister_device'
:(.text+0x156140): undefined reference to `smscore_start_device'

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:08:02 -02:00
Arnd Bergmann cc287f7c40 [media] radio/aimslab: use mdelay instead of udelay
Large udelay values are not allowed on the ARM architecture
and result in a build error like

ERROR: "__bad_udelay" [drivers/media/radio/radio-aimslab.ko] undefined!

This changes the aimslab radio driver to use an equivalent mdelay
statement.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:07:09 -02:00
Arnd Bergmann 244829226f [media] timberdale: do not select TIMB_DMA
The timberdale media driver requires the use of the respective
dma engine driver, but that may not be enabled, causing a
Kconfig warning:

warning: (VIDEO_TIMBERDALE) selects TIMB_DMA which has unmet direct dependencies (DMADEVICES && MFD_TIMBERDALE)

This fixes the dependency by removing the inappropriate 'select'
statement and replacing it with a direct dependency on the
drivers that provide the services this needs.

Fixes: 7155043c2d ("[media] enable COMPILE_TEST for media drivers")

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 11:00:35 -02:00
Prabhakar Lad 42fd3638fa [media] media: am437x: fix sparse warnings
This patch fixes following spare warnings:

drivers/media/platform/am437x/am437x-vpfe.c:66:28: warning: symbol 'vpfe_standards' was not declared. Should it be static?
drivers/media/platform/am437x/am437x-vpfe.c:2202:57: warning: incorrect type in argument 2 (different address spaces)
drivers/media/platform/am437x/am437x-vpfe.c:2202:57:    expected void [noderef] <asn:1>*params
drivers/media/platform/am437x/am437x-vpfe.c:2202:57:    got void *param
include/linux/spinlock.h:364:9: warning: context imbalance in 'vpfe_start_streaming' - unexpected unlock

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:59:34 -02:00
Nicholas Mc Guire 3edf7eb83b [media] pvrusb2: use msecs_to_jiffies for conversion
This is only an API consolidation and should make things more readable

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:59:02 -02:00
Mauro Carvalho Chehab b5603a943d [media] cx231xx: don't use dev it not allocated
changeset 5eeb301482 added a fixup at the error check
code. However, it introduced a new error:

	drivers/media/usb/cx231xx/cx231xx-cards.c:1586 cx231xx_usb_probe() error: we previously assumed 'dev' could be null (see line 1430)

This happens when dev = kmalloc() fails. So, instead of relying
on it to succeed, just change the parameter of clear_bit() from
'dev->devno' to 'nr'.

Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:56:55 -02:00
Alexey Khoroshilov 5eeb301482 [media] cx231xx: fix usbdev leak on failure paths in cx231xx_usb_probe()
Commit b7085c0864 ("cx231xx: convert from pr_foo to dev_foo")
moves usb_get_dev(interface_to_usbdev(interface)) to the beginning
of cx231xx_usb_probe() to use udev->dev in dev_err(),
but it does not make sure usbdev is put on all failure paths.

Later dev_err(udev->dev) was replaced by dev_err(d).
So the patch moves usb_get_dev() below (before the first use)
and fixes another failure path.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:47:15 -02:00
William Towle e99f0115e5 [media] rcar_vin: move buffer management to .stop_streaming handler
This commit moves the "buffer in use" logic from the .buf_cleanup
handler into .stop_streaming, based on advice that this is its
proper logical home.

By ensuring the list of pointers in priv->queue_buf[] is managed
as soon as possible, we avoid warnings concerning buffers in ACTIVE
state when the system cleans up after streaming stops. This fixes a
problem with modification of buffers after their content has been
cleared for passing to userspace.

After the refactoring, the buf_init and buf_cleanup functions were
found to contain only initialisation/release steps as are carried out
elsewhere if omitted; these functions and references were removed.

Signed-off-by: William Towle <william.towle@codethink.co.uk>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:42:48 -02:00
Ian Molton 4abec46833 [media] rcar_vin: helper function for streaming stop
The code that tests that capture from a stream has stopped is
presently insufficient and the potential for a race condition
exists where frame capture may generate an interrupt between
requesting the capture process halt and freeing buffers.

This patch refactors code out of rcar_vin_videobuf_release() and
into rcar_vin_wait_stop_streaming(), and ensures there are calls
in places where we need to know that capturing has finished.

Signed-off-by: Ian Molton <ian.molton@codethink.co.uk>
Signed-off-by: William Towle <william.towle@codethink.co.uk>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:41:23 -02:00
Josh Wu 650b1815ff [media] ov2640: use the v4l2 size definitions
Reuse the v4l2 size definitions from v4l2-image-sizes.h.
So we can remove the rudundent definitions from ov2640.c.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:40:56 -02:00
Guennadi Liakhovetski 41bc765f1e [media] soc-camera: remove redundant code
A hunk, removing this code has been lost between versions 6 and 7 of
patch "soc-camera: add V4L2-async support." The code is harmless, but
redundant.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:40:25 -02:00
Lad, Prabhakar 976036df5e [media] soc_camera: use vb2_ops_wait_prepare/finish helper
This patch drops driver specific wait_prepare() and
wait_finish() callbacks from vb2_ops and instead uses
the the helpers vb2_ops_wait_prepare/finish() provided
by the vb2 core, the lock member of the queue needs
to be initalized to a mutex so that vb2 helpers
vb2_ops_wait_prepare/finish() can make use of it.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Cc: Josh Wu <josh.wu@atmel.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:40:02 -02:00
Philipp Zabel cb06b705e3 [media] coda: simplify check in coda_buf_queue
Now that the bitstream buffer is only allocated for the BIT decoder
case, we can use bitstream.size to check for bitstream ringbuffer
operation.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:38:21 -02:00
Philipp Zabel e55317e708 [media] coda: allocate bitstream ringbuffer only for BIT decoder
The BIT encoder does not use a per-context bitstream ringbuffer as it encodes
directly into the videobuf2 capture queue's buffers. Avoid allocation of the
bitstream ringbuffer for encoder contexts.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:37:56 -02:00
Philipp Zabel a22496c662 [media] coda: add support for contexts that do not use the BIT processor
In preparation for CODA9 JPEG support, allow contexts that
control hardware units directly, without the BIT processor.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:37:34 -02:00
Philipp Zabel 540d70d577 [media] coda: free context buffers under buffer mutex
Make sure the buffer_mutex lock is taken in coda_bit_release
while coda_free_framebuffers and coda_free_context_buffers
are called.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:32:25 -02:00
Philipp Zabel 747d764611 [media] coda: make seq_end_work optional
In preparation for CODA9 JPEG support, which doesn't have to call
SEQ_END on the BIT processor.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:32:05 -02:00
Philipp Zabel bb04aa6f7e [media] coda: switch BIT decoder source queue to vmalloc
Since we have to copy from input buffers into the bitstream ringbuffer
with the CPU, there is no need for contiguous DMA buffers on the decoder
input side.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:31:35 -02:00
Philipp Zabel 8e428d5040 [media] coda: add coda_estimate_sizeimage and use it in set_defaults
Call coda_estimate_sizeimage from both try_fmt and set_defaults to
avoid this v4l2-compliance warning on the h.264 decoder video device:

    G_FMT:     1920x1088, 32315559, 1, 1920, 1048576, 3, 0, 0, feedcafe
    TRY/S_FMT: 1920x1088, 32315559, 1, 1920, 3133440, 3, 0, 0, feedcafe
    fail: v4l2-test-formats.cpp(948): Video Capture: S_FMT(G_FMT) != G_FMT

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:31:10 -02:00
Philipp Zabel e3cccff9aa [media] coda: don't ever use subsampling ping-pong buffers as reconstructed reference buffers
On i.MX6, two subsampling ping-pong buffers are used for motion estimation and
deblocking They should not be counted as framebuffers, or they will be also used
to store reconstructed frames, causing visible artifacts in P-frames.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:26:31 -02:00
Philipp Zabel f4706d6e6d [media] coda: issue seq_end_work during stop_streaming
This patch queues seq_end_work and flushes the queue during stop_streaming
and clears the ctx->initialized flag. This allows to start streaming again
after stopping streaming without releasing the context.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:25:36 -02:00
Philipp Zabel 6dd5ef5bdd [media] coda: remove unused isequence, reset qsequence in stop_streaming
The isequence counter is never used, qsequence counts the buffers queued into
the bit decoder bitstream ringbuffer. It needs to be reset in stop_streaming.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:25:14 -02:00
Markus Pargmann 31db5adb4e [media] coda: fix width validity check when starting to decode
Compare rounded up width to fit into bytesperline.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:24:57 -02:00
Philipp Zabel 8c9ef6b16c [media] coda: clear RET_DEC_PIC_SUCCESS flag in prepare_decode
To make sure a set RET_DEC_PIC_SUCCESS flag is not a leftover from
a previous successful run, clear it in prepare_decode.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:23:41 -02:00
Philipp Zabel 811a6934c2 [media] coda: initialize SRAM on probe
Zeroing the SRAM on probe helps with debugging SRAM contents.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:23:16 -02:00
Philipp Zabel 1c2f6a9983 [media] coda: properly clear f_cap in coda_s_fmt_vid_out
Properly zero the structure on the stack before using it.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:02:13 -02:00
Philipp Zabel 5f9826e8a7 [media] coda: fix try_fmt_vid_out colorspace setting
v4l2-compliance complains about invalid colorspace settings being accepted
on the output side. This patch only allows REC709 and JPEG.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:01:39 -02:00
Philipp Zabel f77fd8a9b1 [media] coda: fix job_ready debug reporting for bitstream decoding
Clarify whether job_ready returns false because the context is on hold, waiting
for new input buffers, whether there are not enough input buffers to fill two
into the bitstream, or whether there is not enough data in the bitstream buffer
for the bitstream reader hardware to read a whole frame.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:01:09 -02:00
Lucas Stach 83f31c8a5f [media] coda: adjust sequence offset after unexpected decoded frame
If userspace doesn't properly separate the bitstream input into
individual frames (which may happen for example on slightly
corrupted streams) the CODA hardware may decode more frames
than we expect. We already log an error in this case, but it's
also necessary to adjust the sequence offset. Otherwise we
spam the log with a sequence number mismatch on every frame
frame after the unexpected one.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 10:00:10 -02:00
Philipp Zabel 07ba277f89 [media] coda: move meta out of padding
Handle an empty buffer metadata list without crashing. This can happen
if the decoder is fed a broken stream, or multiple compressed frames in
a single queued buffer.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 09:59:53 -02:00
Philipp Zabel e1519e866b [media] coda: remove context debugfs entry last
Do not remove the per-context debugfs directory before the
per-buffer debugfs entries contained therein.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 09:59:11 -02:00
Philipp Zabel 27d056f67f [media] coda: fix encoder rate control parameter masks
This patch fixes the ENC_SEQ_RC_PARA initial delay and bitrate masks.
These bit fields are 15 bit wide, not 7 bit.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 09:58:49 -02:00
Fabian Frederick ea0944e079 [media] s5p-mfc: remove unnecessary version.h inclusion
Based on versioncheck.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 09:58:35 -02:00
Fabian Frederick ef8fab7f99 [media] s5p-g2d: remove unnecessary version.h inclusion
Based on versioncheck.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 09:58:23 -02:00
Nicolas Dufresne 68e77d2e6e [media] s5p-mfc-dec: Don't use encoder stop command
The decoder should handle V4L2_DEC_CMD_STOP to trigger drain,
but it currently expecting V4L2_ENC_CMD_STOP.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Acked-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 09:57:36 -02:00
Nicolas Dufresne 1b880ef62c [media] s5p-mfc-v6+: Use display_delay_enable CID
The MFC driver has two controls, DISPLAY_DELAY and DISPLAY_DELAY_ENABLE
that allow forcing the decoder to return a decoded frame sooner
regardless of the order. The added support for firmware version 6 and
higher was not taking into account the DISPLAY_DELAY_ENABLE boolean.
Instead it had a comment stating that DISPLAY_DELAY should be set to a
negative value to disable it. This is not possible since the control
range is from 0 to 65535. This feature was also supposed to be disabled
by default in order to produce frames in display order.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Acked-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02 09:57:14 -02:00
Antti Palosaari 08272db62a [media] si2157: change firmware variable name and type
Rename firmware variable from fw_file to fw_name and change its
type from u8 to const char as request_firmware() input is.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:50:28 -02:00
Antti Palosaari 6c3725332d [media] si2157: print chip version
Print chip version once using log level into when init() is called.
Remove cold/warm state printing as those are not very useful.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:50:06 -02:00
Antti Palosaari c7011845ca [media] si2157: print firmware version
Firmware version could be printed similarly than si2168 driver does.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:49:45 -02:00
Antti Palosaari e7f3f9f362 [media] si2157: add own goto label for kfree() on probe error
Use own goto label for error case mem free is needed, even kfree could
be called with NULL. I think it is better to have it, even not required.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:49:25 -02:00
Antti Palosaari c12922338c [media] si2157: trivial ID table changes
- Rename ID table.
- Remove magic numbers from ID table driver data field.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:49:09 -02:00
Antti Palosaari 78dab40a51 [media] si2157: change firmware download error handling
Rename firmare download error path goto label. Remove firmware NULL
set as NULL value is not needed anymore, due to recent change which
started using goto labels for firmware error handling.

Cc: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:48:39 -02:00
Antti Palosaari 8fe51725d8 [media] si2157: carry pointer to client instead of state in tuner_priv
Carry struct i2c_client pointer in tuner_priv. This driver is I2C driver,
which is represented as a struct i2c_client, so better to carry this top
level structure for each routine in order to unify things.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:48:14 -02:00
Antti Palosaari 7cbf5d7651 [media] si2157: simplify si2157_cmd_execute() error path
Remove if () from firmware command error path as there should not be
any error prone conditional logic there. Use goto labels instead.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:47:45 -02:00
Antti Palosaari 70f13ff091 [media] si2157: rename device state variable from 's' to 'dev'
'dev' is likely most common name in kernel for structure containing
device state instance, so rename it in order to keep things
consistent.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:47:21 -02:00
Antti Palosaari c32b281628 [media] si2168: change firmware variable name and type
Rename firmware variable from fw_file to fw_name and change its type
from u8 to const char as request_firmware() input defines.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:46:05 -02:00
Antti Palosaari 9b7839c306 [media] si2168: print chip version
Print chip version once using log level into when init() is called.
Remove cold/warm state printing as those are not very useful.

old printing:
si2168 6-0064: found a 'Silicon Labs Si2168' in cold state
si2168 6-0064: downloading firmware from file 'dvb-demod-si2168-b40-01.fw'
si2168 6-0064: firmware version: 4.0.11
si2168 6-0064: found a 'Silicon Labs Si2168' in warm state

new printing:
si2168 6-0064: found a 'Silicon Labs Si2168-B40'
si2168 6-0064: downloading firmware from file 'dvb-demod-si2168-b40-01.fw'
si2168 6-0064: firmware version: 4.0.11

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:45:36 -02:00
Antti Palosaari 58f6693fa1 [media] si2168: remove unneeded fw variable initialization
commit 034e1ec0ce
si2168: One function call less in si2168_init() after error detection

That commit added goto label for error path to release firmware,
but forgets to remove variable NULL set. Remove those now.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:44:43 -02:00
Antti Palosaari 68c16a76c6 [media] si2168: enhance firmware download routine
All known old firmware firmware formats are downloaded using 8 byte
chunks. Reject firmware if it could not be divided to 8 byte chunks
and because of that we could simplify some calculations. Now both
supported firmware download routines are rather similar.

Cc: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:44:00 -02:00
Antti Palosaari 1ee5e7dd5e [media] si2168: add own goto label for kzalloc failure
Use own label for kzalloc failure in which does not call kfree().
kfree() could be called with NULL, but it is still better to have
own label which skips unnecessary kfree().

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:43:16 -02:00
Antti Palosaari e5dd1100c7 [media] si2168: change stream id debug log formatter
Change formatter from signed to unsigned as stream_id is 32bit
unsigned variable.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:42:43 -02:00
Antti Palosaari 955e0ab8ce [media] si2168: change firmware version print from debug to info
Even firmware version is not needed to know, it is still interesting
and useful to know some cases. Due to that increase its printing to
info log level.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:42:12 -02:00
Antti Palosaari 346d4900f0 [media] si2168: rename few things
Rename some goto labels and more. No functionality changes.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:41:49 -02:00
Antti Palosaari 4affbe1d08 [media] si2168: simplify si2168_cmd_execute() error path
Remove if () from firmware command error path as there should not be
any error prone conditional logic there. Use goto labels instead.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:41:11 -02:00
Antti Palosaari 3de3583539 [media] si2168: get rid of own struct i2c_client pointer
We don't need that anymore as same pointer is passed to each
routine via struct dvb_frontend private field.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:40:24 -02:00
Antti Palosaari 6307b56080 [media] si2168: carry pointer to client instead of state
Carry struct i2c_client pointer inside struct dvb_frontend private
pointer. This driver is I2C driver, which is represented as a
struct i2c_client, so better to carry this top level structure for
each routine in order to unify things. This allows further
simplification.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:39:49 -02:00
Antti Palosaari bd01c7666c [media] si2168: rename device state variable from 's' to 'dev'
'dev' is most common name in kernel for structure containing device
state instance, so rename it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:38:59 -02:00
Antti Palosaari f1ecc5d119 [media] si2168: define symbol rate limits
w_scan complains about missing symbol rate limits:
This dvb driver is *buggy*: the symbol rate limits are undefined - please report to linuxtv.org

Chip supports 1 to 7.2 MSymbol/s on DVB-C.

Cc: stable@vger.kernel.org
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:38:17 -02:00
Michael Ira Krufky 27f7ef7ca9 [media] lgdt3305: add support for fixed tp clock mode
Add support for controlling TP clock mode for VSB and QAM annex-B/C mode.
Gated clock mode is the default value, and does not support QAM annex-C.
The patch enables setting this control to fixed clock mode.

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:32:01 -02:00
Michael Ira Krufky bdba90df2e [media] lgdt3305: we only need to pass state into lgdt3305_mpeg_mode_polarity()
Simplify the code a little bit by removing some uneeded arguments
to lgdt3305_mpeg_mode_polarity().

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:30:55 -02:00
Luca Bonissi 91de062f50 [media] gspca_vc032x: Fix wrong bytesperline
I found a problem on vc032x gspca usb webcam subdriver: "bytesperline"
property is wrong for YUYV and YVYU formats.
With recent v4l-utils library (>=0.9.1), that uses "bytesperline" for
pixel format conversion, the result is a wrong jerky image.

Patch tested on my laptop (USB webcam Logitech Orbicam 046d:0892).

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=91181

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:28:46 -02:00
Hans de Goede c7e5a726d5 [media] gspca: Fix underflow in vidioc_s_parm()
"n" is a user controlled integer.  The code here doesn't handle the case
where "n" is negative and this causes a static checker warning.

	drivers/media/usb/gspca/gspca.c:1571 vidioc_s_parm()
	warn: no lower bound on 'n'

parm.capture.readbuffers is unsigned, so make n unsigned too, fixing this.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:28:16 -02:00
Joe Howse 0f5b265762 [media] gspca: Add high-speed modes for PS3 Eye camera
Add support in the PS3 Eye driver for QVGA capture at higher
frame rates: 187, 150, and 137 FPS. This functionality is valuable
because the PS3 Eye is popular for computer vision projects and no
other camera in its price range supports such high frame rates.

Correct a QVGA mode that was listed as 40 FPS. It is really 37 FPS
(half of 75 FPS).

Tests confirm that the nominal frame rates are achieved.

Signed-off-by: Joe Howse <josephhowse@nummist.com>
Tested-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:27:49 -02:00
Antonio Ospite 13e6c9f4bc [media] gspca_stv06xx: enable button found on some Quickcam Express variant
Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:27:25 -02:00
Hans Verkuil 80b0963e16 [media] pwc: fix WARN_ON
If start_streaming fails, then the buffers must be given back to vb2 with state
QUEUED, not ERROR. Otherwise a WARN_ON will be generated.

In the disconnect it is pointless to call pwc_cleanup_queued_bufs() as stop_streaming()
will be called anyway.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:27:03 -02:00
Hans de Goede a4bca4c7ad [media] rc: sunxi-cir: Add support for the larger fifo found on sun5i and sun6i
Add support for the larger fifo found on sun5i and sun6i, having a separate
compatible for the ir found on sun5i & sun6i also is useful if we ever want
to add ir transmit support, because the sun5i & sun6i version do not have
transmit support.

Note this commits also adds checking for the end-of-packet interrupt flag
(which was already enabled), as the fifo-data-available interrupt flag only
gets set when the trigger-level is exceeded. So far we've been getting away
with not doing this because of the low trigger-level, but this is something
which we should have done since day one.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:26:31 -02:00
Hans de Goede 44f8af6846 [media] rc: sunxi-cir: Add support for an optional reset controller
On sun6i the cir block is attached to the reset controller, add support
for de-asserting the reset if a reset controller is specified in dt.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:26:08 -02:00
Mauro Carvalho Chehab 2c794075d4 [media] gspca/touptek: Fix a few CodingStyle issues
Checkpatch complained about a few issues, like FSF address. Also,
multi-line comments are not following the Kernel CodingStyle.

While not too late, let's fix those issues.

Cc: John McMaster <johndmcmaster@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:25:02 -02:00
John McMaster 7cc42d9f75 [media] gspca_touptek: Add support for ToupTek UCMOS series USB cameras
Adds support for AmScope MU800 / ToupTek UCMOS08000KPB USB microscope camera.

Signed-off-by: John McMaster <johndmcmaster@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:13:13 -02:00
Hans Verkuil afad4dd50a [media] vivid: Y offset should depend on quant. range
When converting to or from Y'CbCr and R'G'B' the Y offset depends
on the quantization range: it's 0 for full and 16 for limited range.
But in the code it was hardcoded to 16. This messed up the brightness
of the generated pattern.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 18:03:19 -02:00
Sakari Ailus cb88d7384e [media] smiapp: Don't compile of_read_number() if CONFIG_OF isn't defined
of_read_number() is defined in of.h but does not return an error code, so
that non-of implementation could simply return an error.

Temporarily work around this until of_read_number() can be replaced by
of_property_read_u64_array().

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29 17:59:22 -02:00
Antti Palosaari 8d44aeefcd [media] rtl28xxu: change module unregister order
We must unregister frontend first and after that driver itself. That
order went wrong after demod drivers were switched to kernel I2C
drivers, causing crashes.

Tested-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:57:58 -02:00
Antti Palosaari 83b2f84957 [media] rtl28xxu: switch rtl2832 demod attach to I2C binding
As rtl2832 driver support now I2C binding we will switch to that one.

Tested-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:57:18 -02:00
Antti Palosaari c2c8386f82 [media] rtl2832: convert driver to I2C binding
Convert that driver to I2C driver model.
Legacy DVB binding is left also for later removal...

Tested-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:55:36 -02:00
Fabian Frederick 566cc8a5e7 [media] uvcvideo: remove unnecessary version.h inclusion
Based on versioncheck.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:39:34 -02:00
Aviv Greenberg 9fae30acde [media] uvcvideo: Remove extra commit on resume()
The UVC spec is a bit vague wrt devices using bulk endpoints,
specifically, how to signal to a device to start streaming.

For devices using isoc endpoints, the sequence for start streaming is:
1) The host sends PROBE_CONTROL(SET_CUR) PROBE_CONTROL(GET_CUR)
2) Host selects desired config and calls COMMIT_CONTROL(SET_CUR)
3) Host selects an alt interface other then zero - e.g SELECT_ALTERNATE_INTERFACE(1)
4) The device starts streaming

However for devices using bulk endpoints, there must be *no* alt interface
other than setting zero. From the UVC spec:
"A VideoStreaming interface containing a bulk endpoint for streaming shall
support only alternate setting zero. Additional alternate settings containing
bulk endpoints are not permitted in a device that is compliant with the Video
Class specification."

So for devices using bulk endpoints, step #3 above is irrelevant, and thus
cannot be used as an indication for the device to start streaming.
So in practice, such devices start streaming immediately after a
COMMIT_CONTROL(SET_CUR).

In the uvc resume() handler, an unsolicited commit is sent, which causes
devices using bulk endpoints to start streaming unintentionally.

This patch modifies resume() handler to send a commit only if streaming
needs to be reestablished, i.e if the device was actually streaming before is
was suspended.

Signed-off-by: Aviv Greenberg <aviv.d.greenberg@intel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:39:17 -02:00
Nobuhiro Iwamatsu 533ab2231d [media] v4l: vsp1: Fix VI6_DISP_IRQ_STA_LNE macro
LNE bit in VI6_DISP_IRQ_STA register are from the 0 bit to 4 bit.
This fixes bit position specified by VI6_DISP_IRQ_STA_LNE.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:38:24 -02:00
Nobuhiro Iwamatsu 59a7954ce3 [media] v4l: vsp1: Fix VI6_DISP_IRQ_ENB_LNEE macro
LNEE bit in VI6_DISP_IRQ_ENB register are from the 0 bit to 4 bit.
This fixes bit position specified by VI6_DISP_IRQ_ENB_LNEE.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:37:06 -02:00
Takanari Hayama 8cb0b63490 [media] v4l: vsp1: bru: Fix minimum input pixel size
According to the spec, the minimum input pixel size for BRU is 1px,
not 4px.

Signed-off-by: Takanari Hayama <taki@igel.co.jp>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:36:45 -02:00
Martin Bugge 09f90c53ac [media] adv7842: simplify InfoFrame logging
Use the new logging functions from the hdmi module.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:19:48 -02:00
Fabio Estevam 7657e0647c [media] adv7180: Remove the unneeded 'err' label
There is no need to jump to the 'err' label as we can simply return the error
code directly and make the code shorter.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:15:58 -02:00
Dan Carpenter 88ca3af44b [media] coda: improve safety in coda_register_device()
The "i" variable is used as an offset into both the dev->vfd[] and the
dev->devtype->vdevs[] arrays.  The second array is smaller so we should
use that as a limit instead of ARRAY_SIZE(dev->vfd).  Also the original
check was off by one.

We should use a format string as well in case the ->name has any funny
characters and also to stop static checkers from complaining.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:15:07 -02:00
Ondrej Zary 35655bf854 [media] bttv: Improve TEA575x support
Improve g_tuner and add s_hw_freq_seek and enum_freq_bands support for cards
with TEA575x radio.

This allows signal/stereo detection and HW seek to work on these cards.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:14:20 -02:00
Ondrej Zary 6994ca3df1 [media] tea575x: split and export functions
Split ioctl interface from enum_freq_bands, g_tuner and s_hw_freq_seek
functions and export them to be used in other drivers like bttv.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:13:50 -02:00
Ondrej Zary 1b50037315 [media] bttv: Convert to generic TEA575x interface
Remove tea575x-specific code from bttv and use the common driver instead.

Only set_frequency is implemented (signal/stereo detection or seek would
require more changes to bttv).

It works fine on Video Highway Xtreme (it actually makes the radio usable as
it currently cannot be tuned properly).

Miro/Pinnacle is untested but seems to be simple and should work.

However, I don't understand the Terratec Active Radio Upgrade code. The HW
seems to need IOR, IOW and CSEL signals that were taken from ISA bus on
older cards (IOR and IOW directly and CSEL from some address decoder) and
are emulated here using GPIOs. But the code manipulating these signals in
bttv seems to be broken - it never asserts the IOR signal. If anyone has
this HW, please test if I got that right.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:13:19 -02:00
Rickard Strandqvist 811afabf14 [media] usb: pvrusb2: pvrusb2-hdw: Remove unused function
Remove the function pvr2_hdw_cmd_powerdown() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:11:19 -02:00
Rickard Strandqvist 43abdd6b6b [media] media: i2c: adv7604: Remove some unused functions
Removes some functions that are not used anywhere:
test_read() edid_read_block() dpp_write() dpp_read()
esdp_write() esdp_read() cec_write_clr_set()

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:11:02 -02:00
Rickard Strandqvist 39ddae9b22 [media] media: platform: vsp1: vsp1_hsit: Remove unused function
Remove the function vsp1_hsit_read() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Acked-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:10:38 -02:00
Rickard Strandqvist 0badd3c79b [media] media: pci: saa7134: saa7134-video.c: Remove unused function
Remove the function saa7134_queue() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:10:23 -02:00
Rickard Strandqvist df58433145 [media] media: pci: mantis: mantis_core.c: Remove unused function
Remove the function write_eeprom_byte() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:10:06 -02:00
Rickard Strandqvist 05a2ea7835 [media] media: i2c: adv7604.c: Remove some unused functions
Removes some functions that are not used anywhere:
vblanking() hblanking()

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:09:42 -02:00
Fabian Frederick 8059278603 [media] vivid: remove unnecessary version.h inclusion
Based on versioncheck.

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>
2015-01-27 10:09:17 -02:00
Fabian Frederick 11ede411b4 [media] tw68: remove unnecessary version.h inclusion
Based on versioncheck.

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>
2015-01-27 10:08:49 -02:00
Julia Lawall 03f23fc51d [media] pvrusb2: Use setup_timer
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

A simplified version of the semantic match that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.data = d;
-t.function = f;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:08:22 -02:00
Julia Lawall f57cffb934 [media] usbvision: Use setup_timer
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

A simplified version of the semantic match that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.data = d;
-t.function = f;
// </smpl>

The semantic patch also changes the cast to long to a cast to unsigned
long in the data initializer, as unsigned long is the type of the data field.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:08:03 -02:00
Julia Lawall 8bf554cafd [media] s2255drv: Use setup_timer
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

A simplified version of the semantic match that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.function = f;
-t.data = d;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:04:18 -02:00
Julia Lawall 30a8f2a08d [media] au0828: Use setup_timer
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

A simplified version of the semantic match that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression t,f,d;
@@

-t.function = f;
-t.data = d;
-init_timer(&t);
+setup_timer(&t,f,d);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:03:59 -02:00
Ismael Luceno af29ba97f1 [media] solo6x10: s/uint8_t/u8/
s/uint8_t/u8/

Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:03:19 -02:00
Ismael Luceno b1bb7ee2d9 [media] solo6x10: Fix solo_eeprom_read retval type
s/unsigned short/u16/

Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:03:00 -02:00
Ismael Luceno 469ac53e7c [media] solo6x10: Fix eeprom_* functions buffer's type
s/unsigned short/u16/

Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:02:42 -02:00
Ismael Luceno 8a4d9a9cf9 [media] solo6x10: s/unsigned char/u8/
s/unsigned char/u8/

Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:02:07 -02:00
Hans Verkuil 861360a56d [media] videobuf: make unused exported functions static
The videobuf_dma_init* and videobuf_dma_map() functions are no longer
used except in videobuf-dma-sg.c itself. Make them static.

These functions were abused in various drivers. All those drivers
have now been fixed, so by no longer exporting these functions
future abuse is now prevented.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 10:01:33 -02:00
Rickard Strandqvist 58fc0461f6 [media] media: radio: wl128x: fmdrv_rx.c: Remove unused function
Remove the function fm_rx_get_rds_system() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 09:56:20 -02:00
Prabhakar Lad 4c036c4ffa [media] media: Kconfig: drop duplicate dependency of HAS_DMA
this patch drops duplicate dependency of HAS_DMA from
VIDEO_SH_VEU.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 09:55:52 -02:00
Asaf Vertz 3edd59abb0 [media] media: stb0899_drv: use time_after()
To be future-proof and for better readability the time comparisons are
modified to use time_after() instead of plain, error-prone math.

Signed-off-by: Asaf Vertz <asaf.vertz@tandemg.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 09:55:28 -02:00
Fabio Estevam a6c896c1b2 [media] coda: coda-common: Remove mx53 entry from coda_platform_ids
As mx53 is a dt-only architecture we can safely remove its entry from the
coda_platform_ids[] structure.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27 09:49:45 -02:00
Mauro Carvalho Chehab 4a8ba33197 Linux 3.19-rc6
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJUxbzlAAoJEHm+PkMAQRiGtqYIAJ8YlKX9cXKYmXx8/FncINH+
 2erj94KyHG080R1uwSq1+7zXWCZUUlxiJnDnsup5rG0dImcicqgOE48oHax1aN6b
 yHfPONkTjNJ1HYepuGC3YWCG9wIjPZQ5S8KHrwRjyVoE+ddhe9gWgvArA3jl/fW/
 2fYNWekoRoMcRiNb4/w2weyOOBywdSVpmj0WYiwdztysG2ymw5hUXRHJhvSf1AFm
 RQJfUHkhCOYpQGY7XFba/1uGhTJfOgDmYAfspAOLzmrXE/DJcCutsVdBZO+12fAL
 nhGpM/PkRYxMvwzDKIUoG35qsymYOMqo54oXhr0S2JjyXTGdGmB6qHxIfqnV5Tk=
 =O/Lr
 -----END PGP SIGNATURE-----

Merge tag 'v3.19-rc6' into patchwork

This is needed in order to get the media fixes applied on -rc6.

Linux 3.19-rc6

* tag 'v3.19-rc6': (891 commits)
  Linux 3.19-rc6
  dm: fix handling of multiple internal suspends
  hwmon: (i5500_temp) Convert to use ATTRIBUTE_GROUPS macro
  hwmon: (i5500_temp) Convert to module_pci_driver
  hwmon: (i5500_temp) Don't bind to disabled sensors
  hwmon: (i5500_temp) Convert to devm_hwmon_device_register_with_groups
  hwmon: (i5500_temp) New driver for the Intel 5500/5520/X58 chipsets
  arm64: dts: add baud rate to Juno stdout-path
  Revert "platform: x86: dell-laptop: Add support for keyboard backlight"
  Revert "Documentation: Add entry for dell-laptop sysfs interface"
  dm cache: fix problematic dual use of a single migration count variable
  dm cache: share cache-metadata object across inactive and active DM tables
  of/unittest: Overlays with sub-devices tests
  KVM: x86: SYSENTER emulation is broken
  KVM: x86: Fix of previously incomplete fix for CVE-2014-8480
  arm64: dump: Fix implicit inclusion of definition for PCI_IOBASE
  x86/tsc: Change Fast TSC calibration failed from error to info
  x86/apic: Re-enable PCI_MSI support for non-SMP X86_32
  x86, mm: Change cachemode exports to non-gpl
  x86, tls: Interpret an all-zero struct user_desc as "no segment"
  ...

Conflicts:
	drivers/media/pci/cx23885/cx23885.h
2015-01-27 09:39:34 -02:00
Mauro Carvalho Chehab e32b31ae45 [media] mb86a20s: remove unused debug modprobe parameter
The debug parameter is not used anymore, as this module was
converted already to use dev_dbg().

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-26 10:08:29 -02:00
Jurgen Kramer 551c33e729 [media] Si2168: increase timeout to fix firmware loading
Increase si2168 cmd execute timeout to prevent firmware load failures. Tests
shows it takes up to 52ms to load the 'dvb-demod-si2168-a30-01.fw' firmware.
Increase timeout to a safe value of 70ms.

Signed-off-by: Jurgen Kramer <gtmkramer@xs4all.nl>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-26 08:23:45 -02:00
Linus Torvalds af469b3748 media fixes for v3.19-rc6
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJUwkroAAoJEAhfPr2O5OEVYBYP/R8uGJ6nelba4qQ/S2K7UvOK
 +7eCIlO3K2ugU5Va4qhSgkhNKe1z/YqF2t443WyHFdBNt2IfFCugS4lulSJI8SXF
 UFO0HPqmvvc2QpcLC5HX3luk6Xqwanbxi88SO3ty6GaDidnoQHBga9LTLukfiXyE
 4buZ/NZReEDW/TDg+6o0Wa3Mpnzv2FKgKlbyOLmM3IHhNXm4Ejm7aWivfl+4LSIz
 yti8eoPgOgFGtmI0fAC5Bh3gPutsDnn/39OzxQVnOgqIDyJlIhJhGUDnCftNesqZ
 FvGCTHYW0iaXBPNxrdy5q2fY/vyITXCXLspI6pKhprtK5cQikvHlvzUNHKXBH36o
 1vLjELOMS9evA98vj8d4OzjaspsxhdPoMSUbNBL2COaOcxpYnwNY7Ya7QCeNi63P
 odqZUc1Vgj18iFiSlp47AEgmI5vZw9sQL/1rzwLUgezUw91hxhMEaH1iQPLmfcpV
 M4pRIp7xBur/7TaSRXN+Yw3p2yNFwY2G9rXj2Vg6rgbQsYpT0S2vqSxC/3/Bdxe+
 qEH/O+Hq561H1QuX8VyaC3W/x74TjQhGZhvYoTdSFUJw6gxhvCNx6vZmr4iFERph
 QAfKMtZBBNt8kq90JEUTw/3FO9TQbnGC7oFw8/sSVMZ2YiR0a6guAnximK4dpbdQ
 ks1MVaSnNaRIcCpwpbvY
 =yD+L
 -----END PGP SIGNATURE-----

Merge tag 'media/v3.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:
  - fix some race conditions caused by a regression on videobuf2
  - fix a interrupt release bug on cx23885
  - fix support for Mygica T230 and HVR4400
  - fix compilation breakage when USB is not selected on tlg2300
  - fix capabilities report on ompa3isp, soc-camera, rcar_vin and
    pvrusb2

* tag 'media/v3.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] omap3isp: Correctly set QUERYCAP capabilities
  [media] cx23885: fix free interrupt bug
  [media] pvrusb2: fix missing device_caps in querycap
  [media] vb2: fix vb2_thread_stop race conditions
  [media] rcar_vin: Update device_caps and capabilities in querycap
  [media] soc-camera: fix device capabilities in multiple camera host drivers
  [media] Fix Mygica T230 support
  [media] cx23885: Split Hauppauge WinTV Starburst from HVR4400 card entry
  [media] tlg2300: Fix media dependencies
2015-01-24 14:34:54 -08:00
Sakari Ailus 2c0108e1c0 [media] omap3isp: Correctly set QUERYCAP capabilities
device_caps in struct v4l2_capability were inadequately set in
VIDIOC_QUERYCAP. Fix this. Without this a WARN_ON in the v4l2 core
is triggered. This WARN_ON was added for kernel 3.19 exactly to
detect these situations.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-21 21:09:11 -02:00
Hans Verkuil 8d4d9329cd [media] cx23885: fix free interrupt bug
First free the interrupt, then disable the PCI device. The other way
around will lead to this warning:

Jan 19 11:42:02 telek kernel: [ 1440.161234] WARNING: CPU: 0 PID: 2191 at kernel/irq/manage.c:1311 __free_irq+0x97/0x1f0()
Jan 19 11:42:02 telek kernel: [ 1440.161236] Trying to free already-free IRQ 0
Jan 19 11:42:02 telek kernel: [ 1440.161237] Modules linked in: tda8290 tda10048 cx25840 cx23885(-) altera_ci tda18271 altera_stapl videobuf2_dvb tveeprom cx2341x videobuf2_dma_sg dvb_core rc_core videobuf2_memops videobuf2_core v4l2_common videodev media nouveau x86_pkg_temp_thermal cfbfillrect cfbimgblt cfbcopyarea ttm drm_kms_helper processor button isci
Jan 19 11:42:02 telek kernel: [ 1440.161266] CPU: 0 PID: 2191 Comm: rmmod Tainted: G        W      3.19.0-rc1-telek #345
Jan 19 11:42:02 telek kernel: [ 1440.161268] Hardware name: ASUSTeK COMPUTER INC. Z9PE-D8 WS/Z9PE-D8 WS, BIOS 5404 02/10/2014
Jan 19 11:42:02 telek kernel: [ 1440.161270]  ffffffff81bf1fce ffff8808958b7cc8 ffffffff8194a97f 0000000000000000
Jan 19 11:42:02 telek kernel: [ 1440.161274]  ffff8808958b7d18 ffff8808958b7d08 ffffffff810c56b0 0000000000000286
Jan 19 11:42:02 telek kernel: [ 1440.161279]  0000000000000000 0000000000000000 ffff88089f808890 ffff88089f808800
Jan 19 11:42:02 telek kernel: [ 1440.161284] Call Trace:
Jan 19 11:42:02 telek kernel: [ 1440.161290]  [<ffffffff8194a97f>] dump_stack+0x4f/0x7b
Jan 19 11:42:02 telek kernel: [ 1440.161295]  [<ffffffff810c56b0>] warn_slowpath_common+0x80/0xc0
Jan 19 11:42:02 telek kernel: [ 1440.161299]  [<ffffffff810c5731>] warn_slowpath_fmt+0x41/0x50
Jan 19 11:42:02 telek kernel: [ 1440.161303]  [<ffffffff81955d36>] ? _raw_spin_lock_irqsave+0x56/0x70
Jan 19 11:42:02 telek kernel: [ 1440.161307]  [<ffffffff81114849>] ? __free_irq+0x49/0x1f0
Jan 19 11:42:02 telek kernel: [ 1440.161311]  [<ffffffff81114897>] __free_irq+0x97/0x1f0
Jan 19 11:42:02 telek kernel: [ 1440.161316]  [<ffffffff81114a88>] free_irq+0x48/0xd0
Jan 19 11:42:02 telek kernel: [ 1440.161323]  [<ffffffffa00e6deb>] cx23885_finidev+0x4b/0x90 [cx23885]
Jan 19 11:42:02 telek kernel: [ 1440.161329]  [<ffffffff814529fa>] pci_device_remove+0x3a/0xc0
Jan 19 11:42:02 telek kernel: [ 1440.161334]  [<ffffffff8153b4ea>] __device_release_driver+0x7a/0xf0
Jan 19 11:42:02 telek kernel: [ 1440.161338]  [<ffffffff8153bc98>] driver_detach+0xc8/0xd0
Jan 19 11:42:02 telek kernel: [ 1440.161341]  [<ffffffff8153b1de>] bus_remove_driver+0x4e/0xb0
Jan 19 11:42:02 telek kernel: [ 1440.161345]  [<ffffffff8153c2eb>] driver_unregister+0x2b/0x60
Jan 19 11:42:02 telek kernel: [ 1440.161349]  [<ffffffff814525c5>] pci_unregister_driver+0x25/0x70
Jan 19 11:42:02 telek kernel: [ 1440.161355]  [<ffffffffa00f6ddc>] cx23885_fini+0x10/0x12 [cx23885]
Jan 19 11:42:02 telek kernel: [ 1440.161360]  [<ffffffff81139a98>] SyS_delete_module+0x1a8/0x1f0
Jan 19 11:42:02 telek kernel: [ 1440.161364]  [<ffffffff819561a9>] system_call_fastpath+0x12/0x17
Jan 19 11:42:02 telek kernel: [ 1440.161367] ---[ end trace a9c07cb5f3357020 ]---

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-21 21:08:38 -02:00
Hans Verkuil 42639f6de6 [media] pvrusb2: fix missing device_caps in querycap
The VIDIOC_QUERYCAP function should set device_caps, but this was missing.
In addition, it set the version field as well, but that should be done by
the core, not by the driver.

If a driver doesn't set device_caps the v4l2 core will issue a WARN_ON, so
it's important that this is set correctly.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-21 21:08:03 -02:00
Hans Verkuil 6cf11ee630 [media] vb2: fix vb2_thread_stop race conditions
The locking scheme inside the vb2 thread is unsafe when stopping the
thread. In particular kthread_stop was called *after* internal data
structures were cleaned up instead of doing that before. In addition,
internal vb2 functions were called after threadio->stop was set to
true and vb2_internal_streamoff was called. This is also not allowed.

All this led to a variety of race conditions and kernel warnings and/or
oopses.

Fixed by moving the kthread_stop call up before the cleanup takes
place, and by checking threadio->stop before calling internal vb2
queuing operations.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org>      # for v3.16 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-21 21:07:26 -02:00
Nobuhiro Iwamatsu 42d74e4fe6 [media] rcar_vin: Update device_caps and capabilities in querycap
The V4L2 API requires both .capabilities and .device_caps fields of
struct v4l2_capability to be set. Otherwise the compliance checker
complains and since commit "v4l2-ioctl: WARN_ON if querycap didn't fill
device_caps" a compile-time warning is issued. Fix this non-compliance
in the rcar_vin driver.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-21 21:05:58 -02:00
Guennadi Liakhovetski 7d96c3e446 [media] soc-camera: fix device capabilities in multiple camera host drivers
The V4L2 API requires both .capabilities and .device_caps fields of
struct v4l2_capability to be set. Otherwise the compliance checker
complains and since commit "v4l2-ioctl: WARN_ON if querycap didn't fill
device_caps" a compile-time warning is issued. Fix this non-compliance
in several soc-camera camera host drivers.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-21 21:05:45 -02:00
Jonathan McDowell d0bb12c9f4 [media] Fix Mygica T230 support
Commit 2adb177e57 removed 2 devices
from the cxusb device table but failed to fix up the T230 properties
that follow, meaning that this device no longer gets detected properly.
Adjust the cxusb_table index appropriate so detection works.

Signed-off-by: Jonathan McDowell <noodles@earth.li>
Reviewed-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-21 21:03:39 -02:00
Matthias Schwarzott 721f3223f2 [media] cx23885: Split Hauppauge WinTV Starburst from HVR4400 card entry
Unconditionally attaching Si2161/Si2165 demod driver
breaks Hauppauge WinTV Starburst.
So create own card entry for this.

Add card name comments to the subsystem ids.

This fixes a regression introduced in 3.17 by
36efec48e2 ([media] cx23885: Add si2165 support for HVR-5500)

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
CC: stable@vger.kernel.org # for 3.17 and upper
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-21 21:02:34 -02:00
Antti Palosaari 1fc77d013b [media] cx23885: Hauppauge WinTV-HVR5525
Add board profile for Hauppauge WinTV-HVR5525.

Device is build upon following main components:
Conexant CX23888
Montage M88RS6000
Allegro A8293
Silicon Labs Si2168-B40
Silicon Labs Si2157-A30

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-30 10:48:04 -02:00
Antti Palosaari 93009ca673 [media] cx23885: fix I2C scan printout
1) I2C slave addresses were printed so called 8-bit format. Use
standard 7-bit notation.

2) I2C slave address was printed with hex formatted without leading
zeros, which makes output one digit shorter in a case of address
fit to one hex digit. Use 4 char wide hex number with leading zeros
as usually used for I2C slave addresses.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-30 10:46:52 -02:00
Antti Palosaari a593f2cfc1 [media] cx23885: correct some I2C client indentations
These comparisons fit single line.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-30 10:45:00 -02:00
Antti Palosaari 3b952436d4 [media] cx23885: do not unregister demod I2C client twice on error
Demod I2C client should be NULL after demod is unregistered on error
path, otherwise it will be unregistered again when driver is unload.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-30 10:44:24 -02:00
Geert Uytterhoeven 99f3cd52ae [media] vb2-vmalloc: Protect DMA-specific code by #ifdef CONFIG_HAS_DMA
If NO_DMA=y:

drivers/built-in.o: In function `vb2_vmalloc_dmabuf_ops_detach':
videobuf2-vmalloc.c:(.text+0x6f11b0): undefined reference to `dma_unmap_sg'
drivers/built-in.o: In function `vb2_vmalloc_dmabuf_ops_map':
videobuf2-vmalloc.c:(.text+0x6f1266): undefined reference to `dma_unmap_sg'
videobuf2-vmalloc.c:(.text+0x6f1282): undefined reference to `dma_map_sg'

As we don't want to make the core VIDEOBUF2_VMALLOC depend on HAS_DMA
(it's v4l2 core code, and selected by a lot of drivers), stub out the
DMA support if HAS_DMA is not set.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 16:28:09 -02:00
James Hogan 983c5bd26b [media] rc-main: Re-apply filter for no-op protocol change
Since commit da6e162d6a ("[media] rc-core: simplify sysfs code"), when
the IR protocol is set using the sysfs interface to the same set of
protocols that are already set, store_protocols() does not refresh the
scancode filter with the new protocol, even if it has already called the
change_protocol() callback successfully. This results in the filter
being disabled in the hardware and not re-enabled until the filter is
set again using sysfs.

Fix in store_protocols() by still re-applying the filter whenever the
change_protocol() driver callback succeeded.

The problem can be reproduced with the img-ir driver by setting a
filter, and then setting the protocol to the same protocol that is
already set:
$ echo nec > protocols
$ echo 0xffff > filter_mask
$ echo nec > protocols

After this, messages which don't match the filter were still being
received.

Fixes: da6e162d6a ("[media] rc-core: simplify sysfs code")

Reported-by: Sifan Naeem <sifan.naeem@imgtec.com>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: David Härdeman <david@hardeman.nu>
Cc: <stable@vger.kernel.org> # v3.17+
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 16:21:45 -02:00
Sifan Naeem cb9564e133 [media] rc: img-ir: add philips rc6 decoder module
Add img-ir module for decoding Philips rc6 protocol.

Signed-off-by: Sifan Naeem <sifan.naeem@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 15:17:31 -02:00
Sifan Naeem aa7383db35 [media] rc: img-ir: add philips rc5 decoder module
Add img-ir module for decoding Philips rc5 protocol.

Signed-off-by: Sifan Naeem <sifan.naeem@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 15:16:40 -02:00
Sifan Naeem 02744c8c9a [media] rc: img-ir: biphase enabled with workaround
Biphase decoding in the current img-ir has got a quirk, where multiple
Interrupts are generated when an incomplete IR code is received by the
decoder.

Patch adds a work around for the quirk and enables biphase decoding.

Signed-off-by: Sifan Naeem <sifan.naeem@imgtec.com>
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 15:15:26 -02:00
Sifan Naeem 33e0183326 [media] rc: img-ir: pass toggle bit to the rc driver
Add toggle bit to struct img_ir_scancode_req so that protocols can
provide it to img_ir_handle_data(), and pass that toggle bit up to
rc_keydown instead of 0.

This is needed for the upcoming rc-5 and rc-6 patches.

Signed-off-by: Sifan Naeem <sifan.naeem@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 15:12:57 -02:00
Sifan Naeem ab93ce06ee [media] rc: img-ir: add scancode requests to a struct
The information being requested of hardware decode callbacks through
the img-ir-hw scancode API is mounting up, so combine it into a struct
which can be passed in with a single pointer rather than multiple
pointer arguments. This allows it to be extended more easily without
touching all the hardware decode callbacks.

Signed-off-by: Sifan Naeem <sifan.naeem@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 15:11:50 -02:00
Russell King 32e63f0368 [media] em28xx-video: fix missing newlines
Inspection shows that newlines are missing from several kernel messages
in em28xx-video.  Fix these.

Fixes: a61f68119a ("[media] em28xx-video: implement em28xx_ops: suspend/resume hooks")

Cc: <stable@vger.kernel.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 14:46:08 -02:00
Russell King a084c57fc1 [media] em28xx-dvb: fix missing newlines
Inspection shows that newlines are missing from several kernel messages
in em28xx-dvb.  Fix these.

Fixes: ca2b46dacb ("[media] em28xx-dvb: implement em28xx_ops: suspend/resume hooks")

Cc: <stable@vger.kernel.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 14:46:08 -02:00
Russell King fbaa48d185 [media] em28xx-audio: fix missing newlines
Inspection shows that newlines are missing from several kernel messages
in em28xx-audio.  Fix these.

Fixes: 6d746f91f2 ("[media] em28xx-audio: implement em28xx_ops: suspend/resume hooks")

Cc: <stable@vger.kernel.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 14:46:07 -02:00
Russell King 7818b0aab8 [media] em28xx-audio: fix missing newlines
Inspection shows that newlines are missing from several kernel messages
in em28xx-audio.  Fix these.

Fixes: 1b3fd2d342 ("[media] em28xx-audio: don't hardcode audio URB calculus")

Cc: <stable@vger.kernel.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 14:46:06 -02:00
Russell King 522adc7c1f [media] em28xx-core: fix missing newlines
Inspection shows that newlines are missing from several kernel messages
in em28xx-core.  Fix these.

Fixes: 9c669b7314 ("[media] em28xx: add suspend/resume to em28xx_ops")

Cc: <stable@vger.kernel.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 14:46:05 -02:00
Russell King ebfd59cf54 [media] em28xx-input: fix missing newlines
Inspection shows that newlines are missing from several kernel messages
in em28xx-input.  Fix these.

Fixes: 5025076aad ("[media] em28xx-input: implement em28xx_ops: suspend/resume hooks")

Cc: <stable@vger.kernel.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 14:46:04 -02:00
Russell King 0418ca6073 [media] em28xx: ensure "closing" messages terminate with a newline
The lockdep splat addressed in a previous commit revealed that at
least one message in em28xx-input.c was missing a new line:

em28178 #0: Closing input extensionINFO: trying to register non-static key.

Further inspection shows several other messages also miss a new line.
These will be fixed in a subsequent patch.

Fixes: aa929ad783 ("[media] em28xx: print a message at disconnect")

Cc: <stable@vger.kernel.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 14:46:03 -02:00
Russell King bbfebeea76 [media] em28xx: fix em28xx-input removal
Removing the em28xx-rc module results in the following lockdep splat,
which is caused by trying to call cancel_delayed_work_sync() on an
uninitialised delayed work.  Fix this by ensuring we always initialise
the work.

INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
CPU: 0 PID: 2183 Comm: rmmod Not tainted 3.18.0+ #1464
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
Backtrace:
[<c0012228>] (dump_backtrace) from [<c00123c0>] (show_stack+0x18/0x1c)
 r6:c1419d2c r5:00000000 r4:00000000 r3:00000000
[<c00123a8>] (show_stack) from [<c06e2550>] (dump_stack+0x7c/0x98)
[<c06e24d4>] (dump_stack) from [<c0061c94>] (__lock_acquire+0x16d4/0x1bb0)
 r4:edf19f74 r3:df049380
[<c00605c0>] (__lock_acquire) from [<c00626d4>] (lock_acquire+0xb0/0x124)
 r10:00000000 r9:c003ba90 r8:00000000 r7:00000000 r6:00000000 r5:edf19f74
 r4:00000000
[<c0062624>] (lock_acquire) from [<c003bad4>] (flush_work+0x44/0x264)
 r10:00000000 r9:eaa86000 r8:edf190b0 r7:edf19f74 r6:00000001 r5:edf19f64
 r4:00000000
[<c003ba90>] (flush_work) from [<c003d8f0>] (__cancel_work_timer+0x8c/0x124)
 r7:00000000 r6:00000001 r5:00000000 r4:edf19f64
[<c003d864>] (__cancel_work_timer) from [<c003d99c>] (cancel_delayed_work_sync+0x14/0x18)
 r7:00000000 r6:eccc3600 r5:00000000 r4:edf19000
[<c003d988>] (cancel_delayed_work_sync) from [<bf0b5c10>] (em28xx_ir_fini+0x48/0xd8 [em28xx_rc])
[<bf0b5bc8>] (em28xx_ir_fini [em28xx_rc]) from [<bf08a0a8>] (em28xx_unregister_extension+0x40/0x94 [em28xx])
 r8:c000edc4 r7:00000081 r6:bf092bf4 r5:bf0b6a2c r4:edf19000 r3:bf0b5bc8
[<bf08a068>] (em28xx_unregister_extension [em28xx]) from [<bf0b64dc>] (em28xx_rc_unregister+0x14/0x1c [em28xx_rc])
 r6:00000800 r5:00000000 r4:bf0b6a50 r3:bf0b64c8
[<bf0b64c8>] (em28xx_rc_unregister [em28xx_rc]) from [<c0096710>] (SyS_delete_module+0x11c/0x180)
[<c00965f4>] (SyS_delete_module) from [<c000ec00>] (ret_fast_syscall+0x0/0x48)
 r6:00000001 r5:beb0f813 r4:b8b17d00

Fixes: f522260993 ("[media] em28xx: extend the support for device buttons")

Cc: <stable@vger.kernel.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 14:46:03 -02:00
Benjamin Larsson d2fb785227 [media] mn88472: calculate the IF register values
Add xtal as a configuration parameter so it can be used
in the IF register value calculation.

Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 14:46:02 -02:00
Benoit Parrot 417d2e507e [media] media: platform: add VPFE capture driver support for AM437X
This patch adds Video Processing Front End (VPFE) driver for
AM437X family of devices
Driver supports the following:
- V4L2 API using MMAP buffer access based on videobuf2 api
- Asynchronous sensor/decoder sub device registration
- DT support

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Darren Etheridge <detheridge@ti.com>
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
[hans.verkuil@cisco.com: swapped two lines to fix vpfe_release() & add pinctrl include]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 12:09:58 -02:00
Sakari Ailus 3b1635e02e [media] smiapp: Add parentheses to macro arguments used in macros
This makes the macros a little bit safer.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 11:51:30 -02:00
Sakari Ailus 0d825a1226 [media] smiapp: Replace pll_flags quirk with more generic init quirk
The pll_flags quirk just returned the extra PLL flags the sensor required,
but the init quirk is far more versatile. It can be used to perform any
extra initialisation needed by the sensor, including allocating memory for
sensor specific struct and creating sensor specific new controls.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 11:50:25 -02:00
Sakari Ailus 5313c00266 [media] smiapp: Move enumerating available media bus codes later
As the controls creation is separated in two sections, the available media
bus codes and link frequencies can be enumerated later on.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 11:49:01 -02:00