GitHub/exynos8895/android_kernel_samsung_universal8895.git
11 years ago[media] mb86a20s: add CNR measurement
Mauro Carvalho Chehab [Wed, 16 Jan 2013 18:12:05 +0000 (15:12 -0300)]
[media] mb86a20s: add CNR measurement

Add Signal/Noise ratio measurement. On this device, a global measure
is taken by the demod. It also provides per-layer CNR measurements,
based on Modulation Error measures (MER).

Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mb86a20s: improve bit error count for BER
Mauro Carvalho Chehab [Mon, 14 Jan 2013 23:34:55 +0000 (20:34 -0300)]
[media] mb86a20s: improve bit error count for BER

Do a better job on setting the bit error counters, in order to
have all layer measures to happen in a little less than one
second.

Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mb86a20s: add BER measurement
Mauro Carvalho Chehab [Tue, 22 Jan 2013 15:30:07 +0000 (12:30 -0300)]
[media] mb86a20s: add BER measurement

Add the methods to read bit error/bit count measurements from
mb86a20s. On ISDB-T devices, those reads are done per layer.
However, as userspace applications may not be aware of that,
add a global measure that will sum the bit errors and bit
counts for each layer, storing them into a global value.

Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mb86a20s: calculate statistics at .read_status()
Mauro Carvalho Chehab [Tue, 22 Jan 2013 15:28:31 +0000 (12:28 -0300)]
[media] mb86a20s: calculate statistics at .read_status()

Instead of providing separate callbacks to read the several FE
stats properties, the better seems to use just one method that will:
    - Read lock status;
    - Read signal strength;
    - if locked, get TMCC data;
    - if locked, get DVB statistics.
As the DVB frontend thread will call this read_status callback
on every 3 seconds, and userspace can even call it earlier,
all stats data and layers layout will be updated together if
available, with is a good thing.

Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] dvb: the core logic to handle the DVBv5 QoS properties
Mauro Carvalho Chehab [Mon, 7 Jan 2013 18:41:35 +0000 (15:41 -0300)]
[media] dvb: the core logic to handle the DVBv5 QoS properties

Add the logic to poll, reset counters and report the QoS stats
to the end user.
The idea is that the core will periodically poll the frontend for
the stats. The frontend may return -EBUSY, if the previous collect
didn't finish, or it may fill the cached data.
The value returned to the end user is always the cached data.

Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] dvb: Add DVBv5 statistics properties
Mauro Carvalho Chehab [Sun, 6 Jan 2013 15:22:06 +0000 (12:22 -0300)]
[media] dvb: Add DVBv5 statistics properties

The DVBv3 statistics parameters are limited on several ways:
        - It doesn't provide any way to indicate the used measure,
  so userspace need to guess how to calculate/use it;
        - Only a limited set of stats are supported;
        - Can't be called in a way to require them to be filled
          all at once (atomic reads from the hardware), with may
          cause troubles on interpreting them on userspace;
        - On some OFDM delivery systems, the carriers can be
          independently modulated, having different properties.
          Currently, there's no way to report per-layer stats.
To address the above issues, adding a new DVBv5-based stats API.
While here, correct inner code nomenclature on a few places.

Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mb86a20s: don't use state before initializing it
Mauro Carvalho Chehab [Wed, 23 Jan 2013 15:22:22 +0000 (13:22 -0200)]
[media] mb86a20s: don't use state before initializing it

As reported by Feng's kbuild test:
From: kbuild test robot <fengguang.wu@intel.com>
Subject: drivers/media/dvb-frontends/mb86a20s.c:706 mb86a20s_attach() error: potential null dereference 'state'.  (kzalloc returns null)
Date: Wed, 23 Jan 2013 19:30:43 +0800

commit: f66d81b54dac26d4e601d4d7faca53f3bdc98427 [media] mb86a20s: convert it to use dev_info/dev_err/dev_dbg

drivers/media/dvb-frontends/mb86a20s.c:706 mb86a20s_attach() error: potential null dereference 'state'.  (kzalloc returns null)
drivers/media/dvb-frontends/mb86a20s.c:706 mb86a20s_attach() error: we previously assumed 'state' could be null (see line 705)

As, at mb86a20s_attach(), we have an i2c pointer, use it for all printk
messages there, instead of state->i2c.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mb86a20s: convert it to use dev_info/dev_err/dev_dbg
Mauro Carvalho Chehab [Tue, 22 Jan 2013 11:13:08 +0000 (09:13 -0200)]
[media] mb86a20s: convert it to use dev_info/dev_err/dev_dbg

Instead of having its own set of macros, use the Kernel default
ones for debug, error and info.

While here, do some cleanup on the debug printk's.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mb86a20s: Function reorder
Mauro Carvalho Chehab [Tue, 22 Jan 2013 10:53:11 +0000 (08:53 -0200)]
[media] mb86a20s: Function reorder

Reorder functions to have everything related to stats/status read
close. That will make the file more organized as other stats
routines will be added.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mb86a20s: Split status read logic from DVB callback
Mauro Carvalho Chehab [Tue, 22 Jan 2013 10:49:39 +0000 (08:49 -0200)]
[media] mb86a20s: Split status read logic from DVB callback

Split the logic that reads the status from the DVB callback. That
helps to properly return an error code, if status read fails.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mb86a20s: fix interleaving and FEC retrival
Mauro Carvalho Chehab [Mon, 14 Jan 2013 15:31:13 +0000 (12:31 -0300)]
[media] mb86a20s: fix interleaving and FEC retrival

