GitHub/LineageOS/android_kernel_motorola_exynos9610.git
9 years ago[media] dvb: Get rid of typedev usage for enums
Mauro Carvalho Chehab [Sun, 7 Jun 2015 17:53:52 +0000 (14:53 -0300)]
[media] dvb: Get rid of typedev usage for enums

The DVB API was originally defined using typedefs. This is against
Kernel CodingStyle, and there's no good usage here. While we can't
remove its usage on userspace, we can avoid its usage in Kernelspace.

So, let's do it.

This patch was generated by this shell script:

for j in $(grep typedef include/uapi/linux/dvb/frontend.h |cut -d' ' -f 3); do for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f); do sed "s,${j}_t,enum $j," <$i >a && mv a $i; done; done

While here, make CodingStyle fixes on the affected lines.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> # for drivers/media/firewire/*
9 years ago[media] DocBook: add xrefs for enum fe_type
Mauro Carvalho Chehab [Sun, 7 Jun 2015 17:31:13 +0000 (14:31 -0300)]
[media] DocBook: add xrefs for enum fe_type

The only enum that was missing xrefs at frontend.h is fe_type.
Add xrefs for them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: properly document the delivery systems
Mauro Carvalho Chehab [Sun, 7 Jun 2015 17:21:09 +0000 (14:21 -0300)]
[media] DocBook: properly document the delivery systems

Use a table for the delivery systems. The table is organized
by the type (cable, satellite, terrestrial) and shows what
standards are not fully implemented.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: better document the DVB-S2 rolloff factor
Mauro Carvalho Chehab [Sun, 7 Jun 2015 14:59:27 +0000 (11:59 -0300)]
[media] DocBook: better document the DVB-S2 rolloff factor

Instead of using a program listing, use a table and make clearer
what each define means.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: Remove duplicated documentation for SEC_VOLTAGE_*
Mauro Carvalho Chehab [Sun, 7 Jun 2015 14:34:12 +0000 (11:34 -0300)]
[media] DocBook: Remove duplicated documentation for SEC_VOLTAGE_*

The table were documented at the legacy ioctl call. Move it
to the DVBv5 ioctl, and add a cross ref link on the legacy
section.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: document DVB-S2 pilot in a table
Mauro Carvalho Chehab [Sun, 7 Jun 2015 14:18:16 +0000 (11:18 -0300)]
[media] DocBook: document DVB-S2 pilot in a table

Putting it into a table allows to comment each possible
values, with makes more clear what field means.

Also, it allows to do cross-references with the frontend.h.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: Add documentation for ATSC M/H properties
Mauro Carvalho Chehab [Sun, 7 Jun 2015 13:59:32 +0000 (10:59 -0300)]
[media] DocBook: Add documentation for ATSC M/H properties

Those data were retrieved by looking at A/153: ATSC Mobile DTV
Standard and guessing what makes more sense to each field.

Cc: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: add placeholders for ATSC M/H properties
Mauro Carvalho Chehab [Sun, 7 Jun 2015 10:14:14 +0000 (07:14 -0300)]
[media] DocBook: add placeholders for ATSC M/H properties

The ATSC M/H specific properties are not properly documented.
This became crearer when converting the existing data into
tables and adding cross references.

For now, just add placeholders, as a further investigation
about the meaning of each parameter is required.

Cc: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: remove a wrong cut-and-paste data
Mauro Carvalho Chehab [Sun, 7 Jun 2015 09:54:37 +0000 (06:54 -0300)]
[media] DocBook: remove a wrong cut-and-paste data

By cut-and-paste mistake, TRANSMISSION_MODE_AUTO were documented
twice, one at the wrong place.

Remove the wrong one.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: add IDs for enum fe_bandwidth
Mauro Carvalho Chehab [Sun, 7 Jun 2015 09:37:20 +0000 (06:37 -0300)]
[media] DocBook: add IDs for enum fe_bandwidth

enum fe_bandwidth is documented at the frontend legacy xml
file.

Add xrefs for each entry there. This makes the hyperlinks at
frontend.h to go directly to the right documentation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: Better document DTMB time interleaving
Mauro Carvalho Chehab [Sun, 7 Jun 2015 09:35:20 +0000 (06:35 -0300)]
[media] DocBook: Better document DTMB time interleaving

The DTMB time interleaving was not properly documented. Add
a documentation for it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: Add entry IDs for the enums defined at dvbproperty.xml
Mauro Carvalho Chehab [Sun, 7 Jun 2015 09:20:18 +0000 (06:20 -0300)]
[media] DocBook: Add entry IDs for the enums defined at dvbproperty.xml

There are lots of enums that are defined at dvbproperty.

Add xrefs for each entry there. This makes the hyperlinks at
frontend.h to go directly to the right documentation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] Docbook: add entry IDs for enum fe_sec_voltage
Mauro Carvalho Chehab [Sun, 7 Jun 2015 09:12:28 +0000 (06:12 -0300)]
[media] Docbook: add entry IDs for enum fe_sec_voltage

enum fe_sec_voltage is documented together with FE_SET_VOLTAGE.

Add xrefs for each entry there. This makes the hyperlinks at
frontend.h to go directly to the right documentation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: add entry IDs for enum fe_sec_tone_mode
Mauro Carvalho Chehab [Sun, 7 Jun 2015 09:10:38 +0000 (06:10 -0300)]
[media] DocBook: add entry IDs for enum fe_sec_tone_mode

enum fe_sec_tone_mode is documented together with FE_SET_TONE.

Add xrefs for each entry there. This makes the hyperlinks at
frontend.h to go directly to the right documentation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: add entry IDs for enum fe_status
Mauro Carvalho Chehab [Sun, 7 Jun 2015 09:09:57 +0000 (06:09 -0300)]
[media] DocBook: add entry IDs for enum fe_status

enum fe_status is documented together with FE_READ_STATUS.

Add xrefs for each entry there. This makes the hyperlinks at
frontend.h to go directly to the right documentation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: add entry IDs for enum fe_sec_mini_cmd
Mauro Carvalho Chehab [Sun, 7 Jun 2015 08:49:51 +0000 (05:49 -0300)]
[media] DocBook: add entry IDs for enum fe_sec_mini_cmd

enum fe_sec_mini_cmd is documented together with
FE_DISEQC_SEND_BURST.

Add xrefs for each entry there. This makes the hyperlinks at
frontend.h to go directly to the right documentation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: Add entry IDs for enum fe_caps
Mauro Carvalho Chehab [Sun, 7 Jun 2015 08:39:03 +0000 (05:39 -0300)]
[media] DocBook: Add entry IDs for enum fe_caps

enum fe_caps is documented at FE_GET_INFO ioctl. Add xrefs
for each entry there. This makes the hyperlinks at frontend.h
to go directly to the right documentation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: handle enums on frontend.h
Mauro Carvalho Chehab [Sun, 7 Jun 2015 08:21:51 +0000 (05:21 -0300)]
[media] DocBook: handle enums on frontend.h

In order to be sure that all enum definitions will be documented,
let's parse the enum values and add xref links to them.

Lots of missing references will be risen as we miss adding
id's to those symbols at the documentation. Next patches will
fix this.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx231xx: fix compiler warning
Hans Verkuil [Sat, 6 Jun 2015 08:02:32 +0000 (05:02 -0300)]
[media] cx231xx: fix compiler warning

Fix this compiler warning by allocating a structure to read the eeprom instead
of doing it on the stack and worse: the eeprom array is static, so that can
cause problems if there are multiple cx231xx instances.

cx231xx-cards.c: In function 'cx231xx_card_setup':
cx231xx-cards.c:1110:1: warning: the frame size of 2064 bytes is larger than 2048 bytes [-Wframe-larger-than=]
 }
 ^

I did consider removing the code altogether since the result is actually
not used at the moment, but I decided against it since it is used in other
drivers and someone might want to start using it in this driver as well. And
then it is useful that the code is already there.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vivid: Use interlaced info for cvt/gtf timing detection
Prashant Laddha [Fri, 22 May 2015 05:27:35 +0000 (02:27 -0300)]
[media] vivid: Use interlaced info for cvt/gtf timing detection

The detect_cvt/gtf() now supports timing calculations for interlaced
format.

Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-dv-timings: add interlace support in detect cvt/gtf
Prashant Laddha [Fri, 22 May 2015 05:27:34 +0000 (02:27 -0300)]
[media] v4l2-dv-timings: add interlace support in detect cvt/gtf

Extend detect_cvt/gtf API to indicate the format type (interlaced
or progressive). In case of interlaced, the vertical front and back
porch and vsync values for both (odd,even) fields are considered to
derive image height. Populated vsync, vertical front, back porch
values in bt timing structure for even and odd fields and updated
the flags appropriately.

Also modified the functions calling the detect_cvt/gtf(). As of now
these functions are calling detect_cvt/gtf() with interlaced flag
set to false.

Cc: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@cisco.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-dv-timings: support interlaced in v4l2_print_dv_timings
Hans Verkuil [Fri, 5 Jun 2015 08:30:02 +0000 (05:30 -0300)]
[media] v4l2-dv-timings: support interlaced in v4l2_print_dv_timings

The v4l2_print_dv_timings() didn't log the interlaced format correctly. The timings
for the bottom field weren't logged and the fields per second value was half of what
it should have been.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-dv-timing: avoid rounding twice in gtf hblank calc
Prashant Laddha [Fri, 5 Jun 2015 08:13:31 +0000 (05:13 -0300)]
[media] v4l2-dv-timing: avoid rounding twice in gtf hblank calc

Currently, in gtf hblank calculations, the rounding is used twice,
one at intermediate division and one at final state where hblank
is rounded to nearest multiple of twice cell granularity. This
error got introduced in 'commit d7ed5a3ddaec ("[media]
v4l2-dv-timings: fix rounding in hblank and hsync calculation"),
where it missed combining the rounding step. Correcting the same
in this patch.

Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] adv7604: log alt-gamma and HDMI colorspace
Hans Verkuil [Sun, 7 Jun 2015 10:32:35 +0000 (07:32 -0300)]
[media] adv7604: log alt-gamma and HDMI colorspace

Log the alternate gamma state and the HDMI colorspace that the adv
device detected.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] adv7604: fix broken saturator check
Hans Verkuil [Sun, 7 Jun 2015 10:32:34 +0000 (07:32 -0300)]
[media] adv7604: fix broken saturator check

The logging of the saturator status was wrong due to an incorrect
condition.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] adv7604: log infoframes
Hans Verkuil [Sun, 7 Jun 2015 10:32:33 +0000 (07:32 -0300)]
[media] adv7604: log infoframes

Add support for logging the detected InfoFrames for the adv76xx. Helps in
debugging what is actually received on the HDMI link.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] adv7511: log the currently set infoframes
Hans Verkuil [Sun, 7 Jun 2015 10:32:32 +0000 (07:32 -0300)]
[media] adv7511: log the currently set infoframes

The adv7511 sets up InfoFrames that are used when transmitting video.
Log the contents of those InfoFrames so it is possible to see exactly what
the transmitter is sending.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] adv7842: replace uintX_t by uX for consistency
Hans Verkuil [Sun, 7 Jun 2015 10:32:31 +0000 (07:32 -0300)]
[media] adv7842: replace uintX_t by uX for consistency

Currently this driver mixes u8/u32 and uint8_t/uint32_t. Standardize on
u8/u32.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] adv7511: replace uintX_t by uX for consistency
Hans Verkuil [Sun, 7 Jun 2015 10:32:30 +0000 (07:32 -0300)]
[media] adv7511: replace uintX_t by uX for consistency

Currently this driver mixes u8/u16 and uint8_t/uint16_t. Standardize on
u8/u16.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vim2m: add create_bufs and prepare_buf support
Hans Verkuil [Fri, 5 Jun 2015 14:28:52 +0000 (11:28 -0300)]
[media] vim2m: add create_bufs and prepare_buf support

Add support for the missing VIDIOC_CREATE_BUFS and VIDIOC_PREPARE_BUF
ioctls.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-mem2mem: add support for prepare_buf
Hans Verkuil [Fri, 5 Jun 2015 14:28:50 +0000 (11:28 -0300)]
[media] v4l2-mem2mem: add support for prepare_buf

This was never added for some reason, so add it now.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] fc2580: add missing error status when probe() fails
Antti Palosaari [Sat, 6 Jun 2015 11:15:34 +0000 (08:15 -0300)]
[media] fc2580: add missing error status when probe() fails

We must return -ENODEV error on case probe() fails to detect chip.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] tda10071: add missing error status when probe() fails
Antti Palosaari [Sat, 6 Jun 2015 11:11:16 +0000 (08:11 -0300)]
[media] tda10071: add missing error status when probe() fails

We must return -ENODEV error on case probe() fails to detect chip.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] m88ds3103: a couple missing error codes
Dan Carpenter [Tue, 2 Jun 2015 10:20:00 +0000 (07:20 -0300)]
[media] m88ds3103: a couple missing error codes

We need to set some error codes here.

Fixes: f01919e8f54f ('[media] m88ds3103: add I2C client binding')

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: Use constant tag for monospaced fonts
Mauro Carvalho Chehab [Tue, 2 Jun 2015 19:41:01 +0000 (16:41 -0300)]
[media] DocBook: Use constant tag for monospaced fonts

As reminded by Jonathan, several places where emphasys
role="tt" were used are actually trying to change the font to
monospaced.

We do that, on other places, by using the constant tag.

So, use it here too.

Reported-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: fix some syntax issues at dvbproperty.xml
Mauro Carvalho Chehab [Tue, 2 Jun 2015 19:17:16 +0000 (16:17 -0300)]
[media] DocBook: fix some syntax issues at dvbproperty.xml

Some minor English syntax fixes.

Reported-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] Docbook: typo fix: use note(d) instead of notice(d)
Mauro Carvalho Chehab [Tue, 2 Jun 2015 17:59:07 +0000 (14:59 -0300)]
[media] Docbook: typo fix: use note(d) instead of notice(d)

We don't want to announce anything, but to add a note ;)
So:
notice  -> note
notided -> noted

While here, fix another typo at media_api.tmpl:
with -> which

Reported-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: Change DTD schema to version 4.5
Mauro Carvalho Chehab [Tue, 2 Jun 2015 11:36:36 +0000 (08:36 -0300)]
[media] DocBook: Change DTD schema to version 4.5

According with the docs at docbook.org, no backward compatible
changes were done between 4.2 and 4.5 schemas. Some fixes were
added, together with new features. So, let's use the latest
4.x schema.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: specify language and encoding for the document
Mauro Carvalho Chehab [Tue, 2 Jun 2015 10:40:53 +0000 (07:40 -0300)]
[media] DocBook: specify language and encoding for the document

Define the usage of UTF-8 encoding and let clear that the document
is in English.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: document DVB net API
Mauro Carvalho Chehab [Mon, 1 Jun 2015 11:56:49 +0000 (08:56 -0300)]
[media] DocBook: document DVB net API

The DVB network API was not documented. There are just some
placeholders there.

Replace it by a proper documentation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-ioctl: log buffer type 0 correctly
Hans Verkuil [Fri, 5 Jun 2015 14:28:51 +0000 (11:28 -0300)]
[media] v4l2-ioctl: log buffer type 0 correctly

If userspace passed the invalid buffer type 0 to the kernel, then the
kernel log would show 'type=(null)' since there was no string defined
for type 0. Fix this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook media: correct description of reserved fields
Hans Verkuil [Fri, 5 Jun 2015 08:11:15 +0000 (05:11 -0300)]
[media] DocBook media: correct description of reserved fields

Make sure that the documentation clearly states who is zeroing reserved
fields: drivers and/or applications.

This patch syncs the documentation with the checks that v4l2-compliance
and valgrind do.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-ioctl: clear the reserved field of v4l2_create_buffers
Hans Verkuil [Fri, 5 Jun 2015 08:11:14 +0000 (05:11 -0300)]
[media] v4l2-ioctl: clear the reserved field of v4l2_create_buffers

This field was never cleared by the kernel making future extensions
hard to implement. Clear it now.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vivid-tpg: improve Y16 color setup
Hans Verkuil [Fri, 5 Jun 2015 06:45:38 +0000 (03:45 -0300)]
[media] vivid-tpg: improve Y16 color setup

Currently the colors for the Y16 and Y16_BE pixelformats are in the range
0x0000-0xff00. So pure white (0xffff) is never created.

Improve this by making white really white. For other colors the lsb remains 0
so vivid can be used to detect endian problems.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Ricardo Ribalda <ricardo.ribalda@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] radio-si470x-i2c: Pass the IRQF_ONESHOT flag
Fabio Estevam [Mon, 1 Jun 2015 17:14:07 +0000 (14:14 -0300)]
[media] radio-si470x-i2c: Pass the IRQF_ONESHOT flag

Since commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests")
threaded IRQs without a primary handler need to be requested with
IRQF_ONESHOT, otherwise the request will fail.

So pass the IRQF_ONESHOT flag in this case.

The semantic patch that makes this change is available
in scripts/coccinelle/misc/irqf_oneshot.cocci.

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>
9 years ago[media] stk1160: add DMABUF support
Hans Verkuil [Mon, 1 Jun 2015 11:18:31 +0000 (08:18 -0300)]
[media] stk1160: add DMABUF support

Implement DMABUF exporting and importing.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vivid: move video loopback control to the capture device
Hans Verkuil [Mon, 1 Jun 2015 10:15:53 +0000 (07:15 -0300)]
[media] vivid: move video loopback control to the capture device

This has been on my TODO list for some time now: the control that enables the video
loopback was part of the controls of the video output device instead of the video
capture device. In practice this was quite annoying since you expect it at the capture
side since that's where you want to make the decision whether to use the TPG or looped
video.

This patch moves the control from the output to the capture side.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] omap_vout: use swap() in omapvid_init()
Fabian Frederick [Mon, 18 May 2015 17:54:17 +0000 (14:54 -0300)]
[media] omap_vout: use swap() in omapvid_init()

Use kernel.h macro definition.

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>
9 years ago[media] saa7134: switch tuner FMD1216ME_MK3 to analog
Juergen Gier [Thu, 14 May 2015 11:55:04 +0000 (08:55 -0300)]
[media] saa7134: switch tuner FMD1216ME_MK3 to analog

The tuner FMD1216ME_MK3 suffers the same problem as FMD1216MEX_MK3,
as described in saa7134-cards.c (disabled IF, enabled DVB-T). The
card does work under MS Windows, after soft reboot into Linux it
continues to work, only then tda9887 is loaded as well.
I copied the relevant code from the BEHOLD_H6 section to MD7134.

The CTX946 TV card doesn't detect a signal after cold boot, seems

Signed-off-by: Juergen Gier <juergen.gier@gmx.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l: of: Correct pclk-sample for BT656 bus
Nikhil Devshatwar [Tue, 5 May 2015 13:49:59 +0000 (10:49 -0300)]
[media] v4l: of: Correct pclk-sample for BT656 bus

Current v4l2_of_parse_parallel_bus function attempts to parse the
DT properties for the parallel bus as well as BT656 bus.
If the pclk-sample property is defined for the BT656 bus, it is still
marked as a parallel bus.
Fix this by parsing the pclk after the bus_type is selected.
Only when hsync or vsync properties are specified, the bus_type should
be set to V4L2_MBUS_PARALLEL.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx23885: Hauppauge WinTV-HVR5525 bind I2C SEC
Antti Palosaari [Mon, 20 Apr 2015 20:08:01 +0000 (17:08 -0300)]
[media] cx23885: Hauppauge WinTV-HVR5525 bind I2C SEC

Bind a8293 SEC using I2C binding.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx23885: Hauppauge WinTV-HVR4400/HVR5500 bind I2C demod and SEC
Antti Palosaari [Mon, 20 Apr 2015 18:01:51 +0000 (15:01 -0300)]
[media] cx23885: Hauppauge WinTV-HVR4400/HVR5500 bind I2C demod and SEC

Bind tda10071 demod and a8293 SEC using I2C binding.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx23885: Hauppauge WinTV Starburst bind I2C demod and SEC
Antti Palosaari [Mon, 20 Apr 2015 17:48:33 +0000 (14:48 -0300)]
[media] cx23885: Hauppauge WinTV Starburst bind I2C demod and SEC

Bind tda10071 demod and a8293 SEC using I2C binding.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx23885: add support for DVB I2C SEC client
Antti Palosaari [Thu, 16 Apr 2015 16:59:46 +0000 (13:59 -0300)]
[media] cx23885: add support for DVB I2C SEC client

Add support for I2C SEC (satellite equipment controller) client.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] em28xx: bind PCTV 460e using I2C client
Antti Palosaari [Thu, 16 Apr 2015 16:43:30 +0000 (13:43 -0300)]
[media] em28xx: bind PCTV 460e using I2C client

Load PCTV 460e tda10071 demod and a8293 SEC using I2C client bindings.
Remove old unused tda10071 config struct. We are using I2C platform
data now.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] em28xx: add support for DVB SEC I2C client
Antti Palosaari [Thu, 16 Apr 2015 16:33:07 +0000 (13:33 -0300)]
[media] em28xx: add support for DVB SEC I2C client

Add support for DVB SEC (satellite equipment controller) I2C client.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] a8293: implement I2C client bindings
Antti Palosaari [Thu, 16 Apr 2015 16:28:39 +0000 (13:28 -0300)]
[media] a8293: implement I2C client bindings

Implement I2C client bindings.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] tda10071: implement I2C client bindings
Antti Palosaari [Thu, 16 Apr 2015 14:46:24 +0000 (11:46 -0300)]
[media] tda10071: implement I2C client bindings

Implement I2C client bindings.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vivid: move PRINTSTR to separate functions
Hans Verkuil [Fri, 5 Jun 2015 16:09:31 +0000 (13:09 -0300)]
[media] vivid: move PRINTSTR to separate functions

Commit 84cb7be43cec12868e94163c99fdc34c0297c3b8 broke vivid-tpg
(uninitialized variable p).

This patch takes a different approach: four different functions are
created, one for each PRINTSTR version.

In order to avoid the 'the frame size of 1308 bytes is larger than 1024
bytes' warning I had to mark those functions with 'noinline'. For
whatever reason gcc seems to inline this aggressively and it is doing
weird things with the stack.

I tried to read the assembly code, but I couldn't see what exactly it
was doing on the stack.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vivid.txt: update the vivid documentation
Hans Verkuil [Sun, 31 May 2015 11:10:32 +0000 (08:10 -0300)]
[media] vivid.txt: update the vivid documentation

Document the new Transfer Function control (and fix the documentation for
the other colorspace controls which were not quite correct).

Mention the support for 4:2:0 and more multiplanar formats.

Update the TODO list at the end.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cobalt: simplify colorspace code
Hans Verkuil [Sun, 31 May 2015 10:51:51 +0000 (07:51 -0300)]
[media] cobalt: simplify colorspace code

Simplify cobalt_g/try_fmt_vid_cap by not setting the colorspace fields in
pix again (since v4l2_fill_pix_format does that already), and by using
v4l2_fill_mbus_format in cobalt_s_fmt_vid_out which allows the get_fmt
call to be dropped as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cobalt: support transfer function
Hans Verkuil [Sun, 31 May 2015 09:48:00 +0000 (06:48 -0300)]
[media] cobalt: support transfer function

Add support for the transfer function to the cobalt driver: make sure it is
passed on to/retrieved from the sub-device correctly.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vivid-tpg: precalculate colorspace/xfer_func combinations
Hans Verkuil [Tue, 28 Apr 2015 13:08:43 +0000 (10:08 -0300)]
[media] vivid-tpg: precalculate colorspace/xfer_func combinations

Precalculate all the colorspace/transfer function combinations in order
to easily generate the correct colors.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vivid: add xfer_func support
Hans Verkuil [Tue, 28 Apr 2015 12:41:37 +0000 (09:41 -0300)]
[media] vivid: add xfer_func support

Add support for the transfer function: create a new control for it,
and support it for both capture and output sides.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] am437x-vpfe: add support for xfer_func
Hans Verkuil [Tue, 28 Apr 2015 12:41:03 +0000 (09:41 -0300)]
[media] am437x-vpfe: add support for xfer_func

Make this part of the format check.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Prabhakar Lad <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] adv7511: add xfer_func support
Hans Verkuil [Tue, 28 Apr 2015 12:40:30 +0000 (09:40 -0300)]
[media] adv7511: add xfer_func support

Still preliminary, but the information is at least there.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook/media: document new xfer_func fields
Hans Verkuil [Tue, 28 Apr 2015 11:43:50 +0000 (08:43 -0300)]
[media] DocBook/media: document new xfer_func fields

Document the new field and defines to set the transfer function needed
to correctly decode the colors of an image.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] videodev2.h: add support for transfer functions
Hans Verkuil [Tue, 28 Apr 2015 11:49:09 +0000 (08:49 -0300)]
[media] videodev2.h: add support for transfer functions

In the past the transfer function was implied by the colorspace. However,
it is an independent entity in its own right. Add support for explicitly
choosing the transfer function.

This change will allow us to represent linear RGB (as is used by openGL), and
it will make it easier to work with decoded video material since most codecs
store the transfer function as a separate property as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lirc_imon: simplify error handling code
Mauro Carvalho Chehab [Fri, 5 Jun 2015 14:06:46 +0000 (11:06 -0300)]
[media] lirc_imon: simplify error handling code

Instead of using a state machine and a switch with lots of
fall-trough, use gotos and cleanup the error handling loop.

That removes those two smatch warnings:
drivers/staging/media/lirc/lirc_imon.c:933 imon_probe() warn: possible memory leak of 'context'
drivers/staging/media/lirc/lirc_imon.c:933 imon_probe() warn: possible memory leak of 'driver'

And make the error handling code more standard.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] usbvision: cleanup the code
Mauro Carvalho Chehab [Fri, 5 Jun 2015 13:47:36 +0000 (10:47 -0300)]
[media] usbvision: cleanup the code

There's a dead code on usbvision that makes it harder to read
and produces a smatch warning about bad identation.

Improve the code readability and add a FIXME to warn about
the current hack there.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rc: set IR_MAX_DURATION to 500 ms
Mauro Carvalho Chehab [Fri, 5 Jun 2015 13:30:44 +0000 (10:30 -0300)]
[media] rc: set IR_MAX_DURATION to 500 ms

The current definition is weird, and produce lots of sparse
warnings:

drivers/media/i2c/cx25840/cx25840-ir.c:448 txclk_tx_s_max_pulse_width() warn: impossible condition '(ns > 4294967295) => (0-u32max > u32max)'
drivers/media/i2c/cx25840/cx25840-ir.c:461 rxclk_rx_s_max_pulse_width() warn: impossible condition '(ns > 4294967295) => (0-u32max > u32max)'
drivers/media/i2c/cx25840/cx25840-ir.c:706 cx25840_ir_rx_read() warn: impossible condition '(v > 4294967295) => (0-u32max > u32max)'
drivers/media/pci/ivtv/ivtv-queue.c:145 ivtv_queue_move() error: we previously assumed 'steal' could be null (see line 138)
drivers/media/rc/streamzap.c:155 sz_push_full_pulse() warn: impossible condition '(rawir.duration > 4294967295) => (0-u32max > u32max)'
drivers/media/rc/streamzap.c:169 sz_push_full_pulse() warn: impossible condition '(rawir.duration > 4294967295) => (0-u32max > u32max)'
drivers/media/rc/redrat3.c:325 redrat3_us_to_len() warn: impossible condition '(microsec > 4294967295) => (0-u32max > u32max)'
drivers/media/rc/redrat3.c:383 redrat3_process_ir_data() warn: impossible condition '(rawir.duration > 4294967295) => (0-u32max > u32max)'
drivers/media/usb/pvrusb2/pvrusb2-hdw.c:3676 pvr2_send_request_ex() error: we previously assumed 'write_data' could be null (see line 3648)
drivers/media/usb/pvrusb2/pvrusb2-hdw.c:3829 pvr2_send_request_ex() error: we previously assumed 'read_data' could be null (see line 3649)
drivers/media/pci/cx23885/cx23888-ir.c:463 txclk_tx_s_max_pulse_width() warn: impossible condition '(ns > 4294967295) => (0-u32max > u32max)'
drivers/media/pci/cx23885/cx23888-ir.c:476 rxclk_rx_s_max_pulse_width() warn: impossible condition '(ns > 4294967295) => (0-u32max > u32max)'
drivers/media/pci/cx23885/cx23888-ir.c:696 cx23888_ir_rx_read() warn: impossible condition '(v > 4294967295) => (0-u32max > u32max)'

Use a more realistic value for it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] ir: Fix IR_MAX_DURATION enforcement
Mauro Carvalho Chehab [Fri, 5 Jun 2015 13:25:24 +0000 (10:25 -0300)]
[media] ir: Fix IR_MAX_DURATION enforcement

Don't assume that IR_MAX_DURATION is a bitmask. It isn't.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] tm6000: remove needless check
Mauro Carvalho Chehab [Fri, 5 Jun 2015 12:33:44 +0000 (09:33 -0300)]
[media] tm6000: remove needless check

Smatch reports a warning:
drivers/media/usb/tm6000/tm6000-video.c:646 tm6000_prepare_isoc() error: we previously assumed 'dev->urb_buffer' could be null (see line 624)

This is not really a problem, but it actually shows that the check
if urb_buffer is NULL is being done twice: at the if and at
tm6000_alloc_urb_buffers().

We don't need to do it twice. So, remove the extra check. The code
become cleaner, and, as a collateral effect, smatch becomes happy.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] ivtv: fix two smatch warnings
Mauro Carvalho Chehab [Fri, 5 Jun 2015 12:08:09 +0000 (09:08 -0300)]
[media] ivtv: fix two smatch warnings

Smatch currently produces two warnings:
drivers/media/pci/ivtv/ivtv-fileops.c:901 ivtv_v4l2_close() warn: suspicious bitop condition
drivers/media/pci/ivtv/ivtv-fileops.c:1026 ivtv_open() warn: suspicious bitop condition

Those are false positives, but it is not hard to get rid of them by
using a different way to evaluate the macro, splitting the logical
boolean evaluation from the bitmap one.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] bt8xx: remove needless check
Mauro Carvalho Chehab [Fri, 5 Jun 2015 11:35:09 +0000 (08:35 -0300)]
[media] bt8xx: remove needless check

As reported by smatch:
drivers/media/pci/bt8xx/dst_ca.c:323 ca_get_message() warn: this array is probably non-NULL. 'p_ca_message->msg'
drivers/media/pci/bt8xx/dst_ca.c:498 ca_send_message() warn: this array is probably non-NULL. 'p_ca_message->msg'

Those two checks are needless/useless, as the ca_msg struct is
declared as:
typedef struct ca_msg {
        unsigned int index;
        unsigned int type;
        unsigned int length;
        unsigned char msg[256];
} ca_msg_t;

So, if the p_ca_message pointer is not null, msg will also be
not null.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] dib0090: Remove a dead code
Mauro Carvalho Chehab [Fri, 5 Jun 2015 11:27:18 +0000 (08:27 -0300)]
[media] dib0090: Remove a dead code

As reported by smatch:
drivers/media/dvb-frontends/dib0090.c:1710 dib0090_dc_offset_calibration() warn: missing break? reassigning '*tune_state'

There's no need to change tune_state there, as the fall though code
will change it again to another state. So, simplify it by
removing the dead code.

While here, fix a typo:
Sart => Start

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] sh_vou: avoid going past arrays
Mauro Carvalho Chehab [Fri, 5 Jun 2015 11:07:19 +0000 (08:07 -0300)]
[media] sh_vou: avoid going past arrays

Smatch reports two issues:
drivers/media/platform/sh_vou.c:670 vou_adjust_output() error: buffer overflow 'vou_scale_v_num' 3 <= 4
drivers/media/platform/sh_vou.c:670 vou_adjust_output() error: buffer overflow 'vou_scale_v_den' 3 <= 4

It seems that there's actually a bug here: the same var (idx) is used
as an index for vertical and horizontal scaling arrays. However,
there are 4 elements on the h arrays, and only 3 at the v ones.

On the first loop, it may select index 4 for the horizontal array.

In this case, if the second loop fails to select an index, the
code would keep using 4 for the vertical array, with is past of
the array sizes.

The intent here seems to use index 0, if the scale is not found.

So, use a separate var for the vertical index.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] em28xx: remove dead code
Mauro Carvalho Chehab [Fri, 5 Jun 2015 11:03:01 +0000 (08:03 -0300)]
[media] em28xx: remove dead code

As reported by smatch:
drivers/media/usb/em28xx/em28xx-video.c:842 get_ressource() info: ignoring unreachable code.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] drxk: better handle errors
Mauro Carvalho Chehab [Fri, 5 Jun 2015 10:58:52 +0000 (07:58 -0300)]
[media] drxk: better handle errors

As reported by smatch:
drivers/media/dvb-frontends/drxk_hard.c:3277 dvbt_sc_command() warn: missing break? reassigning 'status'

This is basically because the error handling logic there was crappy.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vivid: don't use more than 1024 bytes of stack
Mauro Carvalho Chehab [Fri, 5 Jun 2015 10:24:22 +0000 (07:24 -0300)]
[media] vivid: don't use more than 1024 bytes of stack

Remove the following compilation warnings:

drivers/media/platform/vivid/vivid-tpg.c: In function 'tpg_gen_text':
drivers/media/platform/vivid/vivid-tpg.c:1562:1: warning: the frame size of 1308 bytes is larger than 1024 bytes [-Wframe-larger-than=]
 }
 ^

This seems to be due to some bad optimization done by gcc.

Moving the for() loop to happen inside the macro solves the
issue.

While here, fix CodingStyle at the switch().

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
9 years ago[media] media: s5p-mfc: fix sparse warnings
Marek Szyprowski [Thu, 28 May 2015 11:11:47 +0000 (08:11 -0300)]
[media] media: s5p-mfc: fix sparse warnings

Commits a0f10c131cc49d7d84394beb7903e1f246331224 and
6c9fe765360efa97c63b89af685b620baf5e0012 ("media: s5p-mfc: fix broken
pointer cast on 64bit arch") fixed issue with lossy cast on 64-bit
architectures. However it also removed __iomem attribute from that cast.
This leads to sparse warnings. This patch fixes those warnings by adding
__iomem cast in case of v6+ code version and replacing readl/writel by
simple u32 load/store operations in case of v5 code (which is called on
system memory allocated by dma_alloc_coherent() instead of io registers).

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: davinci: vpbe: use v4l2_get_timestamp()
Lad, Prabhakar [Tue, 26 May 2015 14:20:27 +0000 (11:20 -0300)]
[media] media: davinci: vpbe: use v4l2_get_timestamp()

this patch makes use of helper function v4l2_get_timestamp()
to set the timestamp of vb2 buffer.

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>
9 years ago[media] media: davinci_vpfe: use monotonic timestamp
Lad, Prabhakar [Mon, 25 May 2015 15:34:29 +0000 (12:34 -0300)]
[media] media: davinci_vpfe: use monotonic timestamp

V4L2 drivers should use MONOTONIC timestamps instead of gettimeofday,
which is affected by daylight savings time.

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>
9 years ago[media] media: davinci_vpfe: set minimum required buffers to three
Lad, Prabhakar [Mon, 25 May 2015 15:34:28 +0000 (12:34 -0300)]
[media] media: davinci_vpfe: set minimum required buffers to three

this patch sets nbuffers to three or more and drops the
unset member video_limit which just a copy paste from
earlier driver.

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>
9 years ago[media] media: davinci_vpfe: clear the output_specs
Lad, Prabhakar [Mon, 25 May 2015 15:34:27 +0000 (12:34 -0300)]
[media] media: davinci_vpfe: clear the output_specs

clear of the output_specs before passing it to the
configure_resizer_out_params(), so that no garbage values
are set.

This fixes following build warning:
drivers/staging/media/davinci_vpfe/dm365_resizer.c: In function 'resizer_set_stream':
drivers/staging/media/davinci_vpfe/dm365_resizer.c:190:46: warning: 'output_specs.vst_c'
may be used uninitialized in this function [-Wmaybe-uninitialized]
  param->ext_mem_param[index].rsz_sdr_ptr_s_c = output->vst_c;
                                              ^
drivers/staging/media/davinci_vpfe/dm365_resizer.c:316:30: note: 'output_specs.vst_c' was declared here
  struct vpfe_rsz_output_spec output_specs;
                              ^

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>
9 years ago[media] si2157: implement signal strength stats
Antti Palosaari [Sun, 7 Sep 2014 14:20:34 +0000 (11:20 -0300)]
[media] si2157: implement signal strength stats

Implement DVBv5 signal strength stats. Returns dBm.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Tested-by: Adam Baker <linux@baker-net.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] si2168: Implement own I2C adapter locking
Antti Palosaari [Fri, 29 May 2015 19:42:33 +0000 (16:42 -0300)]
[media] si2168: Implement own I2C adapter locking

We need own I2C locking because of tuner I2C adapter/repeater.
Firmware command is executed using I2C send + reply message. Default
I2C adapter locking protects only single I2C operation, not whole
send + reply sequence as needed. Due to that, it was possible tuner
I2C message interrupts firmware command sequence.

Reported-by: Adam Baker <linux@baker-net.org.uk>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Adam Baker <linux@baker-net.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: fix FE_SET_PROPERTY ioctl arguments
Mauro Carvalho Chehab [Mon, 1 Jun 2015 09:10:15 +0000 (06:10 -0300)]
[media] DocBook: fix FE_SET_PROPERTY ioctl arguments

FE_SET_PROPERTY/FE_GET_PROPERTY actually expects a struct dtv_properties
argument.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook: some fixes for DVB FE open()
Mauro Carvalho Chehab [Mon, 1 Jun 2015 08:54:20 +0000 (05:54 -0300)]
[media] DocBook: some fixes for DVB FE open()

The changeset dc9ef7d11207 change the open() ioctl documentation to
match the V4L2 open(). However, some cut-and-pasted stuff doesn't
match what actually happens at the DVB core.

So, fix the documentation entry to be more accurate with the DVB
frontend open() specifics.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook media: rewrite frontend open/close
Hans Verkuil [Sun, 31 May 2015 12:59:12 +0000 (09:59 -0300)]
[media] DocBook media: rewrite frontend open/close

To fix the last xmllint errors the open and close function reference
description was rewritten based on the v4l2 open and close functions.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook media: xmllint fixes
Hans Verkuil [Sun, 31 May 2015 12:59:11 +0000 (09:59 -0300)]
[media] DocBook media: xmllint fixes

Fixes a large number of xmllint errors.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook media: fix typos
Hans Verkuil [Sun, 31 May 2015 12:59:10 +0000 (09:59 -0300)]
[media] DocBook media: fix typos

satellital -> satellite
antena -> antenna

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvcvideo: Remove unneeded device disconnected flag
Laurent Pinchart [Sun, 24 May 2015 22:45:38 +0000 (19:45 -0300)]
[media] uvcvideo: Remove unneeded device disconnected flag

The UVC_DEV_DISCONNECTED flag is set when the USB device is
disconnected, and checked in the open() handler to refuse opening a
device that has been disconnected.

This is inherently racy, but the race condition is taken care of in the
V4L2 core, which also fails open() calls when the V4L2 device node has
been unregistered. As the uvcvideo USB disconnect handler unregisters
all its video device nodes, the UVC_DEV_DISCONNECTED flag doesn't serve
any purpose anymore and can be removed.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvcvideo: Fix incorrect bandwidth with Chicony device 04f2:b50b
Laurent Pinchart [Tue, 12 May 2015 21:57:53 +0000 (18:57 -0300)]
[media] uvcvideo: Fix incorrect bandwidth with Chicony device 04f2:b50b

The "TOSHIBA Web Camera - 5M" Chicony device (04f2:b50b) seems to
compute the bandwidth on 16 bits and erroneously sign-extend it to
32 bits, resulting in a huge bandwidth value. Detect and fix that
condition by setting the 16 MSBs to 0 when they're all equal to 1.

Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvcvideo: Implement DMABUF exporter role
Laurent Pinchart [Tue, 14 Apr 2015 07:19:51 +0000 (04:19 -0300)]
[media] uvcvideo: Implement DMABUF exporter role

Now that videobuf2-vmalloc supports exporting buffers, add support for
the DMABUF exporter role by plugging in the videobuf2 ioctl helper.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] af9035: add USB ID 07ca:0337 AVerMedia HD Volar (A867)
Antti Palosaari [Thu, 21 May 2015 19:47:15 +0000 (16:47 -0300)]
[media] af9035: add USB ID 07ca:0337 AVerMedia HD Volar (A867)

It is AF9035 + MxL5007T.
Driver reports:
prechip_version=00 chip_version=03 chip_type=3802

Not sure if that USB ID is reserved only for HP brand or if it is
common, but the stick I have is branded as HP part no. 580715-001
rmn A867.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] m88ds3103: add I2C client binding
Antti Palosaari [Thu, 16 Apr 2015 23:04:55 +0000 (20:04 -0300)]
[media] m88ds3103: add I2C client binding

Implement I2C client device binding.
Wrap media attach to driver I2C probe.
Add wrapper from m88ds3103_attach() to m88ds3103_probe() via driver
core in order to provide proper I2C client for legacy media attach
binding.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] m88ds3103: use jiffies when polling DiSEqC TX ready
Antti Palosaari [Tue, 14 Apr 2015 15:56:24 +0000 (12:56 -0300)]
[media] m88ds3103: use jiffies when polling DiSEqC TX ready

Use jiffies to set timeout for DiSEqC TX ready polling. Using jiffies
is more elegant solution than looping N times with sleep.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] m88ds3103: implement DVBv5 BER
Antti Palosaari [Tue, 14 Apr 2015 12:44:20 +0000 (09:44 -0300)]
[media] m88ds3103: implement DVBv5 BER

Implement DVBv5 BER statistics.
Wrap legacy DVBv3 BER to DVBv5 BER.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] m88ds3103: implement DVBv5 CNR statistics
Antti Palosaari [Mon, 13 Apr 2015 23:56:13 +0000 (20:56 -0300)]
[media] m88ds3103: implement DVBv5 CNR statistics

Implement DVBv5 CNR statistics.
Wrap legacy DVBv3 SNR to DVBv5 CNR.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>