Commit graph

20478 commits

Author SHA1 Message Date
Antti Palosaari f31a638600 [media] dvbsky: switch ts2022 to ts2020 driver
Change ts2022 driver to ts2020 driver. ts2020 driver supports
both tuner chip models.

Cc: Nibble Max <nibble.max@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 22:25:52 -03:00
Antti Palosaari 2ad8dd417a [media] smipcie: switch ts2022 to ts2020 driver
Change ts2022 driver to ts2020 driver. ts2020 driver supports
both tuner chip models.

Cc: Nibble Max <nibble.max@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 22:25:14 -03:00
Antti Palosaari d76e08784c [media] cx23885: switch ts2022 to ts2020 driver
Change ts2022 driver to ts2020 driver. ts2020 driver supports
both chip models.

Cc: Olli Salonen <olli.salonen@iki.fi>
Cc: Nibble Max <nibble.max@gmail.com>
Tested-by: David Howells <dhowells@redhat.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 22:24:52 -03:00
Antti Palosaari 83c1b6ce75 [media] em28xx: switch PCTV 461e to ts2020 driver
Change ts2022 driver to ts2020 driver as ts2020 driver now supports
both models.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 22:24:25 -03:00
Antti Palosaari dc245a5f9b [media] ts2020: implement I2C client bindings
Implement I2C binding model.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 22:24:03 -03:00
Antti Palosaari abd9025b95 [media] ts2020: add support for TS2022
TS2022 is slightly newer and different version of same tuner, which
could be supported with rather small changes. Tuner type is
auto-detected.

Tested-by: David Howells <dhowells@redhat.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 22:24:03 -03:00
Olli Salonen 27254c3634 [media] dw2102: TechnoTrend TT-connect S2-4600 DVB-S/S2 tuner
TechnoTrend TT-connect S2-4600 is a USB2.0 DVB-S/S2 tuner using the popular
Montage M88DS3103/M88TS2022 demod/tuner.

The demodulator needs a firmware. Antti posted a firmware when releasing
support for PCTV 461e, available here:
http://palosaari.fi/linux/v4l-dvb/firmware/M88DS3103/

Signed-off-by: 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-04-02 22:24:02 -03:00
Olli Salonen 70769b24d2 [media] dw2102: store i2c client for tuner into dw2102_state
Prepare the dw2102 driver for tuner drivers that are implemented as I2C
drivers (such as m88ts2022). The I2C client is stored in to the state
and released at disconnect.

Signed-off-by: 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-04-02 22:24:01 -03:00
Olli Salonen 2c4ffe27d0 [media] dw2102: combine su3000_state and s6x0_state into dw2102_state
Two separate state structs are defined for different devices inside the
dw2102. Combine them, as both only contain one element.

This will also make it easier to further cleanup the driver.

Signed-off-by: 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-04-02 22:24:01 -03:00
David Howells 67e6590aa9 [media] m88ts2022: Nested loops shouldn't use the same index variable
There are a pair of nested loops inside m88ts2022_cmd() that use the same
index variable, but for different things.  Split the variable.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 22:24:00 -03:00
Sakari Ailus 0fd68f2f7a [media] smiapp: Clean up smiapp_get_pdata()
Don't set rval when it's not used (the function returns a pointer to struct
smiapp_platform_data).

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 22:24:00 -03:00
Benoit Parrot c4c0283ab3 [media] media: i2c: add support for omnivision's ov2659 sensor
this patch adds support for omnivision's ov2659
sensor, the driver supports following features:
1: Asynchronous probing
2: DT support
3: Media controller support

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.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-04-02 22:15:46 -03:00
Hans Verkuil e202e515b7 [media] vivid-tpg.c: fix wrong Bt.2020 coefficients
Mistyping 0.2627 as 0.2726 I can understand, but -0.4598 as -0.4629? No idea how
I managed that. Anyway, these coefficients are now correct again.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 22:08:19 -03:00
Sakari Ailus 9a68c9fa76 [media] smiapp: Read link-frequencies property from the endpoint node
The documentation stated that the link-frequencies property belongs to the
endpoint node, not to the device's of_node. Fix this.

