firefly-linux-kernel-4.4.55.git
10 years ago[media] v4l2-ctrls: add support for setting string controls
Hans Verkuil [Mon, 21 Jul 2014 13:45:42 +0000 (10:45 -0300)]
[media] v4l2-ctrls: add support for setting string controls

Rather than always having to use a v4l2_ext_control struct to set
a control value from within a driver, switch to just setting the
new value. This is faster and it makes it possible to set more
complex types such as a string control as is added by this
patch.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] Docbook/media: improve data_offset/bytesused documentation
Hans Verkuil [Mon, 21 Jul 2014 13:16:47 +0000 (10:16 -0300)]
[media] Docbook/media: improve data_offset/bytesused documentation

This patch explicitly documents the relationship between bytesused and data_offset.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] rc-core: merge rc5 and streamzap decoders
David Härdeman [Thu, 3 Apr 2014 23:32:31 +0000 (20:32 -0300)]
[media] rc-core: merge rc5 and streamzap decoders

Now that the protocol is part of the scancode, it is pretty easy to merge
the rc5 and streamzap decoders. An additional advantage is that the decoder
is now stricter as it waits for the trailing silence before determining that
a command is a valid rc5/streamzap command (which avoids collisions that I've
seen with e.g. Sony protocols).

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] rc-core: rename dev->scanmask to dev->scancode_mask
David Härdeman [Thu, 3 Apr 2014 23:32:26 +0000 (20:32 -0300)]
[media] rc-core: rename dev->scanmask to dev->scancode_mask

We already have dev->scancode_filter and dev->scancode_wakeup_filter
so rename dev->scanmask to dev->scancode_mask for consistency.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] rc-core: remove protocol arrays
David Härdeman [Thu, 3 Apr 2014 23:32:21 +0000 (20:32 -0300)]
[media] rc-core: remove protocol arrays

The basic API of rc-core used to be:

dev = rc_allocate_device();
dev->x = a;
dev->y = b;
dev->z = c;
rc_register_device();

which is a pretty common pattern in the kernel, after the introduction of
protocol arrays the API looks something like:

dev = rc_allocate_device();
dev->x = a;
rc_set_allowed_protocols(dev, RC_BIT_X);
dev->z = c;
rc_register_device();

There's no real need for the protocols to be an array, so change it
back to be consistent (and in preparation for the following patches).

[m.chehab@samsung.com: added missing changes at some files]
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] rc-core: simplify sysfs code
David Härdeman [Thu, 3 Apr 2014 23:32:16 +0000 (20:32 -0300)]
[media] rc-core: simplify sysfs code

Simplify and cleanup the sysfs code a bit.

[m.chehab@samsung.com: rebased and fixed a CodingStyle issue]
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] saa7134: NEC scancode fix
David Härdeman [Thu, 3 Apr 2014 23:32:01 +0000 (20:32 -0300)]
[media] saa7134: NEC scancode fix

This driver codes the two address bytes in reverse order when compared to the
other drivers, so make it consistent (and update the keymap, note that the
result is a prefix change from 0x6b86 -> 0x866b, and the latter is pretty
common among the NECX keymaps. While not conclusive, it's still a strong hint
that the change is correct).

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] rc-core: document the protocol type
David Härdeman [Thu, 3 Apr 2014 23:31:30 +0000 (20:31 -0300)]
[media] rc-core: document the protocol type

Right now the protocol information is not preserved, rc-core gets handed a
scancode but has no idea which protocol it corresponds to.

This patch (which required reading through the source/keymap for all drivers,
not fun) makes the protocol information explicit which is important
documentation and makes it easier to e.g. support multiple protocols with one
decoder (think rc5 and rc-streamzap). The information isn't used yet so there
should be no functional changes.

[m.chehab@samsung.com: rebased, added cxusb and removed bad whitespacing]
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] dib0700: NEC scancode cleanup
David Härdeman [Thu, 3 Apr 2014 23:31:51 +0000 (20:31 -0300)]
[media] dib0700: NEC scancode cleanup

the RC RX packet is defined as:

        struct dib0700_rc_response {
...
                                u8 not_system;
                                u8 system;
...
                u8 data;
                u8 not_data;

The NEC protocol transmits in the order:
        system
        not_system
        data
        not_data

Note that the code defines the NEC extended scancode as:

        scancode = be16_to_cpu(poll_reply->system16) << 8 | poll_reply->data;

i.e.

        scancode = poll_reply->not_system << 16 |
                   poll_reply->system     << 8  |
                   poll_reply->data;

Which, if the order *is* reversed, would mean that the scancode that
gets defined is in reality:

        scancode = poll_reply->system     << 16 |
                   poll_reply->not_system << 8  |
                   poll_reply->data;

Which is the same as the order used in drivers/media/rc/ir-nec-decoder.c.

This patch changes the code to match my assumption (the generated scancode
should, however, not change).

[m.chehab@samsung.com: rebased and fixed the decoding error message]
Signed-off-by: David Härdeman <david@hardeman.nu>
CC: Patrick Boettcher <pboettcher@kernellabs.com>
Tested-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] rc-core: improve ir-kbd-i2c get_key functions
David Härdeman [Thu, 3 Apr 2014 23:31:25 +0000 (20:31 -0300)]
[media] rc-core: improve ir-kbd-i2c get_key functions

The arguments used for ir-kbd-i2c's get_key() functions are not
really suited for rc-core and the ir_raw/ir_key distinction is
just confusing.

Convert all of them to return a protocol/scancode/toggle triple instead.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] bt8xx: fixup RC5 decoding
David Härdeman [Thu, 3 Apr 2014 23:31:20 +0000 (20:31 -0300)]
[media] bt8xx: fixup RC5 decoding

The bt8xx driver does RC5 decoding for Nebula digi hardware, but includes
some pointless limitations (both start bits must be one, the
device/address/system must be 0x00). Remove those limitations and update
the keymap to use the full RC5 scancode (fortunately the 0x00 address
means that this is perfectly backwards compatible).

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] staging: lirc: remove redundant NULL check in unregister_from_lirc()
Daeseok Youn [Wed, 2 Apr 2014 09:49:03 +0000 (06:49 -0300)]
[media] staging: lirc: remove redundant NULL check in unregister_from_lirc()

"ir" is already checked before calling unregister_from_lirc().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] cxusb: increase buffer length to 80 bytes
Mauro Carvalho Chehab [Mon, 30 Jun 2014 14:56:33 +0000 (11:56 -0300)]
[media] cxusb: increase buffer length to 80 bytes

As reported by Vincent:
[   16.332247] xc2028 0-0061: Loading firmware for type=BASE F8MHZ (3), id 0000000000000000.
[   16.344378] cxusb: i2c wr: len=64 is too big!

64 bytes is too short for firmware load on this device. So, increase it
to 80 bytes.

Reported-by: Vincent McIntyre <vincent.mcintyre@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] DocBook: Fix ISDB-T Interleaving property
Mauro Carvalho Chehab [Sat, 12 Jul 2014 00:37:46 +0000 (21:37 -0300)]
[media] DocBook: Fix ISDB-T Interleaving property

The DocBook documentation is incorrect: on ISDB-T, interleaving
time is always a power of 2. Fix it and provides a table showing
the actual interleaving length for each mode.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] xc4000: Fix get_frequency()
Mauro Carvalho Chehab [Mon, 21 Jul 2014 16:28:15 +0000 (13:28 -0300)]
[media] xc4000: Fix get_frequency()

The programmed frequency on xc4000 is not the middle
frequency, but the initial frequency on the bandwidth range.
However, the DVB API works with the middle frequency.

This works fine on set_frontend, as the device calculates
the needed offset. However, at get_frequency(), the returned
value is the initial frequency. That's generally not a big
problem on most drivers, however, starting with changeset
6fe1099c7aec, the frequency drift is taken into account at
dib7000p driver.

This broke support for PCTV 340e, with uses dib7000p demod and
xc4000 tuner.

Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] xc5000: Fix get_frequency()
Mauro Carvalho Chehab [Mon, 21 Jul 2014 17:21:18 +0000 (14:21 -0300)]
[media] xc5000: Fix get_frequency()

The programmed frequency on xc5000 is not the middle
frequency, but the initial frequency on the bandwidth range.
However, the DVB API works with the middle frequency.

Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] xc4000: add module meta-tag with the firmware names
Mauro Carvalho Chehab [Mon, 21 Jul 2014 16:28:14 +0000 (13:28 -0300)]
[media] xc4000: add module meta-tag with the firmware names

This meta-tag is used by some distros to help them package
the firmware and generate proper initrd images.

So, add the firmware names there.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] xc4000: Update firmware name
Mauro Carvalho Chehab [Mon, 21 Jul 2014 16:28:13 +0000 (13:28 -0300)]
[media] xc4000: Update firmware name

The firmware name at:
   http://www.kernellabs.com/firmware/xc4000/

Is different from the one at the Kernel. Update it
try first the new name, falling back to the previous one
if the new name can't be found.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] dib7000m: Remove unnecessary null test
Himangi Saraogi [Tue, 15 Jul 2014 21:31:17 +0000 (18:31 -0300)]
[media] dib7000m: Remove unnecessary null test

This patch removes the null test on ch. ch is initialized at the
beginning of the function to &demod->dtv_property_cache. Since demod
is dereferenced prior to the null test, demod must be a valid pointer,
and &demod->dtv_property_cache cannot be null.

The following Coccinelle script is used for detecting the change:

@r@
expression e,f;
identifier g,y;
statement S1,S2;
@@

*e = &f->g
<+...
 f->y
 ...+>
*if (e != NULL || ...)
 S1 else S2

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] mb86a20s: Fix the code that estimates the measurement interval
Mauro Carvalho Chehab [Sat, 12 Jul 2014 00:37:48 +0000 (21:37 -0300)]
[media] mb86a20s: Fix the code that estimates the measurement interval

Instead of looking at the guard interval field, it was using
the interval length, with is wrong. Fix it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] mb86a20s: Fix Interleaving
Mauro Carvalho Chehab [Sat, 12 Jul 2014 00:37:47 +0000 (21:37 -0300)]
[media] mb86a20s: Fix Interleaving

Interleaving code was wrong at mb86a20s: instead, it was looking
at the Guard Interval. Fix it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] mb86a20s: fix ISDB-T mode handling
Mauro Carvalho Chehab [Mon, 21 Jul 2014 17:55:05 +0000 (14:55 -0300)]
[media] mb86a20s: fix ISDB-T mode handling

The driver was reporting an incorrect mode, when mode 2
is selected.

While testing it, noticed that neither mode 1 or guard
interval 1/32 is supported by this device. Document it,
and ensure that it will report _AUTO when it doesn't lock,
in order to not report a wrong detection to userspace.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] m88ds3103: implement BER
Antti Palosaari [Thu, 10 Jul 2014 11:17:59 +0000 (08:17 -0300)]
[media] m88ds3103: implement BER

Implement read_ber for BER estimate.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] m88ds3103: fix SNR reporting on 32-bit arch
Antti Palosaari [Thu, 10 Jul 2014 11:17:58 +0000 (08:17 -0300)]
[media] m88ds3103: fix SNR reporting on 32-bit arch

There was 32-bit calculation overflow. Use div_u64.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] xc4000: remove unnecessary break after goto
Fabian Frederick [Tue, 8 Jul 2014 18:16:51 +0000 (15:16 -0300)]
[media] xc4000: remove unnecessary break after goto

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] xc5000: remove unnecessary break after goto
Fabian Frederick [Tue, 8 Jul 2014 18:17:41 +0000 (15:17 -0300)]
[media] xc5000: remove unnecessary break after goto

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] dvb-frontends: remove unnecessary break after goto
Fabian Frederick [Tue, 8 Jul 2014 17:23:01 +0000 (14:23 -0300)]
[media] dvb-frontends: remove unnecessary break after goto

Cc: Antti Palosaari <crope@iki.fi>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] xc2028: remove unnecessary break after goto
Fabian Frederick [Tue, 8 Jul 2014 17:25:17 +0000 (14:25 -0300)]
[media] xc2028: remove unnecessary break after goto

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] r820t: remove unnecessary break after goto
Fabian Frederick [Tue, 8 Jul 2014 17:20:37 +0000 (14:20 -0300)]
[media] r820t: remove unnecessary break after goto

Cc: Antti Palosaari <crope@iki.fi>
Cc: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] Cleanup line > 80 character violations
Emil Goode [Tue, 24 Jun 2014 21:42:28 +0000 (18:42 -0300)]
[media] Cleanup line > 80 character violations

This cleans up some line over 80 character violations.

Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] Remove checks of struct member addresses
Emil Goode [Tue, 24 Jun 2014 21:42:27 +0000 (18:42 -0300)]
[media] Remove checks of struct member addresses

This removes checks of struct member addresses since they likely result
in the condition always being true. Also in the stb6100_get_bandwidth
and tda8261_get_bandwidth functions the pointers frontend_ops and
tuner_ops are assigned the same addresses twice.

Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: dib9000: avoid out of bound access
Heinrich Schuchardt [Thu, 19 Jun 2014 14:49:40 +0000 (11:49 -0300)]
[media] media: dib9000: avoid out of bound access

This updated patch also fixes out of bound access to b[].

In dib9000_risc_apb_access_write() an out of bound access to mb[].

The current test to avoid out of bound access to mb[] is insufficient.
For len = 19 non-existent mb[10] will be accessed.

For odd values of len b[] is accessed out of bounds.

For large values of len an of bound access to mb[] may occur in
dib9000_mbx_send_attr.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] dvb-frontends: decimal vs hex typo in ChannelConfiguration()
Dan Carpenter [Thu, 6 Feb 2014 07:49:47 +0000 (04:49 -0300)]
[media] dvb-frontends: decimal vs hex typo in ChannelConfiguration()

>From the context this should be hex 0x80 instead of decimal 80.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] si2168: Fix a badly solved merge conflict
Mauro Carvalho Chehab [Tue, 22 Jul 2014 19:25:33 +0000 (16:25 -0300)]
[media] si2168: Fix a badly solved merge conflict

changeset a733291d6934 didn't merge the fixes well. It ended by
restoring some bad logic removed there.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] tuners/Kconfig: fix build when just DTV or SDR is enabled
Mauro Carvalho Chehab [Tue, 22 Jul 2014 17:22:01 +0000 (14:22 -0300)]
[media] tuners/Kconfig: fix build when just DTV or SDR is enabled

As reported by Kbuildtest:
warning: (VIDEO_PVRUSB2 && VIDEO_TLG2300 && VIDEO_USBVISION && VIDEO_GO7007 && VIDEO_AU0828_V4L2 && VIDEO_CX231XX && VIDEO_TM6000 && VIDEO_EM28XX && VIDEO_IVTV && VIDEO_MXB && VIDEO_CX18 && VIDEO_CX23885 && VIDEO_CX88 && VIDEO_BT848 && VIDEO_SAA7134 && VIDEO_SAA7164) selects VIDEO_TUNER which has unmet direct dependencies (MEDIA_SUPPORT && MEDIA_TUNER)

That happens when:

# CONFIG_MEDIA_ANALOG_TV_SUPPORT is not set
CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
# CONFIG_MEDIA_RADIO_SUPPORT is not set
# CONFIG_MEDIA_SDR_SUPPORT is not set
CONFIG_VIDEO_AU0828_V4L2=y
CONFIG_VIDEO_CX231XX=y
CONFIG_VIDEO_TM6000=y
CONFIG_VIDEO_EM28XX=y
CONFIG_VIDEO_TUNER=y
CONFIG_MEDIA_SUPPORT=y

With means that we need to enable MEDIA_TUNER also when DTV
is enabled. While the above config doesn't cover, if we enable
SDR, the same error can also happen.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] go7007: move out of staging into drivers/media/usb.
Hans Verkuil [Tue, 22 Jul 2014 04:21:37 +0000 (06:21 +0200)]
[media] go7007: move out of staging into drivers/media/usb.

Now that the custom motion detection API in this driver has been
replaced with a standard API there is no reason anymore to keep it
in staging. So (finally!) move it to drivers/media/usb.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] solo6x10: move out of staging into drivers/media/pci.
Hans Verkuil [Tue, 22 Jul 2014 04:13:07 +0000 (06:13 +0200)]
[media] solo6x10: move out of staging into drivers/media/pci.

Now that the custom motion detection API has been replaced with a
standard API there is no reason anymore to keep it in staging.

So (finally!) move it to drivers/media/pci.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: store IRAM size in struct coda_devtype
Philipp Zabel [Fri, 11 Jul 2014 09:36:43 +0000 (06:36 -0300)]
[media] coda: store IRAM size in struct coda_devtype

Similarly to workbuf_size and tempbuf_size, store iram_size in the
coda_devtype structure. This also decreases the IRAM used on i.MX6DL
to 128 KiB.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: store global temporary buffer size in struct coda_devtype
Philipp Zabel [Fri, 11 Jul 2014 09:36:42 +0000 (06:36 -0300)]
[media] coda: store global temporary buffer size in struct coda_devtype

Similarly to the work buffer size, store the temporary buffer size in the
coda_devtype structure.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: store per-context work buffer size in struct coda_devtype
Philipp Zabel [Fri, 11 Jul 2014 09:36:41 +0000 (06:36 -0300)]
[media] coda: store per-context work buffer size in struct coda_devtype

We had the workbuf_size field since the beginning.
Use it to tighten the code a little bit.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: export auxiliary buffers via debugfs
Philipp Zabel [Fri, 11 Jul 2014 09:36:40 +0000 (06:36 -0300)]
[media] coda: export auxiliary buffers via debugfs

This patch exports all auxiliary buffers, including SRAM, as debugfs binary
blobs for debugging purposes. It shows, for example, that psbuf currently
doesn't seem to be used at all on CODA7541, and that slicebuf and workbuf
usage is far from the maximum. It can also be used to validate SRAM size
allocation.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: increase frame stride to 16 for h.264
Philipp Zabel [Fri, 11 Jul 2014 09:36:39 +0000 (06:36 -0300)]
[media] coda: increase frame stride to 16 for h.264

When encoding into h.264, the input frame stride needs to be a multiple of 16.
During allocation of the input buffers, it may not be known yet whether the
encoder should create h.264 or not. Assume the worst and always use a frame
stride that is a multiple of 16.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: round up internal frames to multiples of macroblock size for h.264
Philipp Zabel [Fri, 11 Jul 2014 09:36:38 +0000 (06:36 -0300)]
[media] coda: round up internal frames to multiples of macroblock size for h.264

CODA7541 only supports encoding h.264 frames with width and height that are
multiples of the macroblock size.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: allow odd width, but still round up bytesperline
Philipp Zabel [Fri, 11 Jul 2014 09:36:37 +0000 (06:36 -0300)]
[media] coda: allow odd width, but still round up bytesperline

Even though the CODA h.264 decoder always decodes complete macroblocks, we can
set the stride to the corresponding multiple of 16 and use a value smaller than
that as real width. Unfortunately the same doesn't work for height, as there
is no vertical linesperframe stride for discontiguous planar YUV frames.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: add bytesperline to queue data
Philipp Zabel [Fri, 11 Jul 2014 09:36:36 +0000 (06:36 -0300)]
[media] coda: add bytesperline to queue data

bytesperline is calculated in multiple places, store it in the coda_q_data
structure. This will be more useful later when adding JPEG support.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: add reset control support
Philipp Zabel [Fri, 11 Jul 2014 09:36:35 +0000 (06:36 -0300)]
[media] coda: add reset control support

On i.MX53 and i.MX6, the CODA VPU can be reset by the System Reset Controller.
We can use this to get out of dire situations, for example after a picture
run timeout.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: rename prescan_failed to hold and stop stream after timeout
Philipp Zabel [Fri, 11 Jul 2014 09:36:34 +0000 (06:36 -0300)]
[media] coda: rename prescan_failed to hold and stop stream after timeout

Rename the per-context prescan_failed variable to hold, as this is what the
flag  does: it temporarily keeps the coda from running until new data is fed
into the bitstream buffer or stop_streaming is called on the input side.
A prescan failure on i.MX5 is one possible reason to enter this state, another
one is a picture run timeout on i.MX6.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: add sequence counter offset
Philipp Zabel [Fri, 11 Jul 2014 09:36:33 +0000 (06:36 -0300)]
[media] coda: add sequence counter offset

The coda h.264 decoder also counts PIC_RUNs where no frame was decoded but
a frame was rotated out / marked as ready to be displayed. This causes an
offset between the incoming encoded frame's sequence number and the decode
sequence number returned by the coda. This patch introduces a sequence
counter offset variable to keep track of the difference.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: alert userspace about macroblock errors
Philipp Zabel [Fri, 11 Jul 2014 09:36:32 +0000 (06:36 -0300)]
[media] coda: alert userspace about macroblock errors

If the CODA reports macroblock errors, also set the VB2_BUF_STATE_ERROR flag
to alert userspace.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: add decoder timestamp queue
Philipp Zabel [Fri, 11 Jul 2014 09:36:31 +0000 (06:36 -0300)]
[media] coda: add decoder timestamp queue

The coda driver advertises timestamp_type V4L2_BUF_FLAG_TIMESTAMP_COPY on
both queues, so we have to copy timestamps from input v4l2 buffers to the
corresponding destination v4l2 buffers. Since the h.264 decoder can reorder
frames, a timestamp queue is needed to keep track of and assign the correct
timestamp to destination buffers.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: try to schedule a decode run after a stop command
Michael Olbrich [Fri, 11 Jul 2014 09:36:30 +0000 (06:36 -0300)]
[media] coda: try to schedule a decode run after a stop command

In case no further buffers are queued after the stop command, restart
job scheduling explicitly.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-mem2mem: export v4l2_m2m_try_schedule
Michael Olbrich [Tue, 22 Jul 2014 12:36:04 +0000 (09:36 -0300)]
[media] v4l2-mem2mem: export v4l2_m2m_try_schedule

Some drivers might allow to decode remaining frames from an internal ringbuffer
after a decoder stop command. Allow those to call v4l2_m2m_try_schedule
directly.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: add cyclic intra refresh control
Philipp Zabel [Fri, 11 Jul 2014 09:36:28 +0000 (06:36 -0300)]
[media] coda: add cyclic intra refresh control

Allow userspace to enable cyclic intra refresh by setting the number of
intra macroblocks per frame to a non-zero value.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: add h.264 deblocking filter controls
Philipp Zabel [Fri, 11 Jul 2014 09:36:27 +0000 (06:36 -0300)]
[media] coda: add h.264 deblocking filter controls

This adds controls for the h.264 deblocking loop filter.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: add h.264 min/max qp controls
Philipp Zabel [Fri, 11 Jul 2014 09:36:26 +0000 (06:36 -0300)]
[media] coda: add h.264 min/max qp controls

If the bitrate control is set, the encoder works in CBR mode, dynamically
changing the quantization parameters to achieve a constant bitrate.
With the min/max QP controls the quantization parameters can be limited
to a given range.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: select GENERIC_ALLOCATOR
Philipp Zabel [Fri, 11 Jul 2014 09:36:25 +0000 (06:36 -0300)]
[media] coda: select GENERIC_ALLOCATOR

The driver uses the genalloc API, which doesn't have stubs in
case GENERIC_ALLOCATOR is disabled.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: split firmware version check out of coda_hw_init
Philipp Zabel [Fri, 11 Jul 2014 09:36:24 +0000 (06:36 -0300)]
[media] coda: split firmware version check out of coda_hw_init

This adds a new function coda_check_firmware that does the firmware
version checks so that this can be done only once from coda_probe
instead of every time the runtime pm framework resumes the coda.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: Add runtime pm support
Philipp Zabel [Fri, 11 Jul 2014 09:36:23 +0000 (06:36 -0300)]
[media] coda: Add runtime pm support

This patch allows to use the runtime pm and generic pm domain frameworks
to completely gate power to the VPU if it is unused. This functionality
is available on i.MX6.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: use ctx->fh.m2m_ctx instead of ctx->m2m_ctx
Philipp Zabel [Fri, 11 Jul 2014 09:36:22 +0000 (06:36 -0300)]
[media] coda: use ctx->fh.m2m_ctx instead of ctx->m2m_ctx

v4l2_fh already contains a mem2mem context pointer. Use it.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: Use mem-to-mem ioctl helpers
Philipp Zabel [Fri, 11 Jul 2014 09:36:21 +0000 (06:36 -0300)]
[media] coda: Use mem-to-mem ioctl helpers

Use the mem2mem helpers introduced to get rid of some duplicated code.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: add workqueue to serialize hardware commands
Philipp Zabel [Fri, 11 Jul 2014 09:36:20 +0000 (06:36 -0300)]
[media] coda: add workqueue to serialize hardware commands

Using the coda_mutex lock to serialize hardware access would cause
"INFO: possible circular locking dependency detected" lockdep warnings.
Since the possible locking paths are hard to follow, serialize hardware
access with a single workqueue thread. Ultimately the workqueue could
be converted to only do register setup and readout for per-command work
items.
Using the initialized context property, SEQ_END is only queued in
coda_release when needed.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: add selection API support for h.264 decoder
Philipp Zabel [Fri, 11 Jul 2014 09:36:19 +0000 (06:36 -0300)]
[media] coda: add selection API support for h.264 decoder

The h.264 decoder produces capture frames that are a multiple of the macroblock
size (16 pixels). To inform userspace about invalid pixel data at the edges,
use the active and padded composing rectangles on the capture queue.
The cropping information is obtained from the h.264 sequence parameter set.

Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: remove BUG() in get_q_data
Philipp Zabel [Fri, 11 Jul 2014 09:36:18 +0000 (06:36 -0300)]
[media] coda: remove BUG() in get_q_data

This allows us to get rid of the now superfluous v4l2_m2m_get_vq check
in G_FMT. Also, we can use this to check the buffer type in G_SELECTION
later.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: Add encoder/decoder support for CODA960
Philipp Zabel [Fri, 11 Jul 2014 09:36:17 +0000 (06:36 -0300)]
[media] coda: Add encoder/decoder support for CODA960

This patch adds support for the CODA960 VPU in Freescale i.MX6 SoCs.

It enables h.264 and MPEG4 encoding and decoding support. Besides the usual
register shifting, the CODA960 gains frame memory control and GDI registers
that are set up for linear mapping right now, needs ENC_PIC_SRC_INDEX to be
set beyond the number of internal buffers for some reason, and has subsampling
buffers that need to be set up. Also, the work buffer size is increased to
80 KiB.

The CODA960 firmware spins if there is not enough input data in the bitstream
buffer. To make it continue, buffers need to be copied into the bitstream as
soon as they are queued. As the bitstream fifo is written into from two places,
it must be protected with a mutex. For that, using a threaded interrupt handler
is necessary.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi2500: rename namespace msi3101 => msi2500
Antti Palosaari [Tue, 22 Jul 2014 08:43:06 +0000 (05:43 -0300)]
[media] msi2500: rename namespace msi3101 => msi2500

Rename driver namespace according to current driver name. Old
msi3101 was name of reference design, msi2500 is name of chip
itself.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi2500: refactor USB stream copying
Antti Palosaari [Tue, 22 Jul 2014 08:29:57 +0000 (05:29 -0300)]
[media] msi2500: refactor USB stream copying

There was a lot of duplicated functionality between different
stream format handling. Refactor functionality in order to get
rid of duplicated code.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi2500: correct style issues
Antti Palosaari [Tue, 22 Jul 2014 05:44:12 +0000 (02:44 -0300)]
[media] msi2500: correct style issues

Correct some style issues, mostly reported by checkpatch.pl.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-mfc: Add init buffer cmd to MFCV6
Arun Kumar K [Wed, 21 May 2014 09:29:31 +0000 (06:29 -0300)]
[media] s5p-mfc: Add init buffer cmd to MFCV6

Latest MFC v6 firmware requires tile mode and loop filter
setting to be done as part of Init buffer command, in sync
with v7. This patch adds this support for new v6 firmware.

Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Kiran AVND <avnd.kiran@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-mfc: Support multiple firmware sub-versions
Arun Kumar K [Wed, 21 May 2014 09:29:30 +0000 (06:29 -0300)]
[media] s5p-mfc: Support multiple firmware sub-versions

For MFC firmwares, improved versions with bug fixes and
feature additions are released keeping the firmware version
including major and minor number same. The issue came with
the release of a new MFCv6 firmware with an interface change.
This patch adds the support of accepting multiple firmware
binaries for every version with the driver trying to load
firmwares starting from latest. This ensures full backward
compatibility regardless of which firmware version and kernel
version is used.

Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-mfc: Remove duplicate function s5p_mfc_reload_firmware
Arun Kumar K [Wed, 21 May 2014 09:29:29 +0000 (06:29 -0300)]
[media] s5p-mfc: Remove duplicate function s5p_mfc_reload_firmware

The function s5p_mfc_reload_firmware is exactly same as
s5p_mfc_load_firmware. So removing the duplicate function.

Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] tvp5150: Use i2c_smbus_(read|write)_byte_data
Laurent Pinchart [Mon, 26 May 2014 19:31:28 +0000 (16:31 -0300)]
[media] tvp5150: Use i2c_smbus_(read|write)_byte_data

X-Patchwork-Delegate: mchehab@redhat.com
Replace the custom I2C read/write implementation with SMBUS functions to
simplify the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] tvp5150: Fix device ID kernel log message
Laurent Pinchart [Mon, 26 May 2014 19:28:31 +0000 (16:28 -0300)]
[media] tvp5150: Fix device ID kernel log message

X-Patchwork-Delegate: mchehab@redhat.com
The driver mistakenly prints the ROM version instead of the device ID to
the kernel log when detecting the chip. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] sms: Remove CONFIG_ prefix from Kconfig symbols
Paul Bolle [Wed, 16 Apr 2014 15:47:43 +0000 (12:47 -0300)]
[media] sms: Remove CONFIG_ prefix from Kconfig symbols

X-Patchwork-Delegate: mchehab@redhat.com
Remove the CONFIG_ prefix from two Kconfig symbols in a dependency for
SMS_SIANO_DEBUGFS. This prefix is invalid inside Kconfig files.

Note that the current (common sense) dependency on SMS_USB_DRV and
SMS_SDIO_DRV being equal ensures that SMS_SIANO_DEBUGFS will not
violate its constraints. These constraint are that:
- it should only be built if SMS_USB_DRV is set;
- it can't be builtin if USB support is modular.

So drop the dependency on SMS_USB_DRV, as it is unneeded.

Fixes: 6c84b214284e ("[media] sms: fix randconfig building error")
Reported-by: Martin Walch <walch.martin@web.de>
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] dw2102: Geniatech T220 init fixed
CrazyCat [Tue, 3 Jun 2014 17:22:44 +0000 (14:22 -0300)]
[media] dw2102: Geniatech T220 init fixed

Geniatech T220 init fixed - reset cmd from windows driver and fixed TS bus config for cxd2820r.

Signed-off-by: Evgeny Plehov <EvgenyPlehov@ukr.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] cxd2820r: TS clock inversion in config
CrazyCat [Tue, 3 Jun 2014 17:19:07 +0000 (14:19 -0300)]
[media] cxd2820r: TS clock inversion in config

TS clock inversion in config.

Signed-off-by: Evgeny Plehov <EvgenyPlehov@ukr.net>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoMerge commit '67dd8f35c2d8ed80f26c9654b474cffc11c6674d' into patchwork
Mauro Carvalho Chehab [Tue, 22 Jul 2014 05:03:59 +0000 (02:03 -0300)]
Merge commit '67dd8f35c2d8ed80f26c9654b474cffc11c6674d' into patchwork

* .: (268 commits)
  Linux 3.16-rc6
  um: segv: Save regs only in case of a kernel mode fault
  um: Fix hung task in fix_range_common()
  um: Ensure that a stub page cannot get unmapped
  Revert "um: Fix wait_stub_done() error handling"
  btrfs: test for valid bdev before kobj removal in btrfs_rm_device
  Btrfs: fix abnormal long waiting in fsync
  random: check for increase of entropy_count because of signed conversion
  ARM: EXYNOS: Fix core ID used by platsmp and hotplug code
  ahci: add support for the Promise FastTrak TX8660 SATA HBA (ahci mode)
  ARM: at91/dt: add missing clocks property to pwm node in sam9x5.dtsi
  ARM: at91/dt: fix usb0 clocks definition in sam9n12 dtsi
  ARM: at91: at91sam9x5: correct typo error for ohci clock
  irqchip: gic: Fix core ID calculation when topology is read from DT
  GFS2: fs/gfs2/rgrp.c: kernel-doc warning fixes
  GFS2: memcontrol: Spelling s/invlidate/invalidate/
  GFS2: Allow caching of glocks for flock
  GFS2: Allow flocks to use normal glock dq rather than dq_wait
  GFS2: replace count*size kzalloc by kcalloc
  GFS2: Use GFP_NOFS when allocating glocks
  ...

Conflicts:
drivers/media/dvb-frontends/si2168.c
drivers/media/dvb-frontends/si2168_priv.h
drivers/media/tuners/si2157.c

10 years ago[media] v4l2-subdev: Fix compilation when !VIDEO_V4L2_SUBDEV_API
Mauro Carvalho Chehab [Tue, 22 Jul 2014 04:40:00 +0000 (01:40 -0300)]
[media] v4l2-subdev: Fix compilation when !VIDEO_V4L2_SUBDEV_API

As reported by Kbuildtest:

   drivers/media/v4l2-core/v4l2-subdev.c: In function 'check_format':
   drivers/media/v4l2-core/v4l2-subdev.c:136:23: error: 'struct v4l2_subdev' has no member named 'entity'
     if (format->pad >= sd->entity.num_pads)
                          ^
   drivers/media/v4l2-core/v4l2-subdev.c: In function 'check_crop':
   drivers/media/v4l2-core/v4l2-subdev.c:148:21: error: 'struct v4l2_subdev' has no member named 'entity'
     if (crop->pad >= sd->entity.num_pads)
                        ^
   drivers/media/v4l2-core/v4l2-subdev.c: In function 'check_selection':
   drivers/media/v4l2-core/v4l2-subdev.c:161:20: error: 'struct v4l2_subdev' has no member named 'entity'
     if (sel->pad >= sd->entity.num_pads)
                       ^
   drivers/media/v4l2-core/v4l2-subdev.c: In function 'check_edid':
   drivers/media/v4l2-core/v4l2-subdev.c:169:21: error: 'struct v4l2_subdev' has no member named 'entity'
     if (edid->pad >= sd->entity.num_pads)
                        ^
   drivers/media/v4l2-core/v4l2-subdev.c: In function 'subdev_do_ioctl':
>> drivers/media/v4l2-core/v4l2-subdev.c:186:6: warning: unused variable 'rval' [-Wunused-variable]
     int rval;
         ^
   drivers/media/v4l2-core/v4l2-subdev.c: At top level:
   drivers/media/v4l2-core/v4l2-subdev.c:129:12: warning: 'check_format' defined but not used [-Wunused-function]
    static int check_format(struct v4l2_subdev *sd,
               ^
   drivers/media/v4l2-core/v4l2-subdev.c:142:12: warning: 'check_crop' defined but not used [-Wunused-function]
    static int check_crop(struct v4l2_subdev *sd, struct v4l2_subdev_crop *crop)
               ^
   drivers/media/v4l2-core/v4l2-subdev.c:154:12: warning: 'check_selection' defined but not used [-Wunused-function]
    static int check_selection(struct v4l2_subdev *sd,
               ^
   drivers/media/v4l2-core/v4l2-subdev.c:167:12: warning: 'check_edid' defined but not used [-Wunused-function]
    static int check_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid *edid)

The above warnins happen because those functions are used only
when the V4L2 subdev API is enabled.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] rtl2832_sdr: fix Kconfig dependencies
Antti Palosaari [Tue, 22 Jul 2014 04:28:00 +0000 (01:28 -0300)]
[media] rtl2832_sdr: fix Kconfig dependencies

MEDIA_SDR_SUPPORT and I2C_MUX are needed for rtl2832_sdr.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] rtl2832_sdr: remove plain 64-bit divisions
Antti Palosaari [Tue, 22 Jul 2014 03:18:19 +0000 (00:18 -0300)]
[media] rtl2832_sdr: remove plain 64-bit divisions

Commit 0ba2aeb6dab80920edd9cf5b93b1ea4d6913b8f3
(v4l2-ctrls: increase internal min/max/step/def to 64 bit)
changes v4l2 controls to 64-bit. Driver it not working on 32-bit
arch as it uses directly control 'step' which is changed to 64-bit.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media:platform: OMAP3 camera support needs VIDEOBUF2_DMA_CONTIG
Peter Meerwald [Fri, 4 Jul 2014 07:51:47 +0000 (04:51 -0300)]
[media] media:platform: OMAP3 camera support needs VIDEOBUF2_DMA_CONTIG

drivers/built-in.o: In function `isp_video_open':
/src/linux/drivers/media/platform/omap3isp/ispvideo.c:1253: undefined reference to `vb2_dma_contig_memops'
drivers/built-in.o: In function `omap3isp_video_init':
/src/linux/drivers/media/platform/omap3isp/ispvideo.c:1344: undefined reference to `vb2_dma_contig_init_ctx'
/src/linux/drivers/media/platform/omap3isp/ispvideo.c:1350: undefined reference to `vb2_dma_contig_cleanup_ctx'
drivers/built-in.o: In function `omap3isp_video_cleanup':
/src/linux/drivers/media/platform/omap3isp/ispvideo.c:1381: undefined reference to `vb2_dma_contig_cleanup_ctx'
make: *** [vmlinux] Error 1

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media-device: Remove duplicated memset() in media_enum_entities()
Salva Peiró [Sat, 7 Jun 2014 14:41:44 +0000 (11:41 -0300)]
[media] media-device: Remove duplicated memset() in media_enum_entities()

After the zeroing the whole struct struct media_entity_desc u_ent,
it is no longer necessary to memset(0) its u_ent.name field.

CC: stable@vger.kernel.org
Signed-off-by: Salva Peiró <speiro@ai2.upv.es>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: subdev: Unify argument validation across IOCTLs
Sakari Ailus [Wed, 4 Jun 2014 11:22:03 +0000 (08:22 -0300)]
[media] v4l: subdev: Unify argument validation across IOCTLs

Separate validation of different argument types. There's no reason to do
this separately for every IOCTL.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: s3c-camif: Return V4L2_FIELD_NONE from pad-level set format
Laurent Pinchart [Mon, 19 May 2014 15:04:32 +0000 (12:04 -0300)]
[media] v4l: s3c-camif: Return V4L2_FIELD_NONE from pad-level set format

The bridge driver doesn't support interlaced formats, always return the
field order set to V4L2_FIELD_NONE.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: smiapp: Return V4L2_FIELD_NONE from pad-level get/set format
Laurent Pinchart [Mon, 19 May 2014 15:04:32 +0000 (12:04 -0300)]
[media] v4l: smiapp: Return V4L2_FIELD_NONE from pad-level get/set format

The SMIA++ sensors are progressive, always return the field order set to
V4L2_FIELD_NONE.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: s5k6a3: Return V4L2_FIELD_NONE from pad-level set format
Laurent Pinchart [Mon, 19 May 2014 15:04:32 +0000 (12:04 -0300)]
[media] v4l: s5k6a3: Return V4L2_FIELD_NONE from pad-level set format

The sensor is progressive, always return the field order set to
V4L2_FIELD_NONE.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: s5k5baf: Return V4L2_FIELD_NONE from pad-level set format
Laurent Pinchart [Mon, 19 May 2014 15:04:32 +0000 (12:04 -0300)]
[media] v4l: s5k5baf: Return V4L2_FIELD_NONE from pad-level set format

The sensor is progressive, always return the field order set to
V4L2_FIELD_NONE.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: s5k4ecgx: Return V4L2_FIELD_NONE from pad-level set format
Laurent Pinchart [Mon, 19 May 2014 15:04:32 +0000 (12:04 -0300)]
[media] v4l: s5k4ecgx: Return V4L2_FIELD_NONE from pad-level set format

The sensor is progressive, always return the field order set to
V4L2_FIELD_NONE.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: noon010p30: Return V4L2_FIELD_NONE from pad-level set format
Laurent Pinchart [Mon, 19 May 2014 15:04:32 +0000 (12:04 -0300)]
[media] v4l: noon010p30: Return V4L2_FIELD_NONE from pad-level set format

The sensor is progressive, always return the field order set to
V4L2_FIELD_NONE.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] davinci: vpfe: dm365: remove duplicate RSZ_LPF_INT_MASK
Dan Carpenter [Mon, 9 Jun 2014 15:10:46 +0000 (12:10 -0300)]
[media] davinci: vpfe: dm365: remove duplicate RSZ_LPF_INT_MASK

The RSZ_LPF_INT_MASK define is cut and pasted twice so we can remove the
second instance.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: davinci_vpfe: dm365_resizer: fix sparse warning
Lad, Prabhakar [Tue, 29 Apr 2014 06:49:34 +0000 (03:49 -0300)]
[media] media: davinci_vpfe: dm365_resizer: fix sparse warning

this patch fixes following sparse warning,
dm365_resizer.c:223:1: warning: symbol 'resizer_calculate_resize_ratios' was not declared. Should it be static?
dm365_resizer.c:313:5: warning: symbol 'resizer_configure_output_win' was not declared. Should it be static?

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] staging: media: davinci_vpfe: fix checkpatch warning
Lad, Prabhakar [Sat, 29 Mar 2014 04:56:13 +0000 (01:56 -0300)]
[media] staging: media: davinci_vpfe: fix checkpatch warning

This patch fixes following checkpatch warning,
media/davinci_vpfe/dm365_ipipe.c:1271: WARNING: Missing a blank line after declarations
media/davinci_vpfe/dm365_ipipe.c:1313: WARNING: Missing a blank line after declarations

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] mt9v032: use regmap
Philipp Zabel [Wed, 4 Jun 2014 16:57:03 +0000 (13:57 -0300)]
[media] mt9v032: use regmap

This switches all register accesses to use regmap. It allows to
use the regmap cache, tracing, and debug register dump facilities,
and removes the need to open code read-modify-writes.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] mt9v032: register v4l2 asynchronous subdevice
Philipp Zabel [Wed, 4 Jun 2014 16:57:02 +0000 (13:57 -0300)]
[media] mt9v032: register v4l2 asynchronous subdevice

Add support for registering the sensor subdevice using the v4l2-async API.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] mt9v032: add support for mt9v022 and mt9v024
Philipp Zabel [Tue, 3 Jun 2014 09:35:54 +0000 (06:35 -0300)]
[media] mt9v032: add support for mt9v022 and mt9v024

as are mt9v024 and mt9v034. With minimal changes it is possible
to support mt9v02[24] with the same driver.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] mt9v032: do not clear reserved bits in read mode register
Philipp Zabel [Tue, 3 Jun 2014 09:35:53 +0000 (06:35 -0300)]
[media] mt9v032: do not clear reserved bits in read mode register

The read mode register bits 8 and 9 are set and marked as reserved.
Don't clear them.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] mt9v032: fix hblank calculation
Philipp Zabel [Mon, 26 May 2014 13:55:51 +0000 (10:55 -0300)]
[media] mt9v032: fix hblank calculation

Since (min_row_time - crop->width) can be negative, we have to do a signed
comparison here. Otherwise max_t casts the negative value to unsigned int
and sets min_hblank to that invalid value.

Cc: stable@vger.kernel.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: davinci: vpif: fix array out of bound warnings
Prabhakar Lad [Fri, 18 Jul 2014 16:31:51 +0000 (13:31 -0300)]
[media] media: davinci: vpif: fix array out of bound warnings

This patch fixes following array out of bound warnings,

drivers/media/platform/davinci/vpif_display.c: In function 'vpif_remove':
drivers/media/platform/davinci/vpif_display.c:1389:36: warning: iteration
1u invokes undefined behavior [-Waggressive-loop-optimizations]
   vb2_dma_contig_cleanup_ctx(common->alloc_ctx);
                                    ^
drivers/media/platform/davinci/vpif_display.c:1385:2: note: containing loop
  for (i = 0; i < VPIF_DISPLAY_MAX_DEVICES; i++) {
  ^
drivers/media/platform/davinci/vpif_capture.c: In function 'vpif_remove':
drivers/media/platform/davinci/vpif_capture.c:1581:36: warning: iteration
1u invokes undefined behavior [-Waggressive-loop-optimizations]
   vb2_dma_contig_cleanup_ctx(common->alloc_ctx);
                                    ^
drivers/media/platform/davinci/vpif_capture.c:1577:2: note: containing loop
  for (i = 0; i < VPIF_CAPTURE_MAX_DEVICES; i++) {
  ^
drivers/media/platform/davinci/vpif_capture.c:1580:23: warning: array subscript
is above array bounds [-Warray-bounds]
   common = &ch->common[i];

Reported-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-ioctl: don't set PRIV_MAGIC unconditionally in g_fmt()
Hans Verkuil [Mon, 21 Jul 2014 10:50:39 +0000 (07:50 -0300)]
[media] v4l2-ioctl: don't set PRIV_MAGIC unconditionally in g_fmt()

Regression fix:

V4L2_PIX_FMT_PRIV_MAGIC should only be set for the VIDEO_CAPTURE and
VIDEO_OUTPUT buffer types, and not for any others. In the case of
the win format this overwrote a pointer value that is passed in from
userspace.

Just set it for V4L2_BUF_TYPE_VIDEO_CAPTURE and OUTPUT only. Set
it before the callback is called, just as is done for try/s_fmt, and
again afterwards in case the driver zeroed it. The latter was missing
in try/s_fmt, so add it there as well. Currently it is quite likely
that drivers clear priv (that was needed for a long time), so it makes
sense to set it twice.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-ioctl: set V4L2_CAP_EXT_PIX_FORMAT for device_caps
Hans Verkuil [Mon, 21 Jul 2014 07:14:46 +0000 (04:14 -0300)]
[media] v4l2-ioctl: set V4L2_CAP_EXT_PIX_FORMAT for device_caps

V4L2_CAP_EXT_PIX_FORMAT is set for capabilities, but it needs to be set for
device_caps as well: device_caps should report all caps relevant to the
device node, and this is one of them.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] DocBook media typo
Hans Verkuil [Sun, 20 Jul 2014 20:16:41 +0000 (17:16 -0300)]
[media] DocBook media typo

V4L2_CID_BASE_LASTP1 should be V4L2_CID_LASTP1. This has probably been wrong
since the earliest days of this documentation until I did a copy-and-paste
and found out that V4L2_CID_BASE_LASTP1 doesn't actually exist :-)

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>