Get the proper bits from the TMCC table registers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mb86a20s: make AGC work better
Mauro Carvalho Chehab [Mon, 14 Jan 2013 17:12:10 +0000 (14:12 -0300)]
[media] mb86a20s: make AGC work better

It is recommented to change register 0x0440 value to 0, in order
to fix some AGC bug.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mb86a20s: Fix i2c gate on error
Mauro Carvalho Chehab [Mon, 14 Jan 2013 13:16:07 +0000 (10:16 -0300)]
[media] mb86a20s: Fix i2c gate on error

If an error happens, restore tuner I2C gate to the right
value.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mb86a20s: improve error handling at get_frontend
Mauro Carvalho Chehab [Mon, 14 Jan 2013 12:26:09 +0000 (09:26 -0300)]
[media] mb86a20s: improve error handling at get_frontend

The read/write errors are not handled well on get_frontend. Fix it,
by letting the frontend cached values to represent the DVB properties
that were successfully retrieved.
While here, use "c" for dtv_frontend_properties cache, instead of
"p", as this is more common.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] media: remove __dev* annotations
Stephen Rothwell [Fri, 11 Jan 2013 00:35:34 +0000 (21:35 -0300)]
[media] media: remove __dev* annotations

Hi Mauro,
After merging the v4l-dvb tree, today's linux-next build (x86_64
allmodconfig) failed like this:
drivers/media/platform/sh_veu.c:1146:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sh_veu_probe'
drivers/media/platform/sh_veu.c:1228:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sh_veu_remove'
drivers/media/platform/sh_veu.c:1244:2: error: implicit declaration of function '__devexit_p' [-Werror=implicit-function-declaration]
drivers/media/platform/sh_veu.c:1244:25: error: 'sh_veu_remove' undeclared here (not in a function)
drivers/media/platform/sh_veu.c: In function 'sh_veu_init':
drivers/media/platform/sh_veu.c:1253:45: error: 'sh_veu_probe' undeclared (first use in this function)
drivers/media/platform/sh_veu.c:1253:45: note: each undeclared identifier is reported only once for each function it appears in
drivers/media/platform/sh_veu.c: At top level:
drivers/media/platform/sh_veu.c:1095:20: warning: 'sh_veu_bh' defined but not used [-Wunused-function]
drivers/media/platform/sh_veu.c:1109:20: warning: 'sh_veu_isr' defined but not used [-Wunused-function]
drivers/media/platform/sh_veu.c: In function 'sh_veu_init':
drivers/media/platform/sh_veu.c:1254:1: warning: control reaches end of non-void function [-Wreturn-type]
Caused by commit 05efa71bdc0e ("[media] media: add a VEU MEM2MEM format
conversion and scaling driver") interacting with commit 54b956b90360
("Remove __dev* markings from init.h") from the driver-core.current tree.
I have applied the following merge fix patch which could be applied
directly to the v4l-dvb tree (please):
CONFIG_HOTPLUG is always true now and the __dev* macros have meen removed.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] extract_xc3028.pl: fix permissions
Mauro Carvalho Chehab [Fri, 11 Jan 2013 15:01:37 +0000 (13:01 -0200)]
[media] extract_xc3028.pl: fix permissions

This is an executable file. Change permissions to reflect it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] stv0900: Multistream support
Evgeny Plehov [Thu, 29 Nov 2012 18:27:38 +0000 (15:27 -0300)]
[media] stv0900: Multistream support

Multistream support for stv0900. For Netup Dual S2 CI with STV0900BAC/AAC.

Signed-off-by: Evgeny Plehov <EvgenyPlehov@ukr.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] omap_vout: find_vma() needs ->mmap_sem held
Al Viro [Sun, 16 Dec 2012 19:04:46 +0000 (16:04 -0300)]
[media] omap_vout: find_vma() needs ->mmap_sem held

Walking rbtree while it's modified is a Bad Idea(tm); besides,
the result of find_vma() can be freed just as it's getting returned
to caller.  Fortunately, it's easy to fix - just take ->mmap_sem a bit
earlier (and don't bother with find_vma() at all if virtp >= PAGE_OFFSET -
in that case we don't even look at its result).

While we are at it, what prevents VIDIOC_PREPARE_BUF calling
v4l_prepare_buf() -> (e.g) vb2_ioctl_prepare_buf() -> vb2_prepare_buf() ->
__buf_prepare() -> __qbuf_userptr() -> vb2_vmalloc_get_userptr() -> find_vma(),
AFAICS without having taken ->mmap_sem anywhere in process?  The code flow
is bloody convoluted and depends on a bunch of things done by initialization,
so I certainly might've missed something...

Cc: stable@vger.kernel.org [2.6.35]
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Archit Taneja <archit@ti.com>
Cc: Prabhakar Lad <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] ts2020: call get_rf_strength from frontend
Malcolm Priestley [Sun, 6 Jan 2013 11:40:42 +0000 (08:40 -0300)]
[media] ts2020: call get_rf_strength from frontend

Restore ds3000.c read_signal_strength.
Call tuner get_rf_strength from frontend read_signal_strength.
We are able to do a NULL check and doesn't limit the tuner
attach to the frontend attach area.
At the moment the lmedm04 tuner attach is stuck in frontend
attach area.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] v4l: Don't compile v4l2-int-device unless really needed
Sakari Ailus [Sat, 5 Jan 2013 21:56:10 +0000 (18:56 -0300)]
[media] v4l: Don't compile v4l2-int-device unless really needed