There are no DT board descriptions using the driver yet, so a fix in the
driver is sufficient.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:57:28 -03:00
Benjamin Larsson 46cf707482 [media] rtl28xxu: lower the rc poll time to mitigate i2c transfer errors
The Astrometa device has issues with i2c transfers. Lowering the
poll time somehow makes these errors disappear.

Signed-off-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-04-02 21:51:37 -03:00
Benjamin Larsson b91bfcda45 [media] r820t: change read_gain() code to match register layout
Signed-off-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-04-02 21:50:57 -03:00
Benjamin Larsson 7b7ef4b4a5 [media] r820t: add DVBC profile in sysfreq_sel
This will make the Astrometa DVB-T/T2/C usb stick be able to pick up
muxes around 290-314 MHz.

Signed-off-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-04-02 21:49:53 -03:00
Laurent Pinchart f2272e1347 [media] v4l: mt9v032: Add OF support
Parse DT properties into a platform data structure when a DT node is
available.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:31:31 -03:00
Laurent Pinchart 2d01209fd2 [media] v4l: mt9v032: Consider control initialization errors as fatal
The device requires control to be properly operated, they're not
optional.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:30:26 -03:00
Laurent Pinchart 7c3be9f812 [media] v4l: mt9p031: Convert to the gpiod API
This simplifies platform data and DT integration.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:29:56 -03:00
Lad, Prabhakar 9012d0888c [media] media: i2c: mt9p031: add support for asynchronous probing
Both synchronous and asynchronous mt9p031 subdevice probing
is supported by this patch.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:28:54 -03:00
Lad, Prabhakar 15af4a532f [media] media: i2c: mt9p031: make sure we destroy the mutex
Make sure to call mutex_destroy() in case of probe failure or module
unload.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:28:19 -03:00
Enrico Scholz 198b47ddd2 [media] mt9p031: fixed calculation of clk_div
There must be used 'min_t', not 'max_t' for calculating the divider.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:19:04 -03:00
Hans Verkuil 82bdb26abc [media] vivid: sanitize selection rectangle
Handle values like ~0 as width, height, left or top fields.
Just strip off the top 16 bits will ensure that the calculations
remain OK.

Found with v4l2-compliance.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:10:45 -03:00
Hans Verkuil 29813a6f34 [media] vivid: report only one frameinterval
The vivid driver reports a range of frame intervals for non-webcams, when in fact
the frame interval is fixed for those inputs as it depends on the DV timings or
standard. Just report the single discrete frame interval instead.

Caught by v4l2-compliance.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:10:11 -03:00
Hans Verkuil 1bd0835a27 [media] vivid: allow s_dv_timings if it is the same as the current
Allow setting the same timings as the current timings (i.e., do nothing in that
case). The code was actually there, but the vb2_is_busy() call was done before
the timings check instead of afterwards.

Found by v4l2-compliance.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:09:35 -03:00
Hans Verkuil 02aa769d9f [media] vivid: add support for 8-bit Bayer formats
Add support for: PIX_FMT_SBGGR8, SGBRG8, SGRBG8 and SRGGB8.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:08:30 -03:00
Hans Verkuil 87c674e243 [media] vivid: use v4l2_device.release to clean up the driver
Use the release callback of the v4l2_device to clean up the memory.
This prevents vivid from breaking if someone tries to unbind the
driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:08:04 -03:00
Hans Verkuil f46d740fb0 [media] vivid: turn this into a platform_device
This turns this driver into a platform device. This ensures that it
appears in /sys/bus/platform_device since it now has a proper parent
device.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:07:36 -03:00
Hans Verkuil 628821c84e [media] vivid: add support for packed YUV formats
Add support for the packed YUV formats YUV444, YUV555, YUV565 and YUV32.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:05:59 -03:00
Hans Verkuil 68cd4e9f21 [media] vivid: add support for BGR666
Add support for the four byte BGR666 format.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:05:37 -03:00
Hans Verkuil 71491063b8 [media] vivid: add support for PIX_FMT_RGB332
Add support for the one-byte-per-pixel RGB332 format.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:04:51 -03:00
Hans Verkuil dde72bd773 [media] vivid: add support for NV24 and NV42
Add support for the YUV 4:4:4 formats NV24 and NV42.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:04:24 -03:00
Hans Verkuil 8f1ff5435d [media] vivid: add support for [A|X]RGB555X
Only RGB555X was supported, add support for the other two variants.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:03:31 -03:00
Hans Verkuil 9e1b73cfed [media] vivid: fix format comments
Clarify which formats have an alpha channel and which do not by
using 'x' instead of 'a' if there is no alpha channel.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:03:07 -03:00
Hans Verkuil 8aca230b6d [media] vivid: add RGB444 support
Add support for (A/X)RGB444 formats.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:02:45 -03:00
Hans Verkuil b521c37551 [media] vivid: add the new planar and monochrome formats
Everything is in place to support these formats, so add them to
the list.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:55:36 -03:00
Hans Verkuil 1f9f23f62f [media] vivid: add downsampling support
Add support in vivid for downsampling. Most of the changes are in
vivid_copy_buffer which needs to know about the right line widths.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:55:12 -03:00
Hans Verkuil ddcaee9dd4 [media] vivid: add support for single buffer planar formats
Make vivid aware of the difference of planes and buffers. Note that
this does not yet add support for hor/vert downsampled formats.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:54:24 -03:00
Hans Verkuil 96c76efae3 [media] vivid: add new format fields
These fields are necessary to handle the new planar formats.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:50:14 -03:00
Hans Verkuil ecb9e91b2d [media] vivid-tpg: split off the pattern drawing code
The last part of the vivid-tpg refactoring: split off the pattern
drawing code into a function of its own. This greatly improves the
readability and maintainability of this code.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:49:36 -03:00
Hans Verkuil c6ff1c1b5b [media] vivid-tpg: move the 'extras' drawing to a separate function
This moves the drawing code for the extras (border, square, etc) to
a function of its own instead of having this in the main for loop.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:48:53 -03:00
Hans Verkuil 07386b9ab1 [media] vivid-tpg: move 'extras' parameters to tpg_draw_params
Any parameters related to drawing 'extras' like the border, the square,
etc. are moved to struct tpg_draw_params.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:48:22 -03:00
Hans Verkuil f0ce4fd6e0 [media] vivid-tpg: move pattern-related fields to struct tpg_draw_params
Add a new function that fills in pattern-related fields in struct
tpg_draw_params.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:47:46 -03:00
Hans Verkuil 5e72939322 [media] vivid-tpg: move common parameters to tpg_draw_params
Replace local variables by fields in the tpg_draw_params struct.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:47:17 -03:00
Hans Verkuil e76036d850 [media] vivid-tpg: add a new tpg_draw_params structure
This is needed to refactor the drawing function which is much too big.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:46:45 -03:00
Hans Verkuil dfff048953 [media] vivid-tpg: add const where appropriate
Added 'const' to several functions where that is possible to do.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:46:19 -03:00
Hans Verkuil 9991deff1a [media] vivid-tpg: add helper functions to simplify common calculations
Add helper functions to handle horizontal downscaling and horizontal
scaling.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:45:22 -03:00
Hans Verkuil 51f3096835 [media] vivid-tpg: add support for V4L2_PIX_FMT_GREY
Add monochrome support to the TPG.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:43:41 -03:00
Hans Verkuil 68c90d6496 [media] vivid-tpg: add support for more planar formats
Now that the support for hor/vert downsampled planar formats is in
place we can add support for such formats to the TPG.

This patch adds support for:

V4L2_PIX_FMT_YUV420M
V4L2_PIX_FMT_YVU420M
V4L2_PIX_FMT_YUV420
V4L2_PIX_FMT_YVU420
V4L2_PIX_FMT_YUV422P
V4L2_PIX_FMT_NV16
V4L2_PIX_FMT_NV61
V4L2_PIX_FMT_NV12
V4L2_PIX_FMT_NV21
V4L2_PIX_FMT_NV12P
V4L2_PIX_FMT_NV21P

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:43:03 -03:00
Hans Verkuil 280abe474e [media] vivid-tpg: finish hor/vert downsampling support
Implement horizontal and vertical downsampling when filling in the
plane. The TPG is now ready to support such formats.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:41:49 -03:00
Hans Verkuil 3e14e7a82c [media] vivid-tpg: add hor/vert downsampling support to tpg_gen_text
This will just skip lines/pixels since color fidelity is not quite
as important here as it is with the test patterns themselves.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:40:49 -03:00
Hans Verkuil 1f088dc162 [media] vivid-tpg: correctly average the two pixels in gen_twopix()
gen_twopix() is always called twice: once for the first and once for
the second pixel. Improve the code to properly average the two if the
format requires horizontal downsampling.

This is necessary for patterns like 1x1 red/blue checkers.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:40:17 -03:00
Hans Verkuil 5d7c539e19 [media] vivid-tpg: precalculate downsampled lines
When dealing with vertical downsampling two successive lines have to be
averaged. In the case of the test pattern generator that only happens
if the two lines are using different patterns. So precalculate the average
between two pattern lines: one of pattern P and one of pattern P + 1.

That way there is no need to do any on-the-fly downsampling: it's all done
in the precalculate phase.

This patch also implements horizontal downsampling in the precalculate phase.
The only thing that needs to be done is to half the width since the actual
downsampling happens when two pixels at a time are generated.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:39:07 -03:00
Hans Verkuil ba01f673e0 [media] vivid-tpg: add hor/vert downsampling fields
This is step one of supporting horizontal and vertical downsampling.
This just adds support for the h/vdownsampling fields and it increases
the maximum number of planes to 3.

Currently none of the planar formats need horizontal or vertical
downsampling, so this change has no effect at the moment.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:38:04 -03:00
Hans Verkuil 4db2204189 [media] vivid-tpg: add helper functions for single buffer planar formats
Add helpers functions to determine the line widths and image sizes
for planar formats that are stores in a single buffer.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:37:26 -03:00
Hans Verkuil 06d1f0c2ea [media] vivid-tpg: separate planes and buffers
Add a new field that contains the number of buffers. This may be
less than the number of planes in case multiple planes are combined
into one buffer.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:35:37 -03:00
Hans Verkuil ba24b44203 [media] vivid: do not allow video loopback for SEQ_TB/BT
Sequential top-bottom/bottom-top fields are not supported as video loopback.
This is too much work to implement for field settings that are rarely used.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:33:37 -03:00
Hans Verkuil 9c35bd48d5 [media] vivid-tpg: don't add offset when switching to monochrome
The grayscale values are still full range sRGB, so don't add the
limited range offset.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:32:58 -03:00
Hans Verkuil 1a05d3133f [media] vivid: add new checkboard patterns
Add a 2x2 checker patterns and 1x1 and 2x2 red/blue checker patterns.

Useful for testing 4:2:2 and 4:2:0 formats.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:32:29 -03:00
Hans Verkuil 43047f6b74 [media] vivid: fix test pattern movement for V4L2_FIELD_ALTERNATE
The successive TOP/BOTTOM fields did not move as they should: only
every other field actually changed position.

The cause was that the tpg needs to know if it is dealing with a
FIELD_ALTERNATE case since that requires slightly different handling.

So tell the TPG whether or not the field setting is for the ALTERNATE
case or not.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:30:57 -03:00
Hans Verkuil c501abcfbf [media] vivid: use TPG_MAX_PLANES instead of hardcoding plane-arrays
Two arrays of size 'max number of planes' have a hardcoded size instead
of using TPG_MAX_PLANES. Fix that, since TPG_MAX_PLANES will be increased
later on.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:30:16 -03:00
Hans Verkuil a94e7d6e82 [media] vivid: wrong top/bottom order for FIELD_ALTERNATE
The condition to decide whether the current field is top or bottom
was inverted. Fix this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:29:48 -03:00
Hans Verkuil 360565fcf7 [media] vivid: fix typo in plane size checks
The plane size check was hardcoded to plane 0 instead of using the plane
index.

This failed when using the NV61M format which has a larger plane size for
the second plane compared to the first plane.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:29:19 -03:00
Hans Verkuil 9832e0e013 [media] vivid: the overlay API wasn't disabled completely for multiplanar
If the vivid driver is loaded in multiplanar mode, then the capture overlay
functionality should be disabled. This wasn't fully done, which led to
v4l2-compliance errors.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 20:28:16 -03:00
Laurent Pinchart 739cfd9be9 [media] rcar-vin: Don't implement empty optional clock operations
The clock_start and clock_stop operations are now optional, don't
implement empty stubs.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:37:37 -03:00
Laurent Pinchart 3781760a3d [media] soc-camera: Make clock_start and clock_stop operations optional
Instead of forcing drivers to implement empty clock operations, make
them optional.

v4l2 clock registration in the soc-camera core should probably be
conditionned on the availability of those operations, but careful
review and/or testing of all drivers would be needed, so that should be
a separate step.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:37:19 -03:00
Laurent Pinchart 2af12f0258 [media] soc-camera: Unregister v4l2 clock in the OF bind error path
The v4l2 clock registered in soc_of_bind() must be unregistered if an
error occurs and makes the function fail.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:36:33 -03:00
Josh Wu 4e65172f7b [media] media: ov2640: add primary dt support
Add device tree support for ov2640.
In device tree, user needs to provide the master clock (xvclk).
User can add the reset/pwdn pins if they have.

Cc: devicetree@vger.kernel.org
Signed-off-by: Josh Wu <josh.wu@atmel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:36:10 -03:00
Josh Wu f180ebae1a [media] media: ov2640: add async probe function
In async probe, there is a case that ov2640 is probed before the
host device which provided 'mclk'.
To support this async probe, we will get 'mclk' at first in the probe(),
if failed it will return -EPROBE_DEFER. That will let ov2640 wait for
the host device probed.

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-04-02 18:34:42 -03:00
Josh Wu 0b9508aa03 [media] media: soc-camera: use icd->control instead of icd->pdev for reset()
icd->control is the sub device dev, i.e. i2c device.
icd->pdev is the soc camera device's device.

To be consitent with power() function, we will call reset() with
icd->control as well.

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-04-02 18:34:10 -03:00
Guennadi Liakhovetski 4f528afcfb [media] V4L: add CCF support to the v4l2_clk API
V4L2 clocks, e.g. used by camera sensors for their master clock, do not
have to be supplied by a different V4L2 driver, they can also be
supplied by an independent source. In this case the standart kernel
clock API should be used to handle such clocks. This patch adds support
for such cases.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:33:42 -03:00
Guennadi Liakhovetski a37462b919 [media] V4L: remove clock name from v4l2_clk API
All uses of the v4l2_clk API so far only register one clock with a fixed
name. This allows us to get rid of it, which also will make CCF and DT
integration easier.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:32:53 -03:00
Hans Verkuil 9b239b22df [media] v4l2-ioctl: allow all controls if ctrl_class == 0
The check_ext_ctrls() function in v4l2-ioctl.c checks if all controls in the
control array are from the same control class as c->ctrl_class. However,
that check should only be done if c->ctrl_class != 0. A 0 value means
that this restriction does not apply.

So return 1 (OK) if c->ctrl_class == 0.

Found by running v4l2-compliance on the uvc driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:30:36 -03:00
Hans Verkuil 2c9fc463d6 [media] v4l2-dev: disable selection ioctls for non-video devices
The selection/cropping ioctls are only valid for video nodes, not for vbi.

Found by v4l2-compliance when run on a VBI device node.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:30:00 -03:00
Hans Verkuil 8a55ddd94c [media] au0828: fix broken streaming
Commit c5036d61e0 ("media: au0828: drop
vbi_buffer_filled() and re-use buffer_filled()") broke video and vbi streaming.

The vb2_buffer struct was copied instead of taking a pointer to it, but
vb2_buffer_done() needs the real object, not a copy, since it is hooking
the buffer into a different list.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:28:59 -03:00
Hans Verkuil 27eb5e24e0 [media] cx231xx: fix compiler warnings
If CONFIG_VIDEO_CX231XX_RC is undefined, then these compiler warnings
are generated:

In file included from drivers/media/usb/cx231xx/cx231xx-cards.c:23:0:
drivers/media/usb/cx231xx/cx231xx-cards.c: In function ‘cx231xx_release_resources’:
drivers/media/usb/cx231xx/cx231xx.h:982:30: warning: statement with no effect [-Wunused-value]
 #define cx231xx_ir_exit(dev) (0)
                              ^
drivers/media/usb/cx231xx/cx231xx-cards.c:1158:2: note: in expansion of macro ‘cx231xx_ir_exit’
  cx231xx_ir_exit(dev);
  ^
drivers/media/usb/cx231xx/cx231xx-cards.c: In function ‘cx231xx_init_dev’:
drivers/media/usb/cx231xx/cx231xx.h:981:30: warning: statement with no effect [-Wunused-value]
 #define cx231xx_ir_init(dev) (0)
                              ^
drivers/media/usb/cx231xx/cx231xx-cards.c:1351:2: note: in expansion of macro ‘cx231xx_ir_init’
  cx231xx_ir_init(dev);
  ^
drivers/media/usb/cx231xx/cx231xx-cards.c: In function ‘cx231xx_usb_probe’:
drivers/media/usb/cx231xx/cx231xx.h:982:30: warning: statement with no effect [-Wunused-value]
 #define cx231xx_ir_exit(dev) (0)
                              ^
drivers/media/usb/cx231xx/cx231xx-cards.c:1705:2: note: in expansion of macro ‘cx231xx_ir_exit’
  cx231xx_ir_exit(dev);
  ^
drivers/media/usb/cx231xx/cx231xx-cards.c: In function ‘cx231xx_usb_disconnect’:
drivers/media/usb/cx231xx/cx231xx.h:982:30: warning: statement with no effect [-Wunused-value]
 #define cx231xx_ir_exit(dev) (0)
                              ^
drivers/media/usb/cx231xx/cx231xx-cards.c:1754:3: note: in expansion of macro ‘cx231xx_ir_exit’
   cx231xx_ir_exit(dev);
   ^

Fix by using static inlines instead of defines.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:24:04 -03:00
Arnd Bergmann 78e9b7de78 [media] wl128x-radio really depends on TI_ST
All other drivers using the TI_ST infrastructure use
'depends on' for this symbol, and it makes no sense
to only enable that if CONFIG_NET is enable, because
the radio driver also depends on CONFIG_NET itself:

ERROR: "skb_queue_purge" [drivers/media/radio/wl128x/fm_drv.ko] undefined!
ERROR: "skb_push" [drivers/media/radio/wl128x/fm_drv.ko] undefined!
ERROR: "skb_pull" [drivers/media/radio/wl128x/fm_drv.ko] undefined!

Making the driver dependency explicit solves randconfig
build problems and makes it more obvious to the reader.

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-04-02 18:23:28 -03:00
Hans Verkuil f2e37b9b73 [media] rtl2832: fix compiler warning
>From the daily build:

rtl2832.c: In function 'rtl2832_read_status':
rtl2832.c:703:12: warning: 'tmp' may be used uninitialized in this function [-Wmaybe-uninitialized]
  } else if (tmp == 10) {
            ^

The code is OK, it's just the compiler that cannot figure out what's
going on. So just init 'tmp' to 0.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:22:54 -03:00
Julia Lawall fae119bedd [media] media: pci: cx23885: don't export static symbol
The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
type T;
identifier f;
@@

static T f (...) { ... }

@@
identifier r.f;
declarer name EXPORT_SYMBOL;
@@

-EXPORT_SYMBOL(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-04-02 18:21:53 -03:00
Ezequiel Garcia aeff092767 [media] stk1160: Make sure current buffer is released
The available (i.e. not used) buffers are returned by stk1160_clear_queue(),
on the stop_streaming() path. However, this is insufficient and the current
buffer must be released as well. Fix it.

Cc: stable@vger.kernel.org
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:18:37 -03:00
Lad, Prabhakar e933c6bc67 [media] media: davinci: vpif_display: embed video_device struct in channel_obj
Embed video_device struct (video_dev) in channel_obj and also the
Unregister path doesn't need to free the video_device structure,
hence, change the video_device.release callback point to
video_device_release_empty.

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-04-02 18:12:43 -03:00
Lad, Prabhakar 8eef6669d3 [media] media: davinci: vpif_capture: embed video_device struct in channel_obj
Embed video_device struct (video_dev) in channel_obj and also the
Unregister path doesn't need to free the video_device structure,
hence, change the video_device.release callback point to
video_device_release_empty.

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-04-02 18:11:54 -03:00
Lad, Prabhakar afb7a966b5 [media] media: blackfin: bfin_capture: embed video_device struct in bcap_device
Embed video_device struct (video_dev) in bcap_device and
Unregister path doesn't need to free the video_device
structure, hence, change the video_device.release callback
point to video_device_release_empty.

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-04-02 18:11:50 -03:00
Lad, Prabhakar 225ccaa307 [media] media: blackfin: bfin_capture: drop bcap_get_unmapped_area()
this patch drops bcap_get_unmapped_area() and uses
vb2_fop_get_unmapped_area() helper provided by the vb2 core.

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-04-02 18:11:49 -03:00
Lad, Prabhakar 9d490e529d [media] media: blackfin: bfin_capture: set v4l2 buffer sequence
this patch adds support to set the v4l2 buffer sequence.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:11:48 -03:00
Lad, Prabhakar 812447e587 [media] media: blackfin: bfin_capture: add support for VIDIOC_EXPBUF
this patch adds support for VIDIOC_EXPBUF.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:11:46 -03:00
Lad, Prabhakar 70753b5e70 [media] media: blackfin: bfin_capture: add support for VB2_DMABUF
this patch adds support for VB2_DMABUF.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:11:45 -03:00
Lad, Prabhakar 8df229bdec [media] media: blackfin: bfin_capture: add support for vidioc_create_bufs
this patch adds support for vidioc_create_bufs.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:11:44 -03:00
Lad, Prabhakar 116a6488d3 [media] media: blackfin: bfin_capture: return -ENODATA for *dv_timings calls
this patch adds support to return -ENODATA for *dv_timings calls
if the current output does not support it.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:11:43 -03:00
Lad, Prabhakar fe00b716e7 [media] media: blackfin: bfin_capture: return -ENODATA for *std calls
this patch adds supports to return -ENODATA to *_std calls
if the selected output does not support it.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:11:40 -03:00
Lad, Prabhakar 2bf34b2f09 [media] media: blackfin: bfin_capture: make sure all buffers are returned on stop_streaming() callback
In start_streaming() callback the buffer is removed from the
dma_queue list and assigned to cur_frm, this patch makes sure
that is returned to vb2 core with VB2_BUF_STATE_ERROR flag.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:11:33 -03:00
Lad, Prabhakar d61233bf4c [media] media: blackfin: bfin_capture: use vb2_ioctl_* helpers
this patch adds support to vb2_ioctl_* helpers.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:11:29 -03:00
Lad, Prabhakar f0e91c65a9 [media] media: blackfin: bfin_capture: use v4l2_fh_open and vb2_fop_release
this patch adds support to use v4l2_fh_open() and vb2_fop_release,
which allows to drop driver specific struct bcap_fh, as this is handled
by core.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:11:26 -03:00
Lad, Prabhakar 8fd05b7eee [media] media: blackfin: bfin_capture: use vb2_fop_mmap/poll
No need to reinvent the wheel. Just use the already existing
functions provided by vb2.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:11:23 -03:00
Lad, Prabhakar f314002279 [media] media: blackfin: bfin_capture: improve queue_setup() callback
This patch does the following:
a: returns -EINVAL in case format image size is less
   then current image size.
b: assigns nbuffers to two in case the total of vq->num_buffers
   and nbuffers is less then the number of buffers required by driver.
c: sets the sizes[0] of plane according to the fmt passed or which is
   being set in the device.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:11:18 -03:00
Lad, Prabhakar cd3c38effc [media] media: blackfin: bfin_capture: set vb2 buffer field
set the vb2 buffer field in buf_prepare() callback,
alongside drop local variable buf as we already have
a pointer to vb2 buffer.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:11:15 -03:00
Lad, Prabhakar 5f65ca81c3 [media] media: blackfin: bfin_capture: set min_buffers_needed
this patch sets the min_buffers_needed field of the vb2 queue
so that the vb2 core will make sure start_streaming() callback
is called only when we have minimum buffers queued.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:11:12 -03:00
Lad, Prabhakar 6692871a7c [media] media: blackfin: bfin_capture: release buffers in case start_streaming() call back fails
this patch adds support to release the buffer by calling
vb2_buffer_done(), with state marked as VB2_BUF_STATE_QUEUED
if start_streaming() call back fails.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:11:09 -03:00
Lad, Prabhakar b4e81b2378 [media] media: blackfin: bfin_capture: drop buf_init() callback
this patch drops the buf_init() callback as init
of buf list is not required.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:11:03 -03:00