cascardo/linux.git
9 years ago[media] DocBook media: fix typos in YUV420M description
Hans Verkuil [Tue, 3 Mar 2015 08:47:29 +0000 (05:47 -0300)]
[media] DocBook media: fix typos in YUV420M description

NV12M -> YUV420M
YVU420M -> YUV420M

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: i2c: ths7303: drop module param debug
Lad, Prabhakar [Mon, 2 Mar 2015 15:22:19 +0000 (12:22 -0300)]
[media] media: i2c: ths7303: drop module param debug

this patch drops module param 'debug' as it was never used.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: drop call to v4l2_device_unregister_subdev()
Lad, Prabhakar [Mon, 2 Mar 2015 14:54:07 +0000 (11:54 -0300)]
[media] media: drop call to v4l2_device_unregister_subdev()

These drivers are moved to support asynchronous probing,
v4l2_async_unregister_subdev() unregisters the subdev so
there isn't a need to explicitly call v4l2_device_unregister_subdev().

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] Basic support for the Elgato EyeTV Hybrid INT 2008 USB Stick
Gilles Risch [Sun, 1 Mar 2015 20:11:05 +0000 (17:11 -0300)]
[media] Basic support for the Elgato EyeTV Hybrid INT 2008 USB Stick

This patch will add basic support for the Elgato EyeTV Hybrid INT
2008 USB Stick.

Signed-off-by: Gilles Risch <gilles.risch@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2: remove unused including <linux/version.h>
Wei Yongjun [Fri, 27 Feb 2015 11:42:23 +0000 (08:42 -0300)]
[media] v4l2: remove unused including <linux/version.h>

Remove including <linux/version.h> that don't need it.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: au0828 - embed vdev and vbi_dev structs in au0828_dev
Shuah Khan [Thu, 26 Feb 2015 22:33:13 +0000 (19:33 -0300)]
[media] media: au0828 - embed vdev and vbi_dev structs in au0828_dev

Embed video_device structs vdev and vbi_dev in au0828_dev.
With this change, dynamic allocation and error path logic
in au0828_analog_register() is removed as it doesn't need
to allocate and handle allocation errors. Unregister path
doesn't need to free the now static video_device structures,
hence, changed video_device.release in au0828_video_template
to point to video_device_release_empty.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: au0828: drop vbi_buffer_filled() and re-use buffer_filled()
Lad, Prabhakar [Tue, 24 Feb 2015 13:00:29 +0000 (10:00 -0300)]
[media] media: au0828: drop vbi_buffer_filled() and re-use buffer_filled()

The vbi_buffer_filled() and buffer_filled() did the same functionality
except for incrementing the buffer sequence, this patch drops the
vbi_buffer_filled() and re-uses buffer_filled() for vbi buffers
as well by adding the check for vb2-queue type while incrementing
the sequence numbers. Along side this patch aligns the input parameters
of buffer_filled() function appropriately.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] drivers: media: i2c : s5c73m3: Replace dev_err with pr_err
Tapasweni Pathak [Tue, 24 Feb 2015 04:47:32 +0000 (01:47 -0300)]
[media] drivers: media: i2c : s5c73m3: Replace dev_err with pr_err

Replace dev_err statement with pr_err to fix null dereference.

Found by Coccinelle.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] saa7164: free_irq before pci_disable_device
Olli Salonen [Sat, 21 Feb 2015 21:45:26 +0000 (18:45 -0300)]
[media] saa7164: free_irq before pci_disable_device

Free the IRQ before disabling the device. Otherwise errors like this when unloading the module:

[21135.458560] ------------[ cut here ]------------
[21135.458569] WARNING: CPU: 4 PID: 1696 at /home/apw/COD/linux/fs/proc/generic.c:521 remove_proc_entry+0x1a1/0x1b0()
[21135.458572] remove_proc_entry: removing non-empty directory 'irq/47', leaking at least 'saa7164[0]'

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] saa7146: replace current->state by set_current_state()
Fabian Frederick [Fri, 20 Feb 2015 18:12:54 +0000 (15:12 -0300)]
[media] saa7146: replace current->state by set_current_state()

Use helper functions to access current->state.
Direct assignments are prone to races and therefore buggy.

current->state = TASK_RUNNING can be replaced by __set_current_state()

Thanks to Peter Zijlstra for the exact definition of the problem.

Suggested-By: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx231xx: Hauppauge HVR-955Q ATSC/QAM tuner
Olli Salonen [Sat, 28 Feb 2015 15:25:24 +0000 (12:25 -0300)]
[media] cx231xx: Hauppauge HVR-955Q ATSC/QAM tuner

Hauppauge HVR-955Q is a ATSC/QAM USB tuner with LGDT3306A demodulator and SiLabs Si2157-A30 tuner.

Only digital TV has been tested (both ATSC and QAM256).

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] si2157: IF frequency for ATSC and QAM
Olli Salonen [Sat, 28 Feb 2015 15:25:23 +0000 (12:25 -0300)]
[media] si2157: IF frequency for ATSC and QAM

For supporting ATSC and QAM modes the driver should use a smaller IF frequency than 5 MHz.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: Minor source code cleanups
Mauro Carvalho Chehab [Tue, 28 Oct 2014 14:40:20 +0000 (12:40 -0200)]
[media] lgdt3306a: Minor source code cleanups

Fix a few minor CodingStyle issues at the source code:
- Use proper multi-line comments;
- Align the log tables;
- Remove the .type from dvb_frontend_ops, since this is not
  needed anymore (since the drivers conversion to DVBv5);
- Remove emacs format macro.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: Break long lines
Mauro Carvalho Chehab [Tue, 28 Oct 2014 14:35:18 +0000 (12:35 -0200)]
[media] lgdt3306a: Break long lines

Fix most of checkpatch warnings like:
WARNING: line over 80 characters

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: constify log tables
Mauro Carvalho Chehab [Tue, 28 Oct 2014 14:30:44 +0000 (12:30 -0200)]
[media] lgdt3306a: constify log tables

Ideally, we should be replacing this function by intlog10().

While we don't do that, let's at least constify the tables,
in order to remove its code footfrint, and get rid of nelems.

This also fixes a few 80-cols CodingStyle warnings.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lbdt3306a: remove uneeded braces
Mauro Carvalho Chehab [Tue, 28 Oct 2014 14:07:52 +0000 (12:07 -0200)]
[media] lbdt3306a: remove uneeded braces

WARNING: braces {} are not necessary for any arm of this statement
+ if (ret == 0) {
[...]
+ } else {
[...]

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: Don't use else were not needed
Mauro Carvalho Chehab [Tue, 28 Oct 2014 14:05:35 +0000 (12:05 -0200)]
[media] lgdt3306a: Don't use else were not needed

Get rid of the remaining checkpatch.pl warnings:
WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lbdt3306a: simplify the lock status check
Mauro Carvalho Chehab [Tue, 28 Oct 2014 14:00:48 +0000 (12:00 -0200)]
[media] lbdt3306a: simplify the lock status check

The logic there is too complex and it looks like an inifite
loop.

So, simplify the logic and implement it as a for loop.

This gets rid of the following checkpatch.pl warnings:

WARNING: else is not generally useful after a break or return
+ return LG3306_UNLOCK;
+ } else {

WARNING: else is not generally useful after a break or return
+ return LG3306_UNLOCK;
+ } else {

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lbdt3306a: rework at printk macros
Mauro Carvalho Chehab [Tue, 28 Oct 2014 13:35:16 +0000 (11:35 -0200)]
[media] lbdt3306a: rework at printk macros

Use pr_foo() where there's a direct replacement. For debug, use
custom-made macros, for now, as there are 3 different debug levels.

We should get rid of those some day, specially since several such
macros can be just removed, as Kernel trace would provide about
the same output.

This gets rid of some checkpatch errors:

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(...  to printk(KERN_INFO ...
+#define lg_info(fmt, arg...) printk(KERN_INFO "lgdt3306a: " fmt, ##arg)

ERROR: Macros with complex values should be enclosed in parentheses
+#define lg_dbg(fmt, arg...) if (debug & DBG_INFO) \
+ lg_printk(KERN_DEBUG,         fmt, ##arg)

ERROR: Macros with complex values should be enclosed in parentheses
+#define lg_reg(fmt, arg...) if (debug & DBG_REG) \
+ lg_printk(KERN_DEBUG,         fmt, ##arg)

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: Remove FSF address
Mauro Carvalho Chehab [Tue, 28 Oct 2014 13:27:34 +0000 (11:27 -0200)]
[media] lgdt3306a: Remove FSF address

Fix this CodingStyle error:

ERROR: Do not include the paragraph about writing to the Free Software Foundation's mailing address from the sample GPL notice. The FSF has changed addresses in the past, and may do so ag$
#56: FILE: drivers/media/dvb-frontends/lgdt3306a.c:19:
+ *    along with this program; if not, write to the Free Software$

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: properly handle I/O errors
Mauro Carvalho Chehab [Tue, 28 Oct 2014 13:21:48 +0000 (11:21 -0200)]
[media] lgdt3306a: properly handle I/O errors

Fixes the following smatch errors:

drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_set_if':
drivers/media/dvb-frontends/lgdt3306a.c:695:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_monitor_vsb':
drivers/media/dvb-frontends/lgdt3306a.c:1033:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_check_oper_mode':
drivers/media/dvb-frontends/lgdt3306a.c:1082:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_check_lock_status':
drivers/media/dvb-frontends/lgdt3306a.c:1109:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_check_neverlock_status':
drivers/media/dvb-frontends/lgdt3306a.c:1185:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_pre_monitoring':
drivers/media/dvb-frontends/lgdt3306a.c:1199:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_get_packet_error':
drivers/media/dvb-frontends/lgdt3306a.c:1310:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: don't go past the buffer
Mauro Carvalho Chehab [Tue, 28 Oct 2014 13:07:03 +0000 (11:07 -0200)]
[media] lgdt3306a: don't go past the buffer

As warned by smatch:
drivers/media/dvb-frontends/lgdt3306a.c:1354 log10_x1000() error: buffer overflow 'valx_x10' 14 <= 14
drivers/media/dvb-frontends/lgdt3306a.c:1355 log10_x1000() error: buffer overflow 'log10x_x1000' 14 <= 14

There's a potential of returning a value out of the buffer. Fix it.

While here, remove the ugly braced block.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: one bit fields should be unsigned
Mauro Carvalho Chehab [Tue, 28 Oct 2014 13:02:13 +0000 (11:02 -0200)]
[media] lgdt3306a: one bit fields should be unsigned

Fix two smatch warnings:
drivers/media/dvb-frontends/lgdt3306a.h:53:28: error: dubious one-bit signed bitfield
drivers/media/dvb-frontends/lgdt3306a.h:56:33: error: dubious one-bit signed bitfield

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: Use IS_ENABLED() for attach function
Mauro Carvalho Chehab [Tue, 28 Oct 2014 12:56:10 +0000 (10:56 -0200)]
[media] lgdt3306a: Use IS_ENABLED() for attach function

Simplify the check if CONFIG_DVB_LGDT3306A is enabled, use the
IS_ENABLED() macro, just like the other frontend modules.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: Use hexadecimal values in lowercase
Mauro Carvalho Chehab [Tue, 28 Oct 2014 12:50:36 +0000 (10:50 -0200)]
[media] lgdt3306a: Use hexadecimal values in lowercase

While this is not a mandatory rule at the CodingStyle, we prefer
hexadecimal values in lowercase. Currently, there's a mix of lowercase
and uppercase ons at lgdt3306a. So, convert all to lowercase with this
small script:

perl -ne 'if (m,0x([\dA-F]+),) { $o=$1; $n=lc $1; s,0x($o),0x$n, } print $_'

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: more small whitespace cleanups
Michael Ira Krufky [Sat, 25 Oct 2014 14:26:15 +0000 (11:26 -0300)]
[media] lgdt3306a: more small whitespace cleanups

Just CodingStyle. No functional changes.

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: typo fix
Michael Ira Krufky [Sat, 25 Oct 2014 14:20:57 +0000 (11:20 -0300)]
[media] lgdt3306a: typo fix

fix WARNING: 'supress' may be misspelled - perhaps 'suppress'?

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: fix WARNING: please, no spaces at the start of a line
Michael Ira Krufky [Sat, 25 Oct 2014 14:12:25 +0000 (11:12 -0300)]
[media] lgdt3306a: fix WARNING: please, no spaces at the start of a line

Properly indent register initialization tables.

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: fix ERROR: do not use C99 // comments
Michael Ira Krufky [Sat, 25 Oct 2014 14:05:05 +0000 (11:05 -0300)]
[media] lgdt3306a: fix ERROR: do not use C99 // comments

Replace C99 comments by /* */ blocks.

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: do not add new typedefs
Michael Ira Krufky [Sun, 3 Aug 2014 18:29:04 +0000 (15:29 -0300)]
[media] lgdt3306a: do not add new typedefs

We should not be using typedefs at the Kernel, as this makes harder
for reviewers to understand the code.

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: fix ERROR: do not use assignment in if condition
Michael Ira Krufky [Sun, 3 Aug 2014 18:18:23 +0000 (15:18 -0300)]
[media] lgdt3306a: fix ERROR: do not use assignment in if condition

Just CodingStyle fix.

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: move EXPORT_SYMBOL to be just after function
Michael Ira Krufky [Sun, 3 Aug 2014 18:05:59 +0000 (15:05 -0300)]
[media] lgdt3306a: move EXPORT_SYMBOL to be just after function

Fixes CodingStyle error:
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable.

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: remove unnecessary 'else'
Michael Ira Krufky [Sun, 3 Aug 2014 17:51:49 +0000 (14:51 -0300)]
[media] lgdt3306a: remove unnecessary 'else'

No need for an else, as the previous if will return.

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: clean up whitespace & unneeded brackets
Michael Ira Krufky [Sun, 27 Jul 2014 22:24:24 +0000 (19:24 -0300)]
[media] lgdt3306a: clean up whitespace & unneeded brackets

No functional changes.

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DVB: add support for LG Electronics LGDT3306A ATSC/QAM-B Demodulator
Fred Richter [Mon, 24 Mar 2014 22:56:00 +0000 (19:56 -0300)]
[media] DVB: add support for LG Electronics LGDT3306A ATSC/QAM-B Demodulator

This ATSC/QAM-B demodulator is used by several new devices.

Add support for it. Other patches will fix CodingStyle issues.

Signed-off-by: Fred Richter <frichter@hauppauge.com>
Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook media: fix xvYCC601 documentation
Hans Verkuil [Thu, 19 Feb 2015 13:49:40 +0000 (10:49 -0300)]
[media] DocBook media: fix xvYCC601 documentation

The documentation of the xvYCC601 Y'CbCr encoding was part of the SMPTE 170M
(SDTV) colorspace, but it should have been part of the Rec. 709 (HDTV) colorspace
as per the xvYCC standard.

This change only affects the documentation and not any code.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-core: drop g/s_priority ops
Hans Verkuil [Tue, 3 Feb 2015 13:46:56 +0000 (10:46 -0300)]
[media] v4l2-core: drop g/s_priority ops

The handling of VIDIOC_G/S_PRIORITY is now entirely done by the V4L2
core, so we can drop the g/s_priority ioctl ops.

We do have to make sure though that when S_PRIORITY is called we check
that the driver used struct v4l2_fh. This check can be removed once all
drivers are converted to that structure.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] pvrusb2: use struct v4l2_fh
Hans Verkuil [Tue, 3 Feb 2015 13:46:55 +0000 (10:46 -0300)]
[media] pvrusb2: use struct v4l2_fh

By using struct v4l2_fh both the prio handling and the linked list
implementation in pvrusb2 can be removed since both are now done in
the v4l2 core if you use struct v4l2_fh.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-core: remove the old .ioctl BKL replacement
Hans Verkuil [Tue, 17 Feb 2015 08:44:09 +0000 (05:44 -0300)]
[media] v4l2-core: remove the old .ioctl BKL replacement

To keep V4L2 drivers that did not yet convert to unlocked_ioctl happy,
the v4l2 core had a .ioctl file operation that took a V4L2 lock.

The last drivers are now converted to unlocked_ioctl, so all this
old code can now be removed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvc gadget: set device_caps in querycap
Hans Verkuil [Tue, 17 Feb 2015 08:44:08 +0000 (05:44 -0300)]
[media] uvc gadget: set device_caps in querycap

The V4L2 core will warn if this is not done. Unfortunately this driver
wasn't updated.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvc gadget: switch to unlocked_ioctl
Hans Verkuil [Tue, 17 Feb 2015 08:44:07 +0000 (05:44 -0300)]
[media] uvc gadget: switch to unlocked_ioctl

Instead of .ioctl use unlocked_ioctl. This allows us to finally remove
the old .ioctl op.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvc gadget: switch to v4l2 core locking
Hans Verkuil [Tue, 17 Feb 2015 08:44:06 +0000 (05:44 -0300)]
[media] uvc gadget: switch to v4l2 core locking

Switch this driver over to the V4L2 core locking mechanism in preparation
for switching to unlocked_ioctl. Suggested by Laurent Pinchart.

This patch introduces a new mutex at the struct uvc_video level and
drops the old mutex at the queue level. The new lock is now used for all
ioctl locking and in the release file operation (the driver always has
to take care of locking in file operations, the core only serializes
ioctls).

Note that the mmap and get_unmapped_area file operations no longer take
a lock. Commit f035eb4e976ef5a059e30bc91cfd310ff030a7d3 fixed a AB-BA
deadlock by moving all the locking down into vb2, so the mmap and
get_unmapped_area file operations should no longer do any locking before
calling into vb2.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] radio-bcm2048: use unlocked_ioctl instead of ioctl
Hans Verkuil [Tue, 17 Feb 2015 08:44:05 +0000 (05:44 -0300)]
[media] radio-bcm2048: use unlocked_ioctl instead of ioctl

This driver does its own locking, so there is no need to use
ioctl instead of unlocked_ioctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] pvrusb2: replace .ioctl by .unlocked_ioctl
Hans Verkuil [Tue, 17 Feb 2015 08:44:04 +0000 (05:44 -0300)]
[media] pvrusb2: replace .ioctl by .unlocked_ioctl

As far as I can tell pvrusb2 does its own locking, so there is
no need to use .ioctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: i2c: ADV7604: Rename adv7604 prefixes
Pablo Anton [Tue, 3 Feb 2015 17:13:18 +0000 (14:13 -0300)]
[media] media: i2c: ADV7604: Rename adv7604 prefixes

It is confusing which parts of the driver are adv7604 specific, adv7611
specific or common for both. This patch renames any adv7604 prefixes (both
for functions and defines) to adv76xx whenever they are common.

Signed-off-by: Pablo Anton <pablo.anton@vodalys-labs.com>
Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com>
[hans.verkuil@cisco.com: rebased and renamed ADV76xx_fsc to ADV76XX_FSC]
[hans.verkuil@cisco.com: kept the existing adv7604 driver name]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: radio: handle timeouts
Nicholas Mc Guire [Thu, 5 Feb 2015 08:56:42 +0000 (05:56 -0300)]
[media] media: radio: handle timeouts

Add handling for timeout case.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: radio: assign wait_for_completion_timeout to appropriately typed var
Nicholas Mc Guire [Thu, 5 Feb 2015 07:58:48 +0000 (04:58 -0300)]
[media] media: radio: assign wait_for_completion_timeout to appropriately typed var

wait_for_completion_timeout() returns unsigned long not int. This assigns
the return value to an appropriately typed variable (also helps keep
static code checkers happy).

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: adv7604: CP CSC uses a different register on adv7604 and adv7611
jean-michel.hautbois@vodalys.com [Wed, 4 Feb 2015 14:16:00 +0000 (11:16 -0300)]
[media] media: adv7604: CP CSC uses a different register on adv7604 and adv7611

The bits are the same, but register is 0xf4 on ADV7611 instead of 0xfc.
When reading back the value in log_status, differentiate both.

Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] si470x: fixup wait_for_completion_timeout return handling
Nicholas Mc Guire [Wed, 11 Feb 2015 14:20:54 +0000 (11:20 -0300)]
[media] si470x: fixup wait_for_completion_timeout return handling

return type of wait_for_completion_timeout is unsigned long not int. A
appropriately named variable of type unsigned long is added and the
assignments fixed up.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: bcm2048: remove unused return of function
Luis de Bethencourt [Sun, 8 Feb 2015 22:29:11 +0000 (19:29 -0300)]
[media] media: bcm2048: remove unused return of function

Integer return of bcm2048_parse_rds_rt () is never used, changing the return
type to void.

Signed-off-by: Luis de Bethencourt <luis.bg@samsung.com>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: i2c: ADV7604: In free run mode, signal is locked
jean-michel.hautbois@vodalys.com [Fri, 6 Feb 2015 14:37:58 +0000 (11:37 -0300)]
[media] media: i2c: ADV7604: In free run mode, signal is locked

The CP_NON_STD_VIDEO bit indicates an input not aligned with DV timings.
If there is no input, and chip is in free run mode, consider we are locked.

Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com>
[hans.verkuil@cisco.com: put both conditions in one 'if']
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] au0828: Delete unnecessary checks before the function call "video_unregister_...
Markus Elfring [Tue, 3 Feb 2015 18:00:25 +0000 (15:00 -0300)]
[media] au0828: Delete unnecessary checks before the function call "video_unregister_device"

The video_unregister_device() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] stk-webcam: Delete an unnecessary check before the function call "vfree"
Markus Elfring [Tue, 3 Feb 2015 17:36:35 +0000 (14:36 -0300)]
[media] stk-webcam: Delete an unnecessary check before the function call "vfree"

The vfree() function performs also input parameter validation.
Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vivid sdr: fix broken sine tone generated for sdr FM
Prashant Laddha [Wed, 4 Feb 2015 09:07:32 +0000 (06:07 -0300)]
[media] vivid sdr: fix broken sine tone generated for sdr FM

FM (frequency modulated) signal for SDR is generated by varying the
phase, where phase variation is proportional to input signal. It is
seen that, the larger phase increments leads to discontinuities in
the signal recovered after demodulation. Reducing the extent of phase
variation with respect to input signal, equivalent to reducing the
modulation index.

Tested using FM receiver flow graph in gnuradio-companion.

Cc: Antti Palosaari <crope@iki.fi>
Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vivid sdr: Use LUT based implementation for sin/cos()
Prashant Laddha [Wed, 4 Feb 2015 09:07:31 +0000 (06:07 -0300)]
[media] vivid sdr: Use LUT based implementation for sin/cos()

The common implementation for sin/cos in include/linux/fixp-arith.h
has been improved recently to provide higher precision.

Replacing native implementation of sin/cos in vivid sdr with common
implementation. This serves two purposes:

1. Improved accuracy: the native implementation based on the Taylor
   series is more prone to rounding errors.
2. Reuse of common function: this is better compared to maintaining
   native versions for each driver.

Suggested by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Antti Palosaari <crope@iki.fi>
Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] fixp-arith: replace sin/cos table by a better precision one
Mauro Carvalho Chehab [Wed, 4 Feb 2015 09:07:30 +0000 (06:07 -0300)]
[media] fixp-arith: replace sin/cos table by a better precision one

The cos table used at fixp-arith.h has only 8 bits of precision.
That causes problems if it is reused on other drivers.

As some media drivers require a higher precision sin/cos
implementation, replace the current implementation by one that
will provide 32 bits precision.

The values generated by the new implementation matches the
32 bit precision of glibc's sin for an angle measured in
integer degrees.

It also provides support for fractional angles via linear
interpolation. On experimental calculus, when used a table
with a 0.001 degree angle, the maximum error for sin is
0.000038, which is likely good enough for practical purposes.

There are some logic there that seems to be specific to the
usage inside ff-memless.c. Move those logic to there, as they're
not needed elsewhere.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx88: Fix possible leak in cx8802_probe()
Christian Engelmayer [Sat, 14 Feb 2015 23:12:56 +0000 (20:12 -0300)]
[media] cx88: Fix possible leak in cx8802_probe()

In case allocation vb2_dma_sg_init_ctx() fails during cx8802_probe(), the
already allocated cx8802 device structure memory is not freed in the used
exit path. Thus adapt the cleanup handling accordingly. Detected by Coverity
CID 1260065.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] sh_vou: fix memory leak on error paths in sh_vou_open()
Alexey Khoroshilov [Fri, 13 Feb 2015 22:39:03 +0000 (19:39 -0300)]
[media] sh_vou: fix memory leak on error paths in sh_vou_open()

Memory allocated for sh_vou_file is not deallocated
on error paths in sh_vou_open().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook media: fix validation error
Hans Verkuil [Fri, 13 Feb 2015 10:32:16 +0000 (07:32 -0300)]
[media] DocBook media: fix validation error

<tgroup> doesn't understand the 'border' attribute.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] staging: dt3155v4l: Switch to using managed resource with devm_
Kiran Padwal [Fri, 13 Feb 2015 08:52:10 +0000 (05:52 -0300)]
[media] staging: dt3155v4l: Switch to using managed resource with devm_

This patch uses managed resource APIs to allocate memory
in order to simplify the driver unload or failure cases

Signed-off-by: Kiran Padwal <kiran.padwal@smartplayin.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] timberdale: VIDEO_TIMBERDALE should depend on HAS_DMA
Geert Uytterhoeven [Thu, 12 Feb 2015 14:11:40 +0000 (11:11 -0300)]
[media] timberdale: VIDEO_TIMBERDALE should depend on HAS_DMA

If NO_DMA=y:

    warning: (VIDEO_OMAP2_VOUT && VIDEO_VIU && VIDEO_TIMBERDALE) selects VIDEOBUF_DMA_CONTIG which has unmet direct dependencies (MEDIA_SUPPORT && HAS_DMA)

    drivers/built-in.o: In function `__videobuf_dc_free':
    videobuf-dma-contig.c:(.text+0x6f4d32): undefined reference to `dma_free_coherent'
    drivers/built-in.o: In function `__videobuf_dc_alloc':
    videobuf-dma-contig.c:(.text+0x6f4fe6): undefined reference to `dma_alloc_coherent'
    drivers/built-in.o: In function `__videobuf_mmap_mapper':
    videobuf-dma-contig.c:(.text+0x6f518e): undefined reference to `dma_free_coherent'

Commit 244829226f47ffb4 ("[media] timberdale: do not select TIMB_DMA")
dropped the dependency of VIDEO_TIMBERDALE on DMADEVICES, and thus the
implicit dependency on HAS_DMA.  VIDEO_TIMBERDALE selects
VIDEOBUF_DMA_CONTIG, which bypasses its dependency on HAS_DMA.  Make
VIDEO_TIMBERDALE depend on HAS_DMA to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] am437x: VIDEO_AM437X_VPFE should depend on HAS_DMA
Geert Uytterhoeven [Thu, 12 Feb 2015 14:11:39 +0000 (11:11 -0300)]
[media] am437x: VIDEO_AM437X_VPFE should depend on HAS_DMA

If NO_DMA=y:

    warning: (VIDEO_AM437X_VPFE && VIDEO_DM365_VPFE && VIDEO_DT3155 && VIDEO_OMAP4) selects VIDEOBUF2_DMA_CONTIG which has unmet direct dependencies (MEDIA_SUPPORT && HAS_DMA)

    drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_mmap’:
    drivers/media/v4l2-core/videobuf2-dma-contig.c:207: error: implicit declaration of function ‘dma_mmap_coherent’
    drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_get_base_sgt’:
    drivers/media/v4l2-core/videobuf2-dma-contig.c:390: error: implicit declaration of function ‘dma_get_sgtable’

VIDEO_AM437X_VPFE selects VIDEOBUF2_DMA_CONTIG, which bypasses its
dependency on HAS_DMA.  Make VIDEO_AM437X_VPFE depend on HAS_DMA to fix
this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx231xx: drop condition with no effect
Nicholas Mc Guire [Wed, 4 Feb 2015 13:03:11 +0000 (10:03 -0300)]
[media] cx231xx: drop condition with no effect

The if and the else code are identical - so the condition has no effect
on the effective code.
This patch removes the condition and the duplicated code.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] siano: avoid a linkedit error if !MC
Mauro Carvalho Chehab [Mon, 2 Mar 2015 17:17:01 +0000 (14:17 -0300)]
[media] siano: avoid a linkedit error if !MC

If the media controller (MC) is not enabled, it will compile
fine, but will fail at the linkedition:

 ERROR: "media_device_unregister" [drivers/media/usb/siano/smsusb.ko] undefined!

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] use a function for DVB media controller register
Mauro Carvalho Chehab [Mon, 2 Mar 2015 14:26:14 +0000 (11:26 -0300)]
[media] use a function for DVB media controller register

This is really a simple function, but using it avoids to have
if's inside the drivers.

Also, the kABI becomes a little more clearer.

This shouldn't generate any overhead, and the type check
will happen when compiling with MC DVB enabled.

So, let's do it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] dvb: Avoid warnings when compiled without the media controller
Mauro Carvalho Chehab [Mon, 2 Mar 2015 13:53:46 +0000 (10:53 -0300)]
[media] dvb: Avoid warnings when compiled without the media controller

drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: In function ‘dvb_usbv2_adapter_dvb_exit’:
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:531:25: warning: unused variable ‘d’ [-Wunused-variable]
  struct dvb_usb_device *d = adap_to_d(adap);
                         ^
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:403:13: warning: ‘dvb_usbv2_media_device_register’ defined but not used [-Wunused-function]
 static void dvb_usbv2_media_device_register(struct dvb_usb_adapter *adap)

drivers/media/usb/dvb-usb/dvb-usb-dvb.c:97:13: warning: ‘dvb_usb_media_device_register’ defined but not used [-Wunused-function]
 static void dvb_usb_media_device_register(struct dvb_usb_adapter *adap)
             ^

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] dvbdev: use adapter arg for dvb_create_media_graph()
Mauro Carvalho Chehab [Mon, 2 Mar 2015 13:49:04 +0000 (10:49 -0300)]
[media] dvbdev: use adapter arg for dvb_create_media_graph()

Instead of using media_dev argument for dvb_create_media_graph(),
use the adapter.

That allows to create a stub for this function, if compiled
without DVB support, avoiding to add extra if's at the drivers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] dvb-usb: create one media_dev per adapter
Mauro Carvalho Chehab [Fri, 13 Feb 2015 13:08:17 +0000 (10:08 -0300)]
[media] dvb-usb: create one media_dev per adapter

Instead of assuming just one adapter, change the code to store
one media controller per adapter.

This works fine for dvb-usb, as, on all drivers here, it is not
possible to write a media graph that would mix resources between
the two different adapters.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] dvb-usb: add support for the media controller at USB driver
Rafael Lourenço de Lima Chehab [Fri, 13 Feb 2015 21:29:14 +0000 (18:29 -0300)]
[media] dvb-usb: add support for the media controller at USB driver

Create a struct media_device and add it to the dvb adapter.

Please notice that the tuner is not mapped yet by the dvb core.

[mchehab@osg.samsung.com: use config option MEDIA_CONTROLLER_DVB]
Signed-off-by: Rafael Lourenço de Lima Chehab <chehabrafael@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] dvb-usb-v2: create one media_dev per adapter
Mauro Carvalho Chehab [Wed, 25 Feb 2015 17:07:42 +0000 (14:07 -0300)]
[media] dvb-usb-v2: create one media_dev per adapter

Instead of assuming just one adapter, change the code to store
one media controller per adapter.

This works fine for dvb-usb, as, on all drivers here, it is not
possible to write a media graph that would mix resources between
the two different adapters.

Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] dvb-usb-v2: add support for the media controller at USB driver
Rafael Lourenço de Lima Chehab [Thu, 12 Feb 2015 11:37:25 +0000 (08:37 -0300)]
[media] dvb-usb-v2: add support for the media controller at USB driver

Create a struct media_device and add it to the dvb adapter.

Please notice that the tuner is not mapped yet by the dvb core.

[mchehab@osg.samsung.com: use config option MEDIA_CONTROLLER_DVB due to a rebase]
Signed-off-by: Rafael Lourenço de Lima Chehab <chehabrafael@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] siano: register media controller earlier
Mauro Carvalho Chehab [Sun, 22 Feb 2015 15:29:23 +0000 (12:29 -0300)]
[media] siano: register media controller earlier

We need to initialize the media controller earlier, as the core
will call the smsdvb hotplug during register time. Ok, this is
an async operation, so, when the module is not loaded, the media
controller works.

However, if the module is already loaded, nothing will be
registered at the media controller, as it will load too late.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] siano: print a message if DVB register succeeds
Mauro Carvalho Chehab [Sun, 22 Feb 2015 15:00:45 +0000 (12:00 -0300)]
[media] siano: print a message if DVB register succeeds

Right now, this is a debug message, misplaced. Promote it
to an info message, as it helps to discover if something
bad happened during device init.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] siano: get rid of sms_dbg parameter
Mauro Carvalho Chehab [Sun, 22 Feb 2015 14:51:41 +0000 (11:51 -0300)]
[media] siano: get rid of sms_dbg parameter

All siano modules have a sms_dbg parameter. Now that we're using
the standard pr_debug() macro, we can get rid of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] siano: get rid of sms_info()
Mauro Carvalho Chehab [Sun, 22 Feb 2015 14:49:28 +0000 (11:49 -0300)]
[media] siano: get rid of sms_info()

On most cases, sms_info() should actually be pr_debug(), but,
on other places, it should be pr_info().

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] siano: replace sms_debug() by pr_debug()
Mauro Carvalho Chehab [Sun, 22 Feb 2015 14:33:37 +0000 (11:33 -0300)]
[media] siano: replace sms_debug() by pr_debug()

There's no reason to use a macro here. Just replace everything,
and let those debug messages to be activated via dynamic printk.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] siano: replace sms_log() by pr_debug()
Mauro Carvalho Chehab [Sun, 22 Feb 2015 14:33:09 +0000 (11:33 -0300)]
[media] siano: replace sms_log() by pr_debug()

Despite its name, those functions are acutally debug
prints for the IR part of the driver. So, properly
map them using pr_debug()

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] siano: replace sms_err by pr_err
Mauro Carvalho Chehab [Sun, 22 Feb 2015 14:04:35 +0000 (11:04 -0300)]
[media] siano: replace sms_err by pr_err

Originally, sms_err() would be also displaying the line where
the error occurs, but the messages are clear enough. Also,
the function is always printed. So, no need for it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] siano: replace sms_warn() by pr_warn()
Mauro Carvalho Chehab [Sun, 22 Feb 2015 13:55:55 +0000 (10:55 -0300)]
[media] siano: replace sms_warn() by pr_warn()

There's no reason for a sms' own sms_warn macro. Just replace
it by the standard pr_warn().

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] siano: use pr_* print functions
Mauro Carvalho Chehab [Sun, 22 Feb 2015 13:46:56 +0000 (10:46 -0300)]
[media] siano: use pr_* print functions

Instead of defining its own set of printk functions, let's
use the common Kernel debug logic provided by pr_foo functions.

As a first step, let's just define the existing macros as the
Kernel ones.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] siano: add support for the media controller at USB driver
Mauro Carvalho Chehab [Wed, 7 Jan 2015 11:03:03 +0000 (08:03 -0300)]
[media] siano: add support for the media controller at USB driver

Adding support for the media controller for a pure DVB device
is simple: just create a struct media_device and add it to the
dvb adapter. After creating all DVB devices, we need to call
the DVB core, for it to create the media graph.

More work is needed for pure DVB tuners, but this is hidden
at the Siano driver, just like several others non-hybrid
devices. So, this is streight forward.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx25840: better document the media pads
Mauro Carvalho Chehab [Thu, 19 Feb 2015 21:44:51 +0000 (18:44 -0300)]
[media] cx25840: better document the media pads

Use an enum to better document the media pads.

No functional changes.

Suggested-by: Prabhakar Lad <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx25840: fix return logic when media entity init fails
Mauro Carvalho Chehab [Thu, 19 Feb 2015 19:47:07 +0000 (16:47 -0300)]
[media] cx25840: fix return logic when media entity init fails

There's no need to free state, as it was allocated via devm_kzalloc().

Also, let's return the error code, instead of something else.

Reported-by: Prabhakar Lad <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx231xx: enable the analog tuner at buffer setup
Mauro Carvalho Chehab [Wed, 18 Feb 2015 15:22:27 +0000 (12:22 -0300)]
[media] cx231xx: enable the analog tuner at buffer setup

buf_prepare callback is called for every queued buffer. This is
an overkill. Call it at buf_setup, as this should be enough.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx231xx: Improve the media controller comment
Mauro Carvalho Chehab [Wed, 18 Feb 2015 15:20:03 +0000 (12:20 -0300)]
[media] cx231xx: Improve the media controller comment

There are two problems at the comment:
- it is badly idented;
- its comment doesn't mean anything.

Fix it.

Requested-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx25840: better document the media controller TODO
Mauro Carvalho Chehab [Wed, 18 Feb 2015 15:15:39 +0000 (12:15 -0300)]
[media] cx25840: better document the media controller TODO

Analog video inputs are the tuner, plus composite, svideo, etc,
 e. g. the input pat should actually be like:

                ___________
TUNER --------> |         |
                |         |
SVIDEO .......> | cx25840 |
                |         |
COMPOSITE1 ...> |_________|

(in the above, dashes represent the enabled link, and periods
represent the disabled ones)

In other words, if we want to properly represent the pipeline,
it should be possible to see via the media controller if the tuner
is being used as an image source, or if the source is something else.

I didn't map those other inputs here yet, due to a few things:
- The extra inputs would require subdevs that won't be controlled
- I was in doubt about the best way for doing that
- That would likely require some extra setup for cx25840 caller
  drivers, in order to represent what of the possible internal
  inputs are actually used on each specific board

Actually, at least for now, I was unable to see much benefit
on adding such map now, so let's just document it, as this could
be added later on, as needed.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] dvb core: rename the media controller entities
Mauro Carvalho Chehab [Wed, 18 Feb 2015 15:09:27 +0000 (12:09 -0300)]
[media] dvb core: rename the media controller entities

Prefix all DVB media controller entities with "dvb-" and use dash
instead of underline at the names.

Requested-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] tuner-core: fix compilation if the media controller is not defined
Mauro Carvalho Chehab [Wed, 18 Feb 2015 15:04:05 +0000 (12:04 -0300)]
[media] tuner-core: fix compilation if the media controller is not defined

drivers/media/v4l2-core/tuner-core.c:440:7: error: 'struct v4l2_subdev' has no member named 'entity'
     t->sd.entity.name = t->name;

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx231xx: fix compilation if the media controller is not defined
Mauro Carvalho Chehab [Wed, 18 Feb 2015 15:02:09 +0000 (12:02 -0300)]
[media] cx231xx: fix compilation if the media controller is not defined

drivers/media/usb/cx231xx/cx231xx-cards.c: In function ‘cx231xx_usb_probe’:
drivers/media/usb/cx231xx/cx231xx-cards.c:1589:15: error: ‘struct v4l2_device’ has no member named ‘mdev’
  dev->v4l2_dev.mdev = dev->media_dev;
               ^
drivers/media/usb/cx231xx/cx231xx-cards.c:1589:26: error: ‘struct cx231xx’ has no member named ‘media_dev’
  dev->v4l2_dev.mdev = dev->media_dev;
                          ^
scripts/Makefile.build:257: recipe for target 'drivers/media/usb/cx231xx/cx231xx-cards.o' failed

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] dvb-frontend: remove a warning
Mauro Carvalho Chehab [Wed, 18 Feb 2015 14:43:44 +0000 (11:43 -0300)]
[media] dvb-frontend: remove a warning

if CONFIG_MEDIA_CONTROLLER_DVB is not selected, it is now
producing this warning:

drivers/media/dvb-core/dvb_frontend.c: In function ‘dvb_frontend_thread’:
drivers/media/dvb-core/dvb_frontend.c:695:6: warning: unused variable ‘ret’ [-Wunused-variable]
  int ret;
      ^

Reported-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media.h: mark alsa struct in media_entity_desc as TODO
Hans Verkuil [Wed, 25 Feb 2015 15:05:13 +0000 (12:05 -0300)]
[media] media.h: mark alsa struct in media_entity_desc as TODO

The alsa struct in struct media_entity_desc is now marked as deprecated.
However, the alsa struct should remain as it is since it cannot be replaced
by a simple major/minor device node description. The alsa struct was designed
to be used as an alsa card description so V4L2 drivers could use this to expose
the alsa card that they create to carry the captured audio. Such a card is not
just a PCM device, but also needs to contain the alsa subdevice information,
and it may map to multiple devices, e.g. a PCM and a mixer device, such as the
au0828 usb stick creates.

This is exactly as intended and this cannot and should not be replaced by a
simple major/minor.

However, whether this information is in the right form for an ALSA device such
that it can handle udev renaming rules as well is another matter. So mark this
alsa struct as TODO and document the problems involved.

Updated the documentation as well to reflect this and to add the 'major'
and 'minor' field documentation.

Updated the documentation to clearly state that struct dev is to be used for
(sub-)devices that create a single device node. Other devices need their own
structure here.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] dvb core: only start media entity if not NULL
Mauro Carvalho Chehab [Mon, 23 Feb 2015 12:41:17 +0000 (09:41 -0300)]
[media] dvb core: only start media entity if not NULL

The logic there tries to start the media entity even if it
doesn't exist, causing this bug:

[  314.356162] BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
[  314.356202] IP: [<ffffffffa02ef74c>] media_entity_pipeline_start+0x1c/0x390 [media]

Reported-by: Gert-Jan van der Stroom <gjstroom@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years agoMerge tag 'v4.0-rc1' into patchwork
Mauro Carvalho Chehab [Mon, 23 Feb 2015 19:02:19 +0000 (16:02 -0300)]
Merge tag 'v4.0-rc1' into patchwork

Linux 34.0-rc1

* tag 'v4.0-rc1': (8947 commits)
  Linux 4.0-rc1
  autofs4 copy_dev_ioctl(): keep the value of ->size we'd used for allocation
  procfs: fix race between symlink removals and traversals
  debugfs: leave freeing a symlink body until inode eviction
  Documentation/filesystems/Locking: ->get_sb() is long gone
  trylock_super(): replacement for grab_super_passive()
  fanotify: Fix up scripted S_ISDIR/S_ISREG/S_ISLNK conversions
  Cachefiles: Fix up scripted S_ISDIR/S_ISREG/S_ISLNK conversions
  VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry)
  SELinux: Use d_is_positive() rather than testing dentry->d_inode
  Smack: Use d_is_positive() rather than testing dentry->d_inode
  TOMOYO: Use d_is_dir() rather than d_inode and S_ISDIR()
  Apparmor: Use d_is_positive/negative() rather than testing dentry->d_inode
  Apparmor: mediated_filesystem() should use dentry->d_sb not inode->i_sb
  VFS: Split DCACHE_FILE_TYPE into regular and special types
  VFS: Add a fallthrough flag for marking virtual dentries
  VFS: Add a whiteout dentry type
  VFS: Introduce inode-getting helpers for layered/unioned fs environments
  kernel: make READ_ONCE() valid on const arguments
  blk-throttle: check stats_cpu before reading it from sysfs
  ...

9 years agoLinux 4.0-rc1 v4.0-rc1
Linus Torvalds [Mon, 23 Feb 2015 02:21:14 +0000 (18:21 -0800)]
Linux 4.0-rc1

.. after extensive statistical analysis of my G+ polling, I've come to
the inescapable conclusion that internet polls are bad.

Big surprise.

But "Hurr durr I'ma sheep" trounced "I like online polls" by a 62-to-38%
margin, in a poll that people weren't even supposed to participate in.
Who can argue with solid numbers like that? 5,796 votes from people who
can't even follow the most basic directions?

In contrast, "v4.0" beat out "v3.20" by a slimmer margin of 56-to-44%,
but with a total of 29,110 votes right now.

Now, arguably, that vote spread is only about 3,200 votes, which is less
than the almost six thousand votes that the "please ignore" poll got, so
it could be considered noise.

But hey, I asked, so I'll honor the votes.

9 years agoMerge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
Linus Torvalds [Mon, 23 Feb 2015 02:05:13 +0000 (18:05 -0800)]
Merge tag 'ext4_for_linus' of git://git./linux/kernel/git/tytso/ext4

Pull ext4 fixes from Ted Ts'o:
 "Ext4 bug fixes.

  We also reserved code points for encryption and read-only images (for
  which the implementation is mostly just the reserved code point for a
  read-only feature :-)"

* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: fix indirect punch hole corruption
  ext4: ignore journal checksum on remount; don't fail
  ext4: remove duplicate remount check for JOURNAL_CHECKSUM change
  ext4: fix mmap data corruption in nodelalloc mode when blocksize < pagesize
  ext4: support read-only images
  ext4: change to use setup_timer() instead of init_timer()
  ext4: reserve codepoints used by the ext4 encryption feature
  jbd2: complain about descriptor block checksum errors

9 years agoMerge branch 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Mon, 23 Feb 2015 01:42:14 +0000 (17:42 -0800)]
Merge branch 'for-linus-2' of git://git./linux/kernel/git/viro/vfs

Pull more vfs updates from Al Viro:
 "Assorted stuff from this cycle.  The big ones here are multilayer
  overlayfs from Miklos and beginning of sorting ->d_inode accesses out
  from David"

* 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (51 commits)
  autofs4 copy_dev_ioctl(): keep the value of ->size we'd used for allocation
  procfs: fix race between symlink removals and traversals
  debugfs: leave freeing a symlink body until inode eviction
  Documentation/filesystems/Locking: ->get_sb() is long gone
  trylock_super(): replacement for grab_super_passive()
  fanotify: Fix up scripted S_ISDIR/S_ISREG/S_ISLNK conversions
  Cachefiles: Fix up scripted S_ISDIR/S_ISREG/S_ISLNK conversions
  VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry)
  SELinux: Use d_is_positive() rather than testing dentry->d_inode
  Smack: Use d_is_positive() rather than testing dentry->d_inode
  TOMOYO: Use d_is_dir() rather than d_inode and S_ISDIR()
  Apparmor: Use d_is_positive/negative() rather than testing dentry->d_inode
  Apparmor: mediated_filesystem() should use dentry->d_sb not inode->i_sb
  VFS: Split DCACHE_FILE_TYPE into regular and special types
  VFS: Add a fallthrough flag for marking virtual dentries
  VFS: Add a whiteout dentry type
  VFS: Introduce inode-getting helpers for layered/unioned fs environments
  Infiniband: Fix potential NULL d_inode dereference
  posix_acl: fix reference leaks in posix_acl_create
  autofs4: Wrong format for printing dentry
  ...

9 years agoMerge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
Linus Torvalds [Sun, 22 Feb 2015 17:57:16 +0000 (09:57 -0800)]
Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm

Pull ARM fix from Russell King:
 "Just one fix this time around.  __iommu_alloc_buffer() can cause a
  BUG() if dma_alloc_coherent() is called with either __GFP_DMA32 or
  __GFP_HIGHMEM set.  The patch from Alexandre addresses this"

* 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
  ARM: 8305/1: DMA: Fix kzalloc flags in __iommu_alloc_buffer()

9 years agoautofs4 copy_dev_ioctl(): keep the value of ->size we'd used for allocation
Al Viro [Sun, 22 Feb 2015 03:19:57 +0000 (22:19 -0500)]
autofs4 copy_dev_ioctl(): keep the value of ->size we'd used for allocation

X-Coverup: just ask spender
Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
9 years agoprocfs: fix race between symlink removals and traversals
Al Viro [Sun, 22 Feb 2015 03:16:11 +0000 (22:16 -0500)]
procfs: fix race between symlink removals and traversals

use_pde()/unuse_pde() in ->follow_link()/->put_link() resp.

Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
9 years agodebugfs: leave freeing a symlink body until inode eviction
Al Viro [Sun, 22 Feb 2015 03:05:11 +0000 (22:05 -0500)]
debugfs: leave freeing a symlink body until inode eviction

As it is, we have debugfs_remove() racing with symlink traversals.
Supply ->evict_inode() and do freeing there - inode will remain
pinned until we are done with the symlink body.

And rip the idiocy with checking if dentry is positive right after
we'd verified debugfs_positive(), which is a stronger check...

Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>