Add a configuration option for v4l2-int-device so it is only compiled when
necessary, which is only by omap24xxcam and tcm825x drivers.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: fix audio input for TV mode of device Terratec Cinergy 250
Frank Schaefer [Sat, 5 Jan 2013 11:44:09 +0000 (08:44 -0300)]
[media] em28xx: fix audio input for TV mode of device Terratec Cinergy 250

Remy Blank reported that audio over USB can be made working for the television
input if .amux is changed from EM28XX_AMUX_LINE_IN to EM28XX_AMUX_VIDEO.
An examination of his devices shows, that it is indeed supplied with an EM202
AC97 audio IC. We also use this setting for the Cinergy 200.
Remy Blank also provided the original version of this patch (many thanks !).
Fixes bug 14126 (see bug report for further device details).

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Remy Blank <remy.blank@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] dvb: unlock on error in dvb_ca_en50221_io_do_ioctl()
Dan Carpenter [Fri, 4 Jan 2013 17:56:02 +0000 (14:56 -0300)]
[media] dvb: unlock on error in dvb_ca_en50221_io_do_ioctl()

We recently pushed the locking down into this function, but there was
an error path where the unlock was missed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] ts2020.c: ts2020_set_params [BUG] point to fe->tuner_priv
Malcolm Priestley [Thu, 3 Jan 2013 19:37:25 +0000 (16:37 -0300)]
[media] ts2020.c: ts2020_set_params [BUG] point to fe->tuner_priv

Fixes corruption of fe->demodulator_priv

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] dib0700: do not lock interruptible on tear-down paths
Jiri Slaby [Thu, 3 Jan 2013 15:53:53 +0000 (12:53 -0300)]
[media] dib0700: do not lock interruptible on tear-down paths

When mutex_lock_interruptible is used on paths where a signal can be
pending, the device is not closed properly and cannot be reused.
This usually happens when you start tzap for example and send it a
TERM signal. The signal is pending while tear-down routines are
called. Hence streaming is not properly stopped in that case. And
the device stops working from that moment on.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-fimc: Fix typo of URL pointing to Media Controller API's
Prabhakar Lad [Wed, 2 Jan 2013 05:08:15 +0000 (02:08 -0300)]
[media] s5p-fimc: Fix typo of URL pointing to Media Controller API's

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] rtl28xxu: correct some device names
Antti Palosaari [Fri, 4 Jan 2013 21:35:00 +0000 (18:35 -0300)]
[media] rtl28xxu: correct some device names

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] rtl28xxu: add Gigabyte U7300 DVB-T Dongle
Alexander Inyukhin [Fri, 4 Jan 2013 21:19:02 +0000 (18:19 -0300)]
[media] rtl28xxu: add Gigabyte U7300 DVB-T Dongle

Device with ID 1b80:d393 is the Gigabyte U7300 DVB-T dongle.
It contains decoder Realtek RTL2832U and tuner Fitipower FC0012.

[crope@iki.fi: fix trivial merge conflict]
Signed-off-by: Alexander Inyukhin <shurick@sectorb.msk.ru>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] rtl28xxu: [1b80:d3a8] ASUS My Cinema-U3100Mini Plus V2
Antti Palosaari [Sun, 16 Dec 2012 14:47:07 +0000 (11:47 -0300)]
[media] rtl28xxu: [1b80:d3a8] ASUS My Cinema-U3100Mini Plus V2

RF-tuner is Fitipower FC0013

Reported-by: Renato Gallo <renatogallo@unixproducts.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] dvb_usb_v2: use IS_ENABLED() macro
Antti Palosaari [Fri, 4 Jan 2013 18:21:26 +0000 (15:21 -0300)]
[media] dvb_usb_v2: use IS_ENABLED() macro

replace:
 #if defined(CONFIG_RC_CORE) || defined(CONFIG_RC_CORE_MODULE)
with:
 #if IS_ENABLED(CONFIG_RC_CORE)

Reported-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] dvb_usb_v2: change rc polling active/deactive logic
Antti Palosaari [Mon, 10 Dec 2012 00:23:30 +0000 (21:23 -0300)]
[media] dvb_usb_v2: change rc polling active/deactive logic

Use own flag to mark when rc polling is active/deactive and make
decisions, like start/stop polling on suspend/resume, against that.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] dvb_usb_v2: use dummy function defines instead stub functions
Antti Palosaari [Sun, 9 Dec 2012 23:46:46 +0000 (20:46 -0300)]
[media] dvb_usb_v2: use dummy function defines instead stub functions

I think it is better (cheaper) to use dummy defines for functions
that has no meaning when remote controller is disabled by Kconfig.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] dvb_usb_v2: remove rc-core stub implementations
Antti Palosaari [Sun, 9 Dec 2012 23:41:49 +0000 (20:41 -0300)]
[media] dvb_usb_v2: remove rc-core stub implementations

Those are not needed anymore as all dvb-usb-v2 drivers has proper
dependency checks for RC-core.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] it913x: remove unused define and increase module version
Antti Palosaari [Sun, 9 Dec 2012 23:32:09 +0000 (20:32 -0300)]
[media] it913x: remove unused define and increase module version

Signed-off-by: Antti Palosaari <crope@iki.fi>
Acked-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] it913x: make remote controller optional
Antti Palosaari [Sun, 9 Dec 2012 23:27:59 +0000 (20:27 -0300)]
[media] it913x: make remote controller optional

Do not compile remote controller when RC-core is disabled by Kconfig.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] az6007: make remote controller optional
Antti Palosaari [Sun, 9 Dec 2012 23:23:22 +0000 (20:23 -0300)]
[media] az6007: make remote controller optional

Do not compile remote controller when RC-core is disabled by Kconfig.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] af9035: make remote controller optional
Antti Palosaari [Sun, 9 Dec 2012 23:18:31 +0000 (20:18 -0300)]
[media] af9035: make remote controller optional

Do not compile remote controller when RC-core is disabled by Kconfig.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] af9015: make remote controller optional
Antti Palosaari [Sun, 9 Dec 2012 23:15:47 +0000 (20:15 -0300)]
[media] af9015: make remote controller optional

Do not compile remote controller when RC-core is disabled by Kconfig.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] anysee: make remote controller optional
Antti Palosaari [Sun, 9 Dec 2012 23:12:07 +0000 (20:12 -0300)]
[media] anysee: make remote controller optional

Do not compile remote controller when RC-core is disabled by Kconfig.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] rtl28xxu: make remote controller optional
Antti Palosaari [Sun, 9 Dec 2012 23:06:00 +0000 (20:06 -0300)]
[media] rtl28xxu: make remote controller optional

Do not compile remote controller when RC-core is disabled by Kconfig.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] dvb_usb_v2: make remote controller optional
Antti Palosaari [Thu, 29 Nov 2012 03:05:35 +0000 (00:05 -0300)]
[media] dvb_usb_v2: make remote controller optional

Make it possible to compile dvb_usb_v2 driver without the remote
controller (RC-core).

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] V4L: Remove deprecated image centering controls
Sylwester Nawrocki [Thu, 3 Jan 2013 15:30:30 +0000 (12:30 -0300)]
[media] V4L: Remove deprecated image centering controls

It has been over 3 years since the V4L2_CID_[HV]CENTER were deprecated.
Clean up the DocBook and remove the V4L2_CID_VCENTER_DEPRECATED,
V4L2_CID_VCENTER_DEPRECATED control related paragraphs.
Remove the V4L2_CID_[HV]CENTER controls definitions from v4l2-controls.h,
these controls are not used by any driver in the mainline now.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-mfc: Context handling in open() bugfix
Kamil Debski [Thu, 22 Nov 2012 13:00:28 +0000 (10:00 -0300)]
[media] s5p-mfc: Context handling in open() bugfix

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-mfc: Change internal buffer allocation from vb2 ops to dma_alloc_coherent
Kamil Debski [Thu, 3 Jan 2013 10:06:04 +0000 (07:06 -0300)]
[media] s5p-mfc: Change internal buffer allocation from vb2 ops to dma_alloc_coherent

Change internal buffer allocation from vb2 memory ops call to direct
calls of dma_alloc_coherent. This change shortens the code and makes it
much more readable.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-mfc: Correct check of vb2_dma_contig_init_ctx return value
Kamil Debski [Thu, 3 Jan 2013 10:06:03 +0000 (07:06 -0300)]
[media] s5p-mfc: Correct check of vb2_dma_contig_init_ctx return value

vb2_dma_contig_init_ctx returns an error if failed, NULL check is not necessary.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-mfc: Move firmware allocation point to avoid allocation problems
Kamil Debski [Thu, 3 Jan 2013 14:02:07 +0000 (11:02 -0300)]
[media] s5p-mfc: Move firmware allocation point to avoid allocation problems

Move firmware allocation from open to probe to avoid problems
when using CMA for allocation. In certain circumstances CMA may allocate
buffer that is not in the beginning of the MFC memory area.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-mfc: Fix an error check
Sachin Kamat [Wed, 2 Jan 2013 09:45:49 +0000 (06:45 -0300)]
[media] s5p-mfc: Fix an error check

Checking unsigned variable for negative value always returns false.
Hence make this value signed as we expect it to be negative too.
Fixes the following smatch warning:
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:572
s5p_mfc_set_enc_ref_buffer_v6() warn: unsigned 'buf_size1' is never
less than zero.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-mfc: Fix a typo in error message in s5p_mfc_pm.c
Sachin Kamat [Wed, 2 Jan 2013 08:13:33 +0000 (05:13 -0300)]
[media] s5p-mfc: Fix a typo in error message in s5p_mfc_pm.c

Fixed a trivial typo.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-mfc: Remove redundant 'break'
Sachin Kamat [Fri, 28 Dec 2012 09:18:27 +0000 (06:18 -0300)]
[media] s5p-mfc: Remove redundant 'break'

The code returns before this statement. Hence not required.
Silences the following smatch message:
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c:525
s5p_mfc_set_dec_frame_buffer_v5() info: ignoring unreachable code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-mfc: Flush DPB buffers during stream off
Arun Kumar K [Thu, 22 Nov 2012 09:15:55 +0000 (06:15 -0300)]
[media] s5p-mfc: Flush DPB buffers during stream off

Flushing of delay DPB buffers have to be done during stream off.
In MFC v6, it is done with a risc to host command.

Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Arun Mankuzhi <arun.m@samsung.com>
Acked-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-mfc: remove unused variable
Wei Yongjun [Sun, 2 Dec 2012 11:17:08 +0000 (08:17 -0300)]
[media] s5p-mfc: remove unused variable

The variable index is initialized but never used
otherwise, so remove the unused variable.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-mfc: Add device tree support
Arun Kumar K [Thu, 25 Oct 2012 08:24:14 +0000 (05:24 -0300)]
[media] s5p-mfc: Add device tree support

This patch will add the device tree support for MFC driver.

Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Acked-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] exynos-gsc: Support dmabuf export buffer
Shaik Ameer Basha [Fri, 7 Dec 2012 11:28:55 +0000 (08:28 -0300)]
[media] exynos-gsc: Support dmabuf export buffer

This patch adds the dmabuf export buffer feature to the
Exynos G-Scaler driver.

Signed-off-by: Shaik Ameer Basha <shaik.ameer@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-g2d: Fix incorrect usage of IS_ERR_OR_NULL
Tony Prisk [Tue, 18 Dec 2012 08:28:41 +0000 (05:28 -0300)]
[media] s5p-g2d: Fix incorrect usage of IS_ERR_OR_NULL

Replace IS_ERR_OR_NULL with IS_ERR on clk_get results.

Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-tv: Add missing braces around sizeof in hdmi_drv.c
Sachin Kamat [Mon, 26 Nov 2012 04:49:05 +0000 (01:49 -0300)]
[media] s5p-tv: Add missing braces around sizeof in hdmi_drv.c

Fixes the following checkpatch warnings:
WARNING: sizeof *fmt should be sizeof(*fmt)
WARNING: sizeof *res should be sizeof(*res)
WARNING: sizeof *res should be sizeof(*res)
WARNING: sizeof sd->name should be sizeof(sd->name)

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-tv: Add missing braces around sizeof in hdmiphy_drv.c
Sachin Kamat [Mon, 26 Nov 2012 04:49:04 +0000 (01:49 -0300)]
[media] s5p-tv: Add missing braces around sizeof in hdmiphy_drv.c

Fixes the following checkpatch warning:
WARNING: sizeof *ctx should be sizeof(*ctx)
FILE: media/platform/s5p-tv/hdmiphy_drv.c:287:
ctx = kzalloc(sizeof *ctx, GFP_KERNEL);

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-tv: Add missing braces around sizeof in mixer_drv.c
Sachin Kamat [Mon, 26 Nov 2012 04:49:03 +0000 (01:49 -0300)]
[media] s5p-tv: Add missing braces around sizeof in mixer_drv.c

Silences checkpatch warnings of type:
WARNING: sizeof mdev->res should be sizeof(mdev->res)
FILE: media/platform/s5p-tv/mixer_drv.c:301:
memset(&mdev->res, 0, sizeof mdev->res);
WARNING: sizeof *mdev should be sizeof(*mdev)
FILE: media/platform/s5p-tv/mixer_drv.c:385:
mdev = kzalloc(sizeof *mdev, GFP_KERNEL);

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-tv: Add missing braces around sizeof in mixer_reg.c
Sachin Kamat [Mon, 26 Nov 2012 04:49:02 +0000 (01:49 -0300)]
[media] s5p-tv: Add missing braces around sizeof in mixer_reg.c

Silences checkpatch warnings of the type:
WARNING: sizeof filter_y_horiz_tap8 should be sizeof(filter_y_horiz_tap8)
FILE: media/platform/s5p-tv/mixer_reg.c:473:
filter_y_horiz_tap8, sizeof filter_y_horiz_tap8);

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-tv: Add missing braces around sizeof in mixer_video.c
Sachin Kamat [Mon, 26 Nov 2012 04:49:01 +0000 (01:49 -0300)]
[media] s5p-tv: Add missing braces around sizeof in mixer_video.c

Silences several checkpatch warnings of the type:
WARNING: sizeof *out should be sizeof(*out)
FILE: media/platform/s5p-tv/mixer_video.c:98:
out = kzalloc(sizeof *out, GFP_KERNEL);

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-tv: Add missing braces around sizeof in sdo_drv.c
Sachin Kamat [Mon, 26 Nov 2012 04:49:00 +0000 (01:49 -0300)]
[media] s5p-tv: Add missing braces around sizeof in sdo_drv.c

Silences the following checkpatch warnings:
WARNING: sizeof *sdev should be sizeof(*sdev)
FILE: media/platform/s5p-tv/sdo_drv.c:304:
sdev = devm_kzalloc(&pdev->dev, sizeof *sdev, GFP_KERNEL);
WARNING: sizeof sdev->sd.name should be sizeof(sdev->sd.name)
FILE: media/platform/s5p-tv/sdo_drv.c:394:
strlcpy(sdev->sd.name, "s5p-sdo", sizeof sdev->sd.name);

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-tv: Fix incorrect usage of IS_ERR_OR_NULL
Tony Prisk [Tue, 18 Dec 2012 07:28:39 +0000 (04:28 -0300)]
[media] s5p-tv: Fix incorrect usage of IS_ERR_OR_NULL

Replace IS_ERR_OR_NULL with IS_ERR on clk_get results.

Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-tv: Fix return value in sdo_probe() on error paths
Sylwester Nawrocki [Mon, 24 Sep 2012 09:00:37 +0000 (06:00 -0300)]
[media] s5p-tv: Fix return value in sdo_probe() on error paths

Use proper return value test for clk_get() and devm_regulator_get()
functions and propagate any errors from the clock and the regulator
subsystem to the driver core. In two cases a proper error code is
now returned rather than 0.

Reported-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-fimc: Prevent AB-BA deadlock during links reconfiguration
Sylwester Nawrocki [Thu, 6 Dec 2012 13:26:19 +0000 (10:26 -0300)]
[media] s5p-fimc: Prevent AB-BA deadlock during links reconfiguration

This patch patch eliminates potential AB-BA deadlock when one process calls
open(), or VIDIOC_S/TRY_FMT ioctl  on the FIMC capture video node, while
other thread is reconfiguring media links via media device node:
/dev/video? open()   /dev/media? MEDIA_IOC_SETUP_LINK ioctl
mutex_lock(video_lock)            mutex_lock(graph_lock)
    fimc_pipeline_open()               fimc_md_link_notify()
        mutex_lock(graph_lock)           mutex_lock(video_lock)
          ...                               ...
The deadlock is avoided by always taking the graph mutex first in video
node open() or an ioctl, before the video lock is acquired. Reversed
order seems impossible, since media device driver's link_notify callback
is called with media graph mutex already held.
To ensure proper locking order VIDIOC_S_FMT and VIDIOC_TRY_FMT ioctls are
not serialized in the v4l2-core and the driver takes care of it itself.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-fimc: Fix incorrect usage of IS_ERR_OR_NULL
Tony Prisk [Tue, 18 Dec 2012 08:28:40 +0000 (05:28 -0300)]
[media] s5p-fimc: Fix incorrect usage of IS_ERR_OR_NULL

Replace IS_ERR_OR_NULL with IS_ERR on clk_get results.

Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-fimc: Prevent potential buffer overflow
Sylwester Nawrocki [Wed, 5 Dec 2012 16:40:04 +0000 (13:40 -0300)]
[media] s5p-fimc: Prevent potential buffer overflow

Replace the hard coded csi_sensors[] array size with a relevant
constant to make sure we don't iterate beyond the actual array.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] s5p-fimc: Avoid possible NULL pointer dereference in set_fmt op
Sylwester Nawrocki [Wed, 5 Dec 2012 16:52:00 +0000 (13:52 -0300)]
[media] s5p-fimc: Avoid possible NULL pointer dereference in set_fmt op

This fixes following issue found with a static analysis tool:
Pointer 'ffmt' returned from call to function 'fimc_capture_try_format'
at line 1522 may be NULL and may be dereferenced at line 1535.
Although it shouldn't happen in practice, add the NULL pointer check
to be on the safe side.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] af9035: print warning when firmware is bad
Antti Palosaari [Sun, 9 Dec 2012 19:25:08 +0000 (16:25 -0300)]
[media] af9035: print warning when firmware is bad

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] af9033: update fc2580 init sequence
Antti Palosaari [Sun, 9 Dec 2012 19:07:05 +0000 (16:07 -0300)]
[media] af9033: update fc2580 init sequence

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] af9033: update fc0011 init sequence
Antti Palosaari [Sun, 9 Dec 2012 18:45:26 +0000 (15:45 -0300)]
[media] af9033: update fc0011 init sequence

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] af9033: update tua9001 init sequence
Antti Palosaari [Sun, 9 Dec 2012 18:38:03 +0000 (15:38 -0300)]
[media] af9033: update tua9001 init sequence

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] af9033: update demod init sequence
Antti Palosaari [Sun, 9 Dec 2012 17:46:45 +0000 (14:46 -0300)]
[media] af9033: update demod init sequence

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] fc0012: remove unused callback and correct one comment
Antti Palosaari [Sun, 9 Dec 2012 16:45:42 +0000 (13:45 -0300)]
[media] fc0012: remove unused callback and correct one comment

There is no need to keep dummy sleep() callback implementation as
DVB-core checks existence of it before calls callback. Due to that
we can remove it.
FC0012 is based of direct-conversion receiver architecture
(aka Zero-IF) where is no IF used. Due to that IF is always 0 Hz.
Fix comment to point that.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Acked-by: Hans-Frieder Vogt <hfvogt@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] fc0012: use Kernel dev_foo() logging
Antti Palosaari [Sun, 9 Dec 2012 16:42:25 +0000 (13:42 -0300)]
[media] fc0012: use Kernel dev_foo() logging

Signed-off-by: Antti Palosaari <crope@iki.fi>
Acked-by: Hans-Frieder Vogt <hfvogt@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] fc0012: rework attach() to check chip id and I/O errors
Antti Palosaari [Sun, 9 Dec 2012 16:28:45 +0000 (13:28 -0300)]
[media] fc0012: rework attach() to check chip id and I/O errors

Signed-off-by: Antti Palosaari <crope@iki.fi>
Acked-by: Hans-Frieder Vogt <hfvogt@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] fc0012: use config directly from the config struct
Antti Palosaari [Sun, 9 Dec 2012 15:33:04 +0000 (12:33 -0300)]
[media] fc0012: use config directly from the config struct

No need to copy config to the driver state. Those are coming from
the const struct and could be used directly.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Acked-by: Hans-Frieder Vogt <hfvogt@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] af9035: add support for fc0012 dual tuner configuration
Antti Palosaari [Sun, 9 Dec 2012 15:01:41 +0000 (12:01 -0300)]
[media] af9035: add support for fc0012 dual tuner configuration

That adds support for AF9035 dual devices having FC0012 tuners.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] fc0012: enable clock output on attach()
Antti Palosaari [Sun, 9 Dec 2012 14:46:40 +0000 (11:46 -0300)]
[media] fc0012: enable clock output on attach()

We need feed clock to slave demodulator at the very beginning
in case of dual tuner configuration.
I am not sure if that configuration changes clock output divider
or enable clock output itself...

Signed-off-by: Antti Palosaari <crope@iki.fi>
Acked-by: Hans-Frieder Vogt <hfvogt@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] fc0012: add RF loop through
Antti Palosaari [Sun, 9 Dec 2012 03:30:08 +0000 (00:30 -0300)]
[media] fc0012: add RF loop through

Signed-off-by: Antti Palosaari <crope@iki.fi>
Acked-by: Hans-Frieder Vogt <hfvogt@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] fc0012: use struct for driver config
Antti Palosaari [Sun, 9 Dec 2012 02:27:49 +0000 (23:27 -0300)]
[media] fc0012: use struct for driver config

I need even more configuration options and overloading dvb_attach()
for all those sounds quite stupid. Due to that switch struct and make
room for new options.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Acked-by: Hans-Frieder Vogt <hfvogt@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] af9035: dual mode related changes
Antti Palosaari [Sun, 9 Dec 2012 01:51:19 +0000 (22:51 -0300)]
[media] af9035: dual mode related changes

Various small changes and fixes releated to dual mode.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] af9035: dual mode support
Jose Alberto Reguero [Sun, 23 Sep 2012 19:48:47 +0000 (16:48 -0300)]
[media] af9035: dual mode support

Adds initial support for af9035 dual mode designs.

Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net>
[crope@iki.fi: fix merge conflict]
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] af9035: support for Fitipower FC0012 tuner devices
Antti Palosaari [Sun, 2 Dec 2012 23:12:29 +0000 (20:12 -0300)]
[media] af9035: support for Fitipower FC0012 tuner devices

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] af9033: add support for Fitipower FC0012 tuner
Antti Palosaari [Sun, 2 Dec 2012 21:47:00 +0000 (18:47 -0300)]
[media] af9033: add support for Fitipower FC0012 tuner

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: enable DMABUF
Mauro Carvalho Chehab [Sun, 6 Jan 2013 02:34:22 +0000 (00:34 -0200)]
[media] em28xx: enable DMABUF

Now that it uses videobuf2, em28xx can support DMABUF.

Tested with an HVR-950 on analog mode and a 2gen i5core machine
with an i915 graphics adapter.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] ngene: fix commit 36a495a336c3fbbb2f4eeed2a94ab6d5be19d186
Mauro Carvalho Chehab [Sat, 5 Jan 2013 04:03:14 +0000 (02:03 -0200)]
[media] ngene: fix commit 36a495a336c3fbbb2f4eeed2a94ab6d5be19d186

The above commit were applied only partially; it broke tuner and
demod attach, but the part that added it to ngene_info was missing.

Not sure what happened there, but, without this patch, a regression
would be happening.

Also, gcc complains about a defined but not used symbol.

So, apply manually the missing part.

Cc: Patrice Chotard <patricechotard@free.fr>
Cc: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mx2_camera: Convert it to platform driver
Fabio Estevam [Fri, 30 Nov 2012 15:06:21 +0000 (12:06 -0300)]
[media] mx2_camera: Convert it to platform driver

Converting it to platform code can make the code smaller.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mx2_camera: Remove buffer states
Javier Martin [Tue, 30 Oct 2012 14:29:02 +0000 (11:29 -0300)]
[media] mx2_camera: Remove buffer states

After removing i.mx25 support and buf_cleanup() callback,
buffer states are not used in the code any longer.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mx2_camera: Remove 'buf_cleanup' callback
Javier Martin [Tue, 30 Oct 2012 14:29:01 +0000 (11:29 -0300)]
[media] mx2_camera: Remove 'buf_cleanup' callback

All necessary tasks to end the streaming properly are
already implemented in mx2_stop_streaming() and nothing
remains to be done in this callback.
Furthermore, it only included debug messages so it can
be removed.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mx2_camera: Remove i.mx25 support
Javier Martin [Tue, 30 Oct 2012 14:28:59 +0000 (11:28 -0300)]
[media] mx2_camera: Remove i.mx25 support

i.MX25 support has been broken for several releases
now and nobody seems to care about it.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
[g.liakhovetski@gmx.de: rebased on top of cpu_is_mx27() removal]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] soc-camera: use devm_kzalloc in subdevice drivers
Guennadi Liakhovetski [Fri, 21 Dec 2012 13:28:43 +0000 (10:28 -0300)]
[media] soc-camera: use devm_kzalloc in subdevice drivers

I2C drivers can use devm_kzalloc() too in their .probe() methods. Doing so
simplifies their clean up paths.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] soc-camera: split struct soc_camera_link into host and subdevice parts
Guennadi Liakhovetski [Fri, 21 Dec 2012 11:11:48 +0000 (08:11 -0300)]
[media] soc-camera: split struct soc_camera_link into host and subdevice parts

struct soc_camera_link currently contains fields, used both by sensor and
bridge drivers. To make subdevice driver re-use simpler, split it into a
host and a subdevice parts.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] soc-camera: remove struct soc_camera_device::video_lock
Guennadi Liakhovetski [Mon, 24 Dec 2012 12:31:33 +0000 (09:31 -0300)]
[media] soc-camera: remove struct soc_camera_device::video_lock

Currently soc-camera has a per-device node lock, used for video operations
and a per-host lock for code paths, modifying host's pipeline. Manipulating
the two locks increases complexity and doesn't bring any advantages. This
patch removes the per-device lock and uses the per-host lock for all
operations.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] soc-camera: fix repeated regulator requesting
Guennadi Liakhovetski [Thu, 3 Jan 2013 14:21:02 +0000 (11:21 -0300)]
[media] soc-camera: fix repeated regulator requesting

Currently devm_regulator_bulk_get() is called by soc-camera during host
driver probing, but regulators are attached to the camera platform
device, that is staying, independent whether the host probed successfully
or not. This can lead to repeated regulator requesting, if the host
driver is re-probed. Move the call to platform device probing to avoid
this.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] soc-camera: properly fix camera probing races
Guennadi Liakhovetski [Thu, 20 Dec 2012 16:02:51 +0000 (13:02 -0300)]
[media] soc-camera: properly fix camera probing races

The recently introduced host_lock causes lockdep warnings, besides, list
enumeration in scan_add_host() must be protected by holdint the list_lock.
OTOH, holding .video_lock in soc_camera_open() isn't enough to protect
the host during its building of the pipeline, because .video_lock is per
soc-camera device. If, e.g. more than one sensor can be attached to a host
and the user tries to open both device nodes simultaneously, host's .add()
method can be called simultaneously for both sensors. Fix these problems
by holding list_lock instead of .host_lock in scan_add_host() and taking
it shortly at the beginning of soc_camera_open(), and using .host_lock to
protect host's .add() and .remove() operations only.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mt9v022: fix potential NULL pointer dereference in mt9v022_probe()
Wei Yongjun [Thu, 29 Nov 2012 02:56:15 +0000 (23:56 -0300)]
[media] mt9v022: fix potential NULL pointer dereference in mt9v022_probe()

The dereference to 'icl' should be moved below the NULL test.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: declare em28xx_stop_streaming as static
Mauro Carvalho Chehab [Sat, 5 Jan 2013 03:27:21 +0000 (01:27 -0200)]
[media] em28xx: declare em28xx_stop_streaming as static

That fixes the following warning:
drivers/media/usb/em28xx/em28xx-video.c:611:5: warning: no previous prototype for 'em28xx_stop_streaming' [-Wmissing-prototypes]

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] v4l: Reset subdev v4l2_dev field to NULL if registration fails
Laurent Pinchart [Sun, 25 Nov 2012 00:35:48 +0000 (21:35 -0300)]
[media] v4l: Reset subdev v4l2_dev field to NULL if registration fails

When subdev registration fails the subdev v4l2_dev field is left to a
non-NULL value. Later calls to v4l2_device_unregister_subdev() will
consider the subdev as registered and will module_put() the subdev
module without any matching module_get().
Fix this by setting the subdev v4l2_dev field to NULL in
v4l2_device_register_subdev() when the function fails.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable@vger.kernel.org
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: consider the message length limitation of the i2c adapter when readin...
Frank Schaefer [Thu, 3 Jan 2013 17:27:06 +0000 (14:27 -0300)]
[media] em28xx: consider the message length limitation of the i2c adapter when reading the eeprom

EEPROMs are currently read in blocks of 16 bytes, but the em2800 is limited
to 4 bytes per read. All other chip variants support reading of max. 64 bytes
at once (according to the em258x datasheet; also verified with em2710, em2882,
and em28174).
Since em2800_i2c_recv_bytes() has been fixed to return with -EOPNOTSUPP when
more than 4 bytes are requested, EEPROM reading with this chip is broken.
It was actually broken before that change, too, it just didn't throw an error
because the i2c adapter silently returned trash data (for all reads >1 byte !).

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: fix+improve+unify i2c error handling, debug messages and code comments
Frank Schaefer [Thu, 3 Jan 2013 17:27:05 +0000 (14:27 -0300)]
[media] em28xx: fix+improve+unify i2c error handling, debug messages and code comments

- do not pass USB specific error codes to userspace/i2c-subsystem
- unify the returned error codes and make them compliant with
  the i2c subsystem spec
- check number of actually transferred bytes (via USB) everywehere
- fix/improve debug messages
- improve code comments

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: fix the i2c adapter functionality flags
Frank Schaefer [Thu, 3 Jan 2013 17:27:04 +0000 (14:27 -0300)]
[media] em28xx: fix the i2c adapter functionality flags

I2C_FUNC_SMBUS_EMUL includes flag I2C_FUNC_SMBUS_WRITE_BLOCK_DATA which signals
that up to 31 data bytes can be written to the ic2 client.
But the EM2800 supports only i2c messages with max. 4 data bytes.
I2C_FUNC_IC2 should be set if a master_xfer function pointer is provided in
struct i2c_algorithm.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: fix two severe bugs in function em2800_i2c_recv_bytes()
Frank Schaefer [Thu, 3 Jan 2013 17:27:03 +0000 (14:27 -0300)]
[media] em28xx: fix two severe bugs in function em2800_i2c_recv_bytes()

Function em2800_i2c_recv_bytes() has 2 severe bugs:
1) It does not wait for the i2c read to complete before reading the received message content from the bridge registers.
2) Reading more than 1 byte doesn't work
The former can result in data corruption, the latter always does.
The rewritten code also superseds the content of function
em2800_i2c_check_for_device().
Tested with device "Terratec Cinergy 200 USB".

[mchehab@redhat.com: Fix CodingStyle issues]
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>