platform/kernel/linux-3.10.git
9 years agoupstream: [media] em28xx: Fix em28xx deplock
Mauro Carvalho Chehab [Fri, 27 Dec 2013 16:01:04 +0000 (13:01 -0300)]
upstream: [media] em28xx: Fix em28xx deplock

When em28xx extensions are loaded/removed, there are two locks:

a single static em28xx_devlist_mutex that registers each extension
and the struct em28xx dev->lock.

When extensions are registered, em28xx_devlist_mutex is taken first,
and then dev->lock.

Be sure that, when extensions are being removed, the same order
will be used.

Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] em28xx: some cosmetic changes
Mauro Carvalho Chehab [Sun, 22 Dec 2013 16:13:41 +0000 (13:13 -0300)]
upstream: [media] em28xx: some cosmetic changes

In order to make easier for the next patches, do some
cosmetic changes.

No functional changes.

Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] em28xx: move some video-specific functions to em28xx-video
Mauro Carvalho Chehab [Sun, 22 Dec 2013 18:28:26 +0000 (15:28 -0300)]
upstream: [media] em28xx: move some video-specific functions to em28xx-video

Now that we want to split the video handling to a separate
module, move all video-specific functions to em28xx-video.

No functional changes.

Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] tuner-xc2028: remove unused code
Mauro Carvalho Chehab [Fri, 27 Dec 2013 02:07:59 +0000 (23:07 -0300)]
upstream: [media] tuner-xc2028: remove unused code

This macro is not used. remove it.

Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] tvp5150: make read operations atomic
Mauro Carvalho Chehab [Fri, 27 Dec 2013 02:07:22 +0000 (23:07 -0300)]
upstream: [media] tvp5150: make read operations atomic

Instead of using two I2C operations between write and read,
use just one i2c_transfer. That allows I2C mutexes to not
let any other I2C transfer between the two.

Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Tested-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: Restore irq flags correctly in omap4iss_video_buffer...
Dan Carpenter [Wed, 18 Dec 2013 07:29:24 +0000 (04:29 -0300)]
upstream: [media] v4l: omap4iss: Restore irq flags correctly in omap4iss_video_buffer_next()

The spin_lock_irqsave() macro is not nestable.  The second call will
overwrite the first record of "flags" so the IRQs will not be enabled
correctly at the end of the function.

In the current code, this function is always called from the IRQ handler
so everything works fine and this fix doesn't change anything.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: use snprintf() to make smatch happy
Dan Carpenter [Mon, 16 Dec 2013 20:19:50 +0000 (17:19 -0300)]
upstream: [media] v4l: omap4iss: use snprintf() to make smatch happy

Smatch complains here because name is a 32 character buffer and we
adding the "OMAP4 ISS " prefix as well for a total of 42 characters.
The sd->name buffer can only hold 32 characters.  I've changed it to use
snprintf() to silence the overflow warning.

Also I have removed the call to strlcpy() which is a no-op.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] em28xx: reduce the polling interval for GPI connected buttons
Frank Schaefer [Sat, 14 Dec 2013 09:40:11 +0000 (06:40 -0300)]
upstream: [media] em28xx: reduce the polling interval for GPI connected buttons

For GPI-connected buttons without (hardware) debouncing, the polling interval
needs to be reduced to detect button presses properly.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] Add USB IDs for Winfast DTV Dongle Mini-D
Robert Backhaus [Fri, 13 Dec 2013 12:59:10 +0000 (09:59 -0300)]
upstream: [media] Add USB IDs for Winfast DTV Dongle Mini-D

GIT_AUTHOR_DATE=1386943312
    Add USB IDs for the WinFast DTV Dongle Mini.
    Device is tested and works fine under MythTV

Signed-off-by: Robert Backhaus <robbak@robbak.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>
9 years agoupstream: [media] m88ts2022: fix some style issues reported by checkpatch.pl
Antti Palosaari [Wed, 18 Dec 2013 15:46:45 +0000 (12:46 -0300)]
upstream: [media] m88ts2022: fix some style issues reported by checkpatch.pl

Latest checkpatch.pl has some new requirements for coding style.
Fix some of those.

* remove Free Software Foundation postal address
* use sizeof(*foo), not sizeof(struct foo)

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] m88ds3103: fix some style issues reported by checkpatch.pl
Antti Palosaari [Wed, 18 Dec 2013 15:38:42 +0000 (12:38 -0300)]
upstream: [media] m88ds3103: fix some style issues reported by checkpatch.pl

* remove Free Software Foundation postal address
* add one pair of parenthesis
* use sizeof(*foo), not sizeof(struct foo)

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] m88ds3103: I/O optimize inittab write
Antti Palosaari [Mon, 2 Dec 2013 17:08:53 +0000 (14:08 -0300)]
upstream: [media] m88ds3103: I/O optimize inittab write

Write inittab using reg address auto-increment in order to reduce
I/O a little bit.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] m88ds3103: add default value for reg 56
Antti Palosaari [Mon, 2 Dec 2013 16:38:53 +0000 (13:38 -0300)]
upstream: [media] m88ds3103: add default value for reg 56

Reg 0x56 should be programmed to 0x01. Add default to inittab.

Reported-by: David Howells <dhowells@redhat.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] m88ds3103: remove unneeded AGC from inittab
Antti Palosaari [Mon, 2 Dec 2013 16:11:21 +0000 (13:11 -0300)]
upstream: [media] m88ds3103: remove unneeded AGC from inittab

Optimal AGC is highly depended on used RF tuner and due to that
it is already included to chip configuration. However, inittab
has default AGC value, which was later replaced by one from config.

Add also comment to all chip configuration options about default
values and if those are needed to set or not.

Reported-by: David Howells <dhowells@redhat.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] m88ts2022: reimplement synthesizer calculations
Antti Palosaari [Mon, 2 Dec 2013 04:39:24 +0000 (01:39 -0300)]
upstream: [media] m88ts2022: reimplement synthesizer calculations

Used synthesizer is very typical integer-N PLL, with configurable
reference frequency divider, output frequency divider and of
course N itself. Most common method to calculate values is first
select output divider, then calculate VCO frequency and finally
calculate PLL N from VCO frequency. Do it that way.

Also make some cleanups for filter logic and signal strength.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] m88ds3103: fix TS mode config
Antti Palosaari [Wed, 20 Nov 2013 02:06:39 +0000 (23:06 -0300)]
upstream: [media] m88ds3103: fix TS mode config

TS mode was configured wrongly.

Reported-by: David Howells <dhowells@redhat.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] m88ds3103: use kernel macro to round division
Antti Palosaari [Wed, 20 Nov 2013 01:37:55 +0000 (22:37 -0300)]
upstream: [media] m88ds3103: use kernel macro to round division

DIV_ROUND_CLOSEST does the job and looks better.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] m88ds3103: use I2C mux for tuner I2C adapter
Antti Palosaari [Tue, 19 Nov 2013 23:32:42 +0000 (20:32 -0300)]
upstream: [media] m88ds3103: use I2C mux for tuner I2C adapter

Switch standard I2C adapter to muxed I2C adapter.

David reported that I2C adapter implementation caused deadlock.
I discussed with Jean and he suggested to implement it as a
multiplexed i2c adapter because tuner I2C bus could be seen like
own I2C segment.

Reported-by: David Howells <dhowells@redhat.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] m88ds3103: do not use dynamic stack allocation
Antti Palosaari [Thu, 7 Nov 2013 20:35:43 +0000 (17:35 -0300)]
upstream: [media] m88ds3103: do not use dynamic stack allocation

I2C transfer were using dynamic stack allocation. Get rid of it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] Montage M88TS2022 silicon tuner driver
Antti Palosaari [Mon, 25 Feb 2013 11:43:32 +0000 (08:43 -0300)]
upstream: [media] Montage M88TS2022 silicon tuner driver

M88TS2022 is DVB-S/S2 RF tuner used usually in conjunction with
Montage M88DS3103 DVB-S/S2 demodulator.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] Montage M88DS3103 DVB-S/S2 demodulator driver
Antti Palosaari [Mon, 25 Feb 2013 11:39:16 +0000 (08:39 -0300)]
upstream: [media] Montage M88DS3103 DVB-S/S2 demodulator driver

DVB-S/S2 satellite television demodulator driver.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] dib8000: improve block statistics
Mauro Carvalho Chehab [Tue, 17 Dec 2013 14:34:22 +0000 (11:34 -0300)]
upstream: [media] dib8000: improve block statistics

PER/UCB statistics are collected once on each 1 second.
However, it doesn't provide the total number of packets
needed to calculate PER.

Yet, as we know the bit rate, it is possible to estimate
such number. So, do it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Acked-by: Patrick Boettcher <pboettcher@kernellabs.com>
9 years agoupstream: [media] dib8000: be sure that stats are available before reading them
Mauro Carvalho Chehab [Tue, 17 Dec 2013 13:08:20 +0000 (10:08 -0300)]
upstream: [media] dib8000: be sure that stats are available before reading them

On dib8000, the BER statistics are updated on every 1.25e6 bits.
Adjust the code to only update the statistics after having it
done.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Acked-by: Patrick Boettcher <pboettcher@kernellabs.com>
9 years agoupstream: [media] dib8000: Fix UCB measure with DVBv5 stats
Mauro Carvalho Chehab [Tue, 17 Dec 2013 07:55:26 +0000 (04:55 -0300)]
upstream: [media] dib8000: Fix UCB measure with DVBv5 stats

On dib8000, the block error count is a monotonic 32 bits register.
With DVBv5 stats, we use a 64 bits counter, that it is reset
when a new channel is tuned.

Change the UCB counting start from 0 and to be returned with
64 bits, just like the API requests.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Acked-by: Patrick Boettcher <pboettcher@kernellabs.com>
9 years agoupstream: [media] dib8000: make a better estimation for dBm
Mauro Carvalho Chehab [Tue, 17 Dec 2013 00:45:19 +0000 (21:45 -0300)]
upstream: [media] dib8000: make a better estimation for dBm

Use multiple linear segments to better interpolate the dBm
for the signal strength.

The table that converts from linear strength to dB was
empirically determinated with the help of a signal generator
(DTA-2111).

The entries from -35dBm to -22.5dBm were taken using just
the signal generator and the board.

For the entries from -36dBm to -51dBm, a 16 dB tap was used,
in order to extend its range.

Signals below to -51dBm are just linearly interpolated.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Acked-by: Patrick Boettcher <pboettcher@kernellabs.com>
9 years agoupstream: [media] dib8000: estimate strength in dBm
Mauro Carvalho Chehab [Mon, 16 Dec 2013 23:00:34 +0000 (20:00 -0300)]
upstream: [media] dib8000: estimate strength in dBm

Better to have Signal strength in dB.
This takes a very rough estimation for the signal strength,
that was calibrated using a Dektec DTA-2111 Gold RF generator
and a Pixelview dib8076 stick.

It estimates the signal strength using a linear equation where:
- the max is -22.5 dBm, with returns 55953
- the min is -35.0 dBm, with returns 50110

With -22dBm, the signal strengh is returned as 65535.
Unfortunately, the min strength generated with DTA-2111 is
-35dBm.

It should be noticed that approximating it by a linear equation
is not right. I should probably be splitting it into 0.5 dB
linear segments, in order to get a higher precision, just like
it is done on mb86a20s, but that would force me to add some
attenuators, in order to get dB levels below -35dBm, which is,
btw, strong enough to get signal lock.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Acked-by: Patrick Boettcher <pboettcher@kernellabs.com>
9 years agoupstream: [media] dib8000: add DVBv5 stats
Mauro Carvalho Chehab [Mon, 16 Dec 2013 22:10:59 +0000 (19:10 -0300)]
upstream: [media] dib8000: add DVBv5 stats

The advantage of DVBv5 stats is that it allows adding proper
scales to all measures. use it for this frontend.

This patch adds a basic set of stats, basically cloning what's already
provided by DVBv3 API. Latter patches will improve it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Acked-by: Patrick Boettcher <pboettcher@kernellabs.com>
9 years agoupstream: [media] dib8000: report Interleaving 4 correctly
Mauro Carvalho Chehab [Mon, 16 Dec 2013 07:16:59 +0000 (04:16 -0300)]
upstream: [media] dib8000: report Interleaving 4 correctly

On ISDB-T, the valid values for interleaving are 0, 1, 2 and 4.
While the first 3 are properly reported, the last one is reported
as 3 instead. Fix it.

Tested with a Dektec DTA-2111 RF generator.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Acked-by: Patrick Boettcher <pboettcher@kernellabs.com>
9 years agoupstream: [media] dib8000: improves the auto search mode check logic
Mauro Carvalho Chehab [Sun, 15 Dec 2013 12:57:40 +0000 (09:57 -0300)]
upstream: [media] dib8000: improves the auto search mode check logic

The logic that detects if auto search mode should be used is too
complex.

Also, it doesn't cover all cases, as the dib8000_tune logic
requires either auto mode or a fully specified manual mode.
So, move it to a separate function and add some extra debug
data to help identifying when it falled back to auto mode,
because the manual settings are invalid.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Acked-by: Patrick Boettcher <pboettcher@kernellabs.com>
9 years agoupstream: [media] dib8000: Don't let tuner hang due to a call to get_frontend()
Mauro Carvalho Chehab [Sun, 15 Dec 2013 09:41:20 +0000 (07:41 -0200)]
upstream: [media] dib8000: Don't let tuner hang due to a call to get_frontend()

Both dvbv5-scan and dvbv5-zap tools call FE_GET_PROPERTY inside the
loop that checks for stats. If the frontend doesn't support DVBv5, it
falls back to call the DVBv5 stats APIs(FE_READ_BER, FE_READ_SIGNAL,
FE_READ_SNR and FE_READ_UNCORRECTED_BLOCKS).

A call to FE_GET_PROPERTY makes dvb-frontend core to call get_frontend().

However, due to a race condition on dib8000 between dib8000_get_frontend
and dib8000_tune, if get_frontend occurs too early, it causes the
tune state machine to fail and not get any lock.

This patch adds a workaround code that makes get_frontend() to just
return if none of the frontends have a SYNC. This change fixed the issue
with dvbv5-scan/dvbv5-zap, but a fine-tuned logic might be needed in
the future, when we implement DVBv5 stats on this frontend.

The procedure to test the bug and the fix is the one below:

1) tune into a non-existing frequency with:

$ dvbv5-zap -I dvbv5 -c non_existing_freqs -m 679142857 -t3

2) tune/lock into an existing frequency with:

$ dvbv5-zap -I dvbv5 -c isdb-test -m 479142857
    or
$ dvbv5-scan isdb-test

In this case, 679 MHz carrier doesn't exist. Only 479 MHz does.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Acked-by: Patrick Boettcher <pboettcher@kernellabs.com>
9 years agoupstream: [media] it913x: Add support for Avermedia H335 id 0x0335
Malcolm Priestley [Thu, 12 Dec 2013 19:38:51 +0000 (16:38 -0300)]
upstream: [media] it913x: Add support for Avermedia H335 id 0x0335

Trivial USB ID addition for Avermedia H335.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Cc: stable@vger.kernel.org # v3.11+
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: sh_vou: Fix warnings due to improper casts and printk formats
Laurent Pinchart [Wed, 11 Dec 2013 12:33:03 +0000 (09:33 -0300)]
upstream: [media] v4l: sh_vou: Fix warnings due to improper casts and printk formats

Use the %zu and %pad printk specifiers to print size_t and dma_addr_t
variables. This fixes warnings on platforms where dma_addr_t has a
different size than int.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] a8293: add small sleep in order to settle LNB voltage
Antti Palosaari [Mon, 25 Feb 2013 11:24:18 +0000 (08:24 -0300)]
upstream: [media] a8293: add small sleep in order to settle LNB voltage

PCTV 461e requires that small delay.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] em28xx: add support for Empia EM28178
Antti Palosaari [Mon, 25 Feb 2013 11:19:04 +0000 (08:19 -0300)]
upstream: [media] em28xx: add support for Empia EM28178

New chip version, which is very similar than EM28174.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: atmel-isi: Should clear bits before set the hardware register
Josh Wu [Tue, 10 Dec 2013 12:25:47 +0000 (09:25 -0300)]
upstream: [media] v4l: atmel-isi: Should clear bits before set the hardware register

In the ISI driver it reads the config register to get original value,
then set the correct FRATE_DIV and YCC_SWAP_MODE directly. This will
cause some bits overlap.

So we need to clear these bits first, then set correct value. This patch
fix it.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: atmel-isi: Fix color component ordering
Laurent Pinchart [Wed, 4 Dec 2013 16:19:11 +0000 (13:19 -0300)]
upstream: [media] v4l: atmel-isi: Fix color component ordering

The ISI_CFG2.YCC_SWAP field controls color component ordering. The
datasheet lists the following orderings for the memory formats.

YCC_SWAP Byte 0 Byte 1 Byte 2 Byte 3
00: Default Cb(i) Y(i) Cr(i) Y(i+1)
01: Mode1 Cr(i) Y(i) Cb(i) Y(i+1)
10: Mode2 Y(i) Cb(i) Y(i+1) Cr(i)
11: Mode3 Y(i) Cr(i) Y(i+1) Cb(i)

This is based on a sensor format set to CbYCrY (UYVY). The driver
hardcodes the output memory format to YUYV, configure the ordering
accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: atmel-isi: Make the MCK clock optional
Laurent Pinchart [Sat, 23 Nov 2013 02:06:54 +0000 (23:06 -0300)]
upstream: [media] v4l: atmel-isi: Make the MCK clock optional

ISI_MCK is the sensor master clock. It should be handled by the sensor
driver directly, as the ISI has no use for that clock. Make the clock
optional here while platforms transition to the correct model.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: atmel-isi: Reset the ISI when starting the stream
Laurent Pinchart [Sun, 3 Nov 2013 00:25:06 +0000 (21:25 -0300)]
upstream: [media] v4l: atmel-isi: Reset the ISI when starting the stream

The queue setup operation isn't the right place to reset the ISI. Move
the reset call to the start streaming operation.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: atmel-isi: Defer clock (un)preparation to enable/disable time
Laurent Pinchart [Mon, 25 Nov 2013 15:21:33 +0000 (12:21 -0300)]
upstream: [media] v4l: atmel-isi: Defer clock (un)preparation to enable/disable time

The PCLK and MCK clocks are prepared and unprepared at probe and remove
time. Clock (un)preparation isn't needed before enabling/disabling the
clocks, and the enable/disable operation happen in non-atomic context.
We can thus defer (un)preparation to enable/disable time.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: atmel-isi: Use devm_* managed allocators
Laurent Pinchart [Mon, 25 Nov 2013 15:13:50 +0000 (12:13 -0300)]
upstream: [media] v4l: atmel-isi: Use devm_* managed allocators

This simplifies error and cleanup code paths.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: atmel-isi: remove SOF wait in start_streaming()
Josh Wu [Thu, 24 Oct 2013 07:27:11 +0000 (04:27 -0300)]
upstream: [media] v4l: atmel-isi: remove SOF wait in start_streaming()

when a userspace applications calls the VIDIOC_STREAMON ioctl. The
V4L2 core calls the soc_camera_streamon function, which is responsible
for starting the video stream. It does so by first starting the atmel-isi
host by a call to the vb2_streamon function, and then starting the sensor
by a call to the video.s_stream sensor subdev operation.
That means we wait for a SOF in start_streaming() before call sensor's
s_stream(). It is possible no VSYNC interrupt arrive as the sensor
hasn't been started yet.
To avoid such case, this patch remove the code to wait for the VSYNC
interrupt. And such code is not necessary.

Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] si4713: coding style time-related cleanups
Hans Verkuil [Fri, 6 Dec 2013 09:48:49 +0000 (06:48 -0300)]
upstream: [media] si4713: coding style time-related cleanups

Fix the non-whitespace checkpatch errors/warnings.
Replace msleep with usleep_range and the jiffies comparison with
time_is_after_jiffies().

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Acked-by: Dinesh Ram <dinesh.ram@cern.ch>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] si4713: coding style whitespace cleanups
Hans Verkuil [Fri, 6 Dec 2013 09:48:49 +0000 (06:48 -0300)]
upstream: [media] si4713: coding style whitespace cleanups

Fix most whitespace-related checkpatch errors/warnings.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Acked-by: Dinesh Ram <dinesh.ram@cern.ch>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] si4713: print product number
Eduardo Valentin [Tue, 5 Nov 2013 14:18:43 +0000 (11:18 -0300)]
upstream: [media] si4713: print product number

Print the PN value, useful to check what chip the dev board has.

Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] si4713: si4713_set_rds_radio_text overwrites terminating \0
Hans Verkuil [Tue, 15 Oct 2013 15:24:45 +0000 (12:24 -0300)]
upstream: [media] si4713: si4713_set_rds_radio_text overwrites terminating \0

si4713_set_rds_radio_text will overwrite the terminating zero at the
end of the rds radio text string in order to send out a carriage return
as per the RDS spec.
Use a separate char buffer for the CR instead of corrupting the control
string.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Eduardo Valentin <edubezval@gmail.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] si4713: move supply list to si4713_platform_data
Dinesh Ram [Tue, 15 Oct 2013 15:24:44 +0000 (12:24 -0300)]
upstream: [media] si4713: move supply list to si4713_platform_data

The supply list is needed by the platform driver, but not by the usb driver.
So this information belongs to the platform data and should not be hardcoded
in the subdevice driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Eduardo Valentin <edubezval@gmail.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] si4713: Added the USB driver for Si4713
Dinesh Ram [Tue, 15 Oct 2013 15:24:42 +0000 (12:24 -0300)]
upstream: [media] si4713: Added the USB driver for Si4713

This is the USB driver for the Silicon Labs development board.
It contains the Si4713 FM transmitter chip.

Signed-off-by: Dinesh Ram <dinesh.ram@cern.ch>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Eduardo Valentin <edubezval@gmail.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] si4713: Bug fix for si4713_tx_tune_power() method in the i2c driver
Dinesh Ram [Tue, 15 Oct 2013 15:24:40 +0000 (12:24 -0300)]
upstream: [media] si4713: Bug fix for si4713_tx_tune_power() method in the i2c driver

In the si4713_tx_tune_power() method, the args array element 'power'
can take values between SI4713_MIN_POWER and SI4713_MAX_POWER. power = 0
is also valid. All the values (0 > power < SI4713_MIN_POWER) are illegal
and hence are all mapped to SI4713_MIN_POWER.

Signed-off-by: Dinesh Ram <dinesh.ram@cern.ch>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Eduardo Valentin <edubezval@gmail.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] si4713: Reorganized includes in si4713.c/h
Dinesh Ram [Tue, 15 Oct 2013 15:24:39 +0000 (12:24 -0300)]
upstream: [media] si4713: Reorganized includes in si4713.c/h

Moved the header <linux/regulator/consumer.h> from si4713.c to si4713.h

Signed-off-by: Dinesh Ram <dinesh.ram@cern.ch>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Eduardo Valentin <edubezval@gmail.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] si4713: Modified i2c driver to handle cases where interrupts are...
Dinesh Ram [Tue, 15 Oct 2013 15:24:38 +0000 (12:24 -0300)]
upstream: [media] si4713: Modified i2c driver to handle cases where interrupts are not used

Checks have been introduced at several places in the code to test if an
interrupt is set or not. For devices which do not use the interrupt, to
get a valid response, within a specified timeout, the device is polled
instead.

Signed-off-by: Dinesh Ram <dinesh.ram@cern.ch>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Eduardo Valentin <edubezval@gmail.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] si4713: Reorganized drivers/media/radio directory
Dinesh Ram [Tue, 15 Oct 2013 15:24:37 +0000 (12:24 -0300)]
upstream: [media] si4713: Reorganized drivers/media/radio directory

Added a new si4713 directory which will contain all si4713 related files.
Also updated Makefile and Kconfig

Signed-off-by: Dinesh Ram <dinesh.ram@cern.ch>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Eduardo Valentin <edubezval@gmail.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] staging: media: davinci_vpfe: Rewrite return statement in vpfe_video.c
Lisa Nguyen [Wed, 11 Dec 2013 06:09:22 +0000 (03:09 -0300)]
upstream: [media] staging: media: davinci_vpfe: Rewrite return statement in vpfe_video.c

Rewrite the return statement in vpfe_video.c. This will prevent
the checkpatch.pl script from generating a warning saying
to remove () from this particular return statement.

Signed-off-by: Lisa Nguyen <lisa@xenapiadmin.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] staging: media: davinci_vpfe: Remove spaces before semicolons
Lisa Nguyen [Mon, 28 Oct 2013 21:23:34 +0000 (18:23 -0300)]
upstream: [media] staging: media: davinci_vpfe: Remove spaces before semicolons

Remove unnecessary spaces before semicolons to meet kernel
coding style.

Signed-off-by: Lisa Nguyen <lisa@xenapiadmin.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: of: Drop endpoint node reference in v4l2_of_get_remote_port()
Laurent Pinchart [Fri, 17 May 2013 10:31:04 +0000 (07:31 -0300)]
upstream: [media] v4l: of: Drop endpoint node reference in v4l2_of_get_remote_port()

The v4l2_of_get_remote_port() function acquires a reference to an
endpoint node through a phandle and then returns the node's parent,
without dropping the reference to the endpoint node. Fix it.

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>
9 years agoupstream: [media] v4l: of: Remove struct v4l2_of_endpoint remote field
Laurent Pinchart [Fri, 17 May 2013 10:31:04 +0000 (07:31 -0300)]
upstream: [media] v4l: of: Remove struct v4l2_of_endpoint remote field

The field isn't set when parsing the endpoint. Remove it.

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>
9 years agoupstream: [media] v4l: of: Return an int in v4l2_of_parse_endpoint()
Laurent Pinchart [Fri, 17 May 2013 10:31:04 +0000 (07:31 -0300)]
upstream: [media] v4l: of: Return an int in v4l2_of_parse_endpoint()

When CONFIG_OF is not defined the v4l2_of_parse_endpoint() function is
defined as a stub that returns -ENOSYS. Make the real function return an
integer as well to be able to differentiate between the two cases.

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>
9 years agoupstream: [media] v4l: vsp1: Add LUT support
Laurent Pinchart [Wed, 10 Jul 2013 15:03:30 +0000 (12:03 -0300)]
upstream: [media] v4l: vsp1: Add LUT support

The Look-Up Table looks up values in 8-bit indexed tables separately for
each color component.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: vsp1: Add SRU support
Laurent Pinchart [Wed, 10 Jul 2013 15:03:30 +0000 (12:03 -0300)]
upstream: [media] v4l: vsp1: Add SRU support

The Super Resolution Unit performs super resolution processing with
optional upscaling by a factor of two.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: vsp1: Add HST and HSI support
Laurent Pinchart [Wed, 10 Jul 2013 20:30:14 +0000 (17:30 -0300)]
upstream: [media] v4l: vsp1: Add HST and HSI support

The Hue Saturation value Transform and Hue Saturation value Inverse
transform entities convert from RGB to HSV and back.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: Add media format codes for AHSV8888 on 32-bit busses
Laurent Pinchart [Wed, 10 Jul 2013 15:05:06 +0000 (12:05 -0300)]
upstream: [media] v4l: Add media format codes for AHSV8888 on 32-bit busses

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: vsp1: Add cropping support
Laurent Pinchart [Sat, 24 Aug 2013 23:49:58 +0000 (20:49 -0300)]
upstream: [media] v4l: vsp1: Add cropping support

Implement the get and set selection operations on the RPF and WPF
entities. Only the crop targets are currently available.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: vsp1: Supply frames to the DU continuously
Laurent Pinchart [Tue, 15 Oct 2013 21:58:43 +0000 (18:58 -0300)]
upstream: [media] v4l: vsp1: Supply frames to the DU continuously

When operating in DU output mode (deep pipeline to the DU through the
LIF), the VSP1 needs to constantly supply frames to the display. To
ensure reuse the last queued buffer instead of returning it to the user.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] mt9v032: Add support for the MT9V034
Laurent Pinchart [Mon, 2 Dec 2013 15:01:03 +0000 (12:01 -0300)]
upstream: [media] mt9v032: Add support for the MT9V034

The MT9V034 sensor is very similar to the MT9V032, with a couple of
different registers and parameters.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] mt9v032: Add support for model-specific parameters
Laurent Pinchart [Mon, 2 Dec 2013 14:59:52 +0000 (11:59 -0300)]
upstream: [media] mt9v032: Add support for model-specific parameters

To prepare support of the MT9V034, add the necessary infrastructure to
support model-specific parameters.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] mt9v032: Add support for monochrome models
Laurent Pinchart [Wed, 4 Dec 2013 18:31:13 +0000 (15:31 -0300)]
upstream: [media] mt9v032: Add support for monochrome models

Identify the model based on the I2C device name and configure formats
accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] mt9v032: Fix binning configuration
Laurent Pinchart [Mon, 2 Dec 2013 19:39:18 +0000 (16:39 -0300)]
upstream: [media] mt9v032: Fix binning configuration

The sensor can scale the image down using binning by 1, 2 or 4 in both
directions. Update size enumeration and ratio and binning factor
computation accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] mt9v032: Fix pixel array size
Laurent Pinchart [Mon, 2 Dec 2013 14:52:44 +0000 (11:52 -0300)]
upstream: [media] mt9v032: Fix pixel array size

The active pixel array size is 753x481 with 4 additional black rows at
the top. Fix the driver accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] mt9v032: Remove unused macro
Laurent Pinchart [Mon, 2 Dec 2013 20:16:20 +0000 (17:16 -0300)]
upstream: [media] mt9v032: Remove unused macro

The EXT_CLK macro is unused, remove it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: resizer: Fix comment regarding bypass mode
Laurent Pinchart [Wed, 13 Nov 2013 22:54:32 +0000 (19:54 -0300)]
upstream: [media] v4l: omap4iss: resizer: Fix comment regarding bypass mode

The comment explaining the usage of the bypass bit is wrong, fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: Cancel streaming when a fatal error occurs
Laurent Pinchart [Tue, 5 Nov 2013 15:32:05 +0000 (12:32 -0300)]
upstream: [media] v4l: omap4iss: Cancel streaming when a fatal error occurs

When a fatal error that prevents any further video streaming occurs in a
pipeline, all queued buffers must be marked as erroneous and new buffers
must be prevented from being queued. Implement this behaviour with a new
omap4iss_pipeline_cancel_stream() function that can be used by
submodules to cancel streaming.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: csi2: Replace manual if statement with a subclk...
Laurent Pinchart [Thu, 10 Oct 2013 12:06:27 +0000 (09:06 -0300)]
upstream: [media] v4l: omap4iss: csi2: Replace manual if statement with a subclk field

Instead of manually checking whether the CSI2 module is CSI2a or CSI2b
in order to select the right subclock to enable/disable, add a subclk
field to the iss_csi2 structure, initialize it with the corresponding
subclock value and use it at runtime.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: Reset the ISS when the pipeline can't be stopped
Laurent Pinchart [Wed, 9 Oct 2013 14:52:45 +0000 (11:52 -0300)]
upstream: [media] v4l: omap4iss: Reset the ISS when the pipeline can't be stopped

When a failure to stop a module in the pipeline is detected, the only
way to recover is to reset the ISS. However, as other users can be using
a different pipeline with other modules, the ISS can't be reset
synchronously with the error detection.
Keep track of modules that have failed to stop, and reset the ISS
accordingly when the last user releases the last reference to the ISS.
Refuse to start streaming on a pipeline that contains a crashed module,
as the hardware wouldn't work anyway.
Modify the omap4iss_pipeline_set_stream() function to record the new ISS
pipeline state only when no error occurs, except when stopping the
pipeline in which case the pipeline is still marked as stopped.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: Enable/disabling the ISP interrupts globally
Laurent Pinchart [Thu, 10 Oct 2013 13:40:02 +0000 (10:40 -0300)]
upstream: [media] v4l: omap4iss: Enable/disabling the ISP interrupts globally

ISP interrupts are enabled/disabled when starting/stopping the IPIPEIF
or resizer. This doesn't permit using the two modules in separate
pipelines. Fix it by enabling/disabling the ISP interrupts at the same
time as the ISS interrupts, in the ISS device get/put operations.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: Propagate stop timeouts from submodules to the drive...
Laurent Pinchart [Wed, 9 Oct 2013 14:52:45 +0000 (11:52 -0300)]
upstream: [media] v4l: omap4iss: Propagate stop timeouts from submodules to the driver core

Return an error from the s_stream handlers when stopping the stream
failed instead of just logging the error and ignoring it. While we're
at it, move the logging code from submodules to the driver code.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: Add enum_fmt_vid_cap ioctl support
Laurent Pinchart [Fri, 12 Jul 2013 14:25:36 +0000 (11:25 -0300)]
upstream: [media] v4l: omap4iss: Add enum_fmt_vid_cap ioctl support

List the pixel formats compatible with the active format currently
configured on the connected pad.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: Make __iss_video_get_format() return a v4l2_mbus_fra...
Laurent Pinchart [Mon, 9 Sep 2013 11:20:16 +0000 (08:20 -0300)]
upstream: [media] v4l: omap4iss: Make __iss_video_get_format() return a v4l2_mbus_framefmt

The function will be used by a caller that needs the media bus format
instead of the pixel format currently returned. Move the media bus
format to pixel format conversion to the existing caller.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: Add description field to iss_format_info structure
Laurent Pinchart [Mon, 9 Sep 2013 11:19:21 +0000 (08:19 -0300)]
upstream: [media] v4l: omap4iss: Add description field to iss_format_info structure

The field stores the format description in a human-readable form.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: Convert hexadecimal constants to lower case
Laurent Pinchart [Wed, 4 Sep 2013 15:32:12 +0000 (12:32 -0300)]
upstream: [media] v4l: omap4iss: Convert hexadecimal constants to lower case

The Linux kernel recommends lower case for hexadecimal constants.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: resizer: Stop the whole resizer to avoid FIFO overflows
Laurent Pinchart [Wed, 4 Sep 2013 12:48:20 +0000 (09:48 -0300)]
upstream: [media] v4l: omap4iss: resizer: Stop the whole resizer to avoid FIFO overflows

When stopping the resizer due to a buffer underrun, disabling RZA only
produces input FIFO overflows, most probably when the next frame is
received. Disable the whole resizer to work around the problem.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: csi: Create and use register access functions
Laurent Pinchart [Sat, 31 Aug 2013 01:23:17 +0000 (22:23 -0300)]
upstream: [media] v4l: omap4iss: csi: Create and use register access functions

Replace the direct readl/writel calls with helper functions.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: Create and use register access functions
Laurent Pinchart [Sat, 31 Aug 2013 01:23:17 +0000 (22:23 -0300)]
upstream: [media] v4l: omap4iss: Create and use register access functions

Replace the direct readl/writel calls with helper functions that take an
ISS pointer and compute the register memory address. Also add bit clear,
set and update helpers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: csi2: Enable automatic ULP mode transition
Laurent Pinchart [Thu, 29 Aug 2013 11:36:22 +0000 (08:36 -0300)]
upstream: [media] v4l: omap4iss: csi2: Enable automatic ULP mode transition

Automatically switch between ULP and ON states based on ULPM signal from
complex I/O.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: ipipeif: Shift input data according to the input...
Laurent Pinchart [Fri, 30 Aug 2013 22:23:31 +0000 (19:23 -0300)]
upstream: [media] v4l: omap4iss: ipipeif: Shift input data according to the input format

Input samples must be left-aligned on the ISIF 16-bit data bus.
Configure the 16-to-16-bit selector to shift data according to the input
format.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: isif: Ignore VD0 interrupts when no buffer is available
Laurent Pinchart [Thu, 29 Aug 2013 10:40:37 +0000 (07:40 -0300)]
upstream: [media] v4l: omap4iss: isif: Ignore VD0 interrupts when no buffer is available

The ISIF generates VD0 interrupts even when writes are disabled.
Disabling the ISIF when no buffer is available is thus not be enough, we
need to handle the situation explicitly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: Fix operators precedence in ternary operators
Laurent Pinchart [Wed, 28 Aug 2013 16:40:57 +0000 (13:40 -0300)]
upstream: [media] v4l: omap4iss: Fix operators precedence in ternary operators

The ternary operator ? : has a low precedence. Use parenthesis where
needed.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: Don't make IRQ debugging functions inline
Laurent Pinchart [Wed, 28 Aug 2013 15:51:03 +0000 (12:51 -0300)]
upstream: [media] v4l: omap4iss: Don't make IRQ debugging functions inline

Let the compiler decide.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: Enhance IRQ debugging
Laurent Pinchart [Wed, 28 Aug 2013 15:48:36 +0000 (12:48 -0300)]
upstream: [media] v4l: omap4iss: Enhance IRQ debugging

Add a pretty print function for ISP IRQs and remove the _INT suffix from
interrupt names to enhance readability.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: isif: Define more VDINT registers
Laurent Pinchart [Wed, 28 Aug 2013 15:03:50 +0000 (12:03 -0300)]
upstream: [media] v4l: omap4iss: isif: Define more VDINT registers

Use a macro to get the VDINT indexed registers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: Define more ISS and ISP IRQ register bits
Laurent Pinchart [Wed, 28 Aug 2013 15:03:50 +0000 (12:03 -0300)]
upstream: [media] v4l: omap4iss: Define more ISS and ISP IRQ register bits

Add more register definitions at iss_regs.h and improve some register
names.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: Remove double semicolon at end of line
Laurent Pinchart [Wed, 4 Dec 2013 00:29:06 +0000 (21:29 -0300)]
upstream: [media] v4l: omap4iss: Remove double semicolon at end of line

Pure CodingStyle fixes.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: Restrict line lengths to 80 characters where possible
Laurent Pinchart [Wed, 4 Dec 2013 00:28:37 +0000 (21:28 -0300)]
upstream: [media] v4l: omap4iss: Restrict line lengths to 80 characters where possible

Pure CodingStyle fixes.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: Don't split log strings on multiple lines
Laurent Pinchart [Wed, 4 Dec 2013 00:26:37 +0000 (21:26 -0300)]
upstream: [media] v4l: omap4iss: Don't split log strings on multiple lines

Non-split strings help grepping for messages.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: omap4iss: Replace printk by dev_err
Laurent Pinchart [Wed, 4 Dec 2013 00:25:13 +0000 (21:25 -0300)]
upstream: [media] v4l: omap4iss: Replace printk by dev_err

dev_err is preferred over printk(KERN_ERR) when a device pointer is
available.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: ti-vpe: make sure VPDMA line stride constraints are met
Archit Taneja [Tue, 3 Dec 2013 11:51:13 +0000 (08:51 -0300)]
upstream: [media] v4l: ti-vpe: make sure VPDMA line stride constraints are met

When VPDMA fetches or writes to an image buffer, the line stride must be a
multiple of 16 bytes. If it isn't, VPDMA HW will write/fetch until the next
16 byte boundry. This causes VPE to work incorrectly for source or destination
widths which don't satisfy the above alignment requirement.
In order to prevent this, we now make sure that when we set pix format for the
input and output buffers, the VPE source and destination image line strides are
16 byte aligned. Also, the motion vector buffers for the de-interlacer are
allocated in such a way that it ensures the same alignment.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: ti-vpe: Fix the data_type value for UYVY VPDMA format
Archit Taneja [Tue, 3 Dec 2013 11:51:12 +0000 (08:51 -0300)]
upstream: [media] v4l: ti-vpe: Fix the data_type value for UYVY VPDMA format

The data_type value to be programmed in the data descriptors to fetch/write a
UYVY buffer was not mentioned correctly in the older DRA7x documentation. This
caused VPE to fail with UYVY color formats.
Update the data_type value to fix functionality when UYVY format is used.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] em28xx: add support for illumination button and LED
Frank Schaefer [Sun, 1 Dec 2013 21:06:56 +0000 (18:06 -0300)]
upstream: [media] em28xx: add support for illumination button and LED

The SpeedLink VAD Laplace webcam is equipped with an illumination button and
an illumination LED. When the button is pressed, the driver must toggle the
LED state via the corresponding GPO port.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] em28xx: prepare for supporting multiple LEDs
Frank Schaefer [Sun, 1 Dec 2013 21:06:55 +0000 (18:06 -0300)]
upstream: [media] em28xx: prepare for supporting multiple LEDs

Introduce a LED role and store all LEDs in an array.
Also provide a helper function to retrieve a specific LED.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] em28xx: add debouncing mechanism for GPI-connected buttons
Frank Schaefer [Sun, 1 Dec 2013 21:06:53 +0000 (18:06 -0300)]
upstream: [media] em28xx: add debouncing mechanism for GPI-connected buttons

So far, the driver only supports a snapshot button which is assigned to
register 0x0c bit 5. This special port has a built-in debouncing mechanism.
For buttons connected to ordinary GPI ports, this patch implements a software
debouncing mechanism.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] em28xx: extend the support for device buttons
Frank Schaefer [Sun, 1 Dec 2013 21:06:52 +0000 (18:06 -0300)]
upstream: [media] em28xx: extend the support for device buttons

The current code supports only a single snapshot button assigned to
register 0x0c bit 5. But devices may be equipped with multiple buttons
with different functionalities and they can also be assigned to the
various GPI-ports.
Extend the em28xx-input code to handle multiple buttons assigned to different
GPI-ports / register addresses and bits.
Also make easier to extend the code with further button types.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] em28xx: add support for GPO controlled analog capturing LEDs
Frank Schaefer [Sun, 1 Dec 2013 21:06:51 +0000 (18:06 -0300)]
upstream: [media] em28xx: add support for GPO controlled analog capturing LEDs

Some devices are equipped with a capturing status LED that needs to be
switched on/off explicitly via a GPO port.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>