]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
8 years ago[media] mtk-vcodec: fix platform_no_drv_owner.cocci warnings
Fengguang Wu [Fri, 8 Jul 2016 23:22:25 +0000 (20:22 -0300)]
[media] mtk-vcodec: fix platform_no_drv_owner.cocci warnings

drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c:433:3-8: No need to set .owner here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-subdev.h: remove the control subdev ops
Hans Verkuil [Sun, 3 Jul 2016 12:02:01 +0000 (09:02 -0300)]
[media] v4l2-subdev.h: remove the control subdev ops

These are no longer used (finally!), so remove them.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media/i2c: drop the last users of the ctrl core ops
Hans Verkuil [Sun, 3 Jul 2016 12:01:22 +0000 (09:01 -0300)]
[media] media/i2c: drop the last users of the ctrl core ops

Nobody is using these ops anymore, so remove these callbacks from
the subdev drivers that still have them.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] ivtv: use v4l2_g/s_ctrl instead of the g/s_ctrl ops
Hans Verkuil [Sun, 3 Jul 2016 12:24:14 +0000 (09:24 -0300)]
[media] ivtv: use v4l2_g/s_ctrl instead of the g/s_ctrl ops

These ops are deprecated and should not be used anymore.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cx18: use v4l2_g/s_ctrl instead of the g/s_ctrl ops
Hans Verkuil [Sun, 3 Jul 2016 12:23:47 +0000 (09:23 -0300)]
[media] cx18: use v4l2_g/s_ctrl instead of the g/s_ctrl ops

These ops are deprecated and should not be used anymore.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-flash-led: remove unused ops
Hans Verkuil [Sun, 3 Jul 2016 12:20:46 +0000 (09:20 -0300)]
[media] v4l2-flash-led: remove unused ops

These ops are deprecated and should not be used anymore (and in fact
they are not used at all).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cx88: use wm8775_s_ctrl instead of the s_ctrl op
Hans Verkuil [Sun, 3 Jul 2016 12:00:26 +0000 (09:00 -0300)]
[media] cx88: use wm8775_s_ctrl instead of the s_ctrl op

This op is deprecated and should not be used anymore.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cx231xx: use v4l2_s_ctrl instead of the s_ctrl op
Hans Verkuil [Sun, 3 Jul 2016 11:59:33 +0000 (08:59 -0300)]
[media] cx231xx: use v4l2_s_ctrl instead of the s_ctrl op

This op is deprecated and should not be used anymore.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] via-camera: use v4l2_s_ctrl instead of the s_ctrl op
Hans Verkuil [Sun, 3 Jul 2016 12:13:04 +0000 (09:13 -0300)]
[media] via-camera: use v4l2_s_ctrl instead of the s_ctrl op

This op is deprecated and should not be used anymore.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] mcam-core: use v4l2_s_ctrl instead of the s_ctrl op
Hans Verkuil [Sun, 3 Jul 2016 11:58:55 +0000 (08:58 -0300)]
[media] mcam-core: use v4l2_s_ctrl instead of the s_ctrl op

This op is deprecated and should not be used anymore.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] usbvision: use v4l2_ctrl_g_ctrl instead of the g_ctrl op
Hans Verkuil [Sun, 3 Jul 2016 11:58:07 +0000 (08:58 -0300)]
[media] usbvision: use v4l2_ctrl_g_ctrl instead of the g_ctrl op

This op is deprecated and should not be used anymore.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] pvrusb2: use v4l2_s_ctrl instead of the s_ctrl op
Hans Verkuil [Sun, 3 Jul 2016 11:44:27 +0000 (08:44 -0300)]
[media] pvrusb2: use v4l2_s_ctrl instead of the s_ctrl op

This op is deprecated and should not be used anymore.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] davinci: drop unused control callbacks
Hans Verkuil [Sun, 3 Jul 2016 10:18:00 +0000 (07:18 -0300)]
[media] davinci: drop unused control callbacks

These callbacks are no longer used since the davinci drivers use the
control framework.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Prabhakar Lad <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] saa7164: drop unused saa7164_ctrl struct
Hans Verkuil [Sun, 3 Jul 2016 10:16:34 +0000 (07:16 -0300)]
[media] saa7164: drop unused saa7164_ctrl struct

No longer used, can be removed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] omap_vout: use control framework
Hans Verkuil [Sun, 3 Jul 2016 10:33:33 +0000 (07:33 -0300)]
[media] omap_vout: use control framework

Replace the old control code with the control framework.

This is one of the few remaining drivers that was not using this
framework.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] Convert Wideview WT220 DVB USB driver to rc-core
Jonathan McDowell [Fri, 20 May 2016 15:08:35 +0000 (12:08 -0300)]
[media] Convert Wideview WT220 DVB USB driver to rc-core

Converts the dtt200u DVB USB driver over to the rc-core
infrastructure for its handling of IR remotes. This device can receive
generic NEC / NEC Extended signals and the switch to the newer core
enables the easy use of tools such as ir-keytable to modify the active
key map.

Signed-off-by: Jonathan McDowell <noodles@earth.li>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] Fix RC5 decoding with Fintek CIR chipset
Jonathan McDowell [Sat, 14 May 2016 17:01:26 +0000 (14:01 -0300)]
[media] Fix RC5 decoding with Fintek CIR chipset

Fix RC5 decoding with Fintek CIR chipset

Commit e87b540be2dd02552fb9244d50ae8b4e4619a34b tightened up the RC5
decoding by adding a check for trailing silence to ensure a valid RC5
command had been received. Unfortunately the trailer length checked was
10 units and the Fintek CIR device does not want to provide details of a
space longer than 6350us. This meant that RC5 remotes working on a
Fintek setup on 3.16 failed on 3.17 and later. Fix this by shortening
the trailer check to 6 units (allowing for a previous space in the
received remote command).

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=117221

Signed-off-by: Jonathan McDowell <noodles@earth.li>
Cc: stable@vger.kernel.org
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: dvb_ringbuffer: Add memory barriers
Soeren Moch [Wed, 11 May 2016 16:49:11 +0000 (13:49 -0300)]
[media] media: dvb_ringbuffer: Add memory barriers

Implement memory barriers according to Documentation/circular-buffers.txt:
- use smp_store_release() to update ringbuffer read/write pointers
- use smp_load_acquire() to load write pointer on reader side
- use ACCESS_ONCE() to load read pointer on writer side

This fixes data stream corruptions observed e.g. on an ARM Cortex-A9
quad core system with different types (PCI, USB) of DVB tuners.

Signed-off-by: Soeren Moch <smoch@web.de>
Cc: stable@vger.kernel.org # 3.14+
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] mtk-vcodec: fix compiler warning
Hans Verkuil [Sat, 9 Jul 2016 07:32:58 +0000 (04:32 -0300)]
[media] mtk-vcodec: fix compiler warning

mtk-vcodec/venc_vpu_if.c:40:30: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  struct venc_vpu_inst *vpu = (struct venc_vpu_inst *)msg->venc_inst;
                              ^

Note: venc_inst is u64.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] zc3xx: Remove deprecated create_singlethread_workqueue
Bhaktipriya Shridhar [Sat, 9 Jul 2016 07:52:29 +0000 (04:52 -0300)]
[media] zc3xx: Remove deprecated create_singlethread_workqueue

The workqueue "work_thread" is involved in updating parameters for
transfers. It has a single work item(&sd->work) and hence
doesn't require ordering. Also, it is not being used on a memory
reclaim path. Hence, the singlethreaded workqueue has been replaced with
the use of system_wq.

System workqueues have been able to handle high level of concurrency
for a long time now and hence it's not required to have a singlethreaded
workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue
created with create_singlethread_workqueue(), system_wq allows multiple
work items to overlap executions even on the same CPU; however, a
per-cpu workqueue doesn't have any CPU locality or global ordering
guarantee unless the target CPU is explicitly specified and thus the
increase of local concurrency shouldn't make any difference.

Work item has been flushed in sd_stop0() to ensure that there are no
pending tasks while disconnecting the driver.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] mtk-vcodec: fix two compiler warnings
Hans Verkuil [Sat, 9 Jul 2016 07:32:57 +0000 (04:32 -0300)]
[media] mtk-vcodec: fix two compiler warnings

mtk-vcodec/mtk_vcodec_enc.c: In function 'mtk_venc_worker':
mtk-vcodec/mtk_vcodec_enc.c:1030:43: warning: format '%lx' expects argument of type 'long unsigned int', but argument 7 has type 'size_t {aka unsigned int}' [-Wformat=]
mtk-vcodec/mtk_vcodec_enc.c:1030:43: warning: format '%lx' expects argument of type 'long unsigned int', but argument 10 has type 'size_t {aka unsigned int}' [-Wformat=]

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cxd2841er: don't expose a dvbv5 stats to userspace if not available
Mauro Carvalho Chehab [Fri, 1 Jul 2016 14:03:13 +0000 (11:03 -0300)]
[media] cxd2841er: don't expose a dvbv5 stats to userspace if not available

The current code will expose a zero value if one of the stats is
not available, but this is not what userspace expects. Instead,
if something goes wrong on providing some stats, it should be
changing the scale to FE_SCALE_NOT_AVAILABLE.

So, change the logic to do the right thing.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] DVB-C read signal strength added for Sony demod
Abylay Ospan [Fri, 1 Jul 2016 02:09:48 +0000 (23:09 -0300)]
[media] DVB-C read signal strength added for Sony demod

cxd2841er_read_agc_gain_c added to obtain signal strength.
signal strength now relay on AGC value.

Signed-off-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cxd2841er: Fix signal strengh for DVB-T/T2 and show it in dBm
Mauro Carvalho Chehab [Thu, 30 Jun 2016 22:41:45 +0000 (19:41 -0300)]
[media] cxd2841er: Fix signal strengh for DVB-T/T2 and show it in dBm

The signal strength value is reversed: the bigger the number,
the weaker is the signal.

Fix the logic and present it in dBm. Please notice that the
dBm measure is actually an estimation, as the ratio is not
fully linear. It also varies with the frequency.

Yet, the estimation should be good enough for programs like
Kaffeine to indicate when the signal is good or bad.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Acked-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cxd2841er: Do some changes at the dvbv5 stats logic
Mauro Carvalho Chehab [Thu, 30 Jun 2016 03:34:59 +0000 (00:34 -0300)]
[media] cxd2841er: Do some changes at the dvbv5 stats logic

It is a good idea to measure the signal strength while
tuning, as this helps to identify if the antenna is ok.
Also, such measure helps to identify the quality of the
signal.

Do some changes to enable it before signal lock. While
here, optimize the code to only initialize the stats
length once, and make sure that, just after set_frontend,
any reading for the stats that depends on lock to return
FE_SCALE_NOT_AVAILABLE.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Acked-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cec-funcs.h: add missing 'reply' for short audio descriptor
Hans Verkuil [Fri, 8 Jul 2016 08:52:34 +0000 (05:52 -0300)]
[media] cec-funcs.h: add missing 'reply' for short audio descriptor

The cec_msg_request_short_audio_descriptor function was missing the reply
argument. That's needed if you want the framework to wait for the reply
message.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cec-funcs.h: add missing const modifier
Hans Verkuil [Fri, 8 Jul 2016 08:36:26 +0000 (05:36 -0300)]
[media] cec-funcs.h: add missing const modifier

The cec_ops_* functions never touch cec_msg, so mark it as const.

This was done for some of the cec_ops_ functions, but not all.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cec-funcs.h: add length checks
Hans Verkuil [Wed, 6 Jul 2016 08:49:26 +0000 (05:49 -0300)]
[media] cec-funcs.h: add length checks

Add msg->len sanity checks to fix static checker warning:

include/linux/cec-funcs.h:1154 cec_ops_set_osd_string()
warn: setting length 'msg->len - 3' to negative one

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cec: fix Kconfig dependency problems
Hans Verkuil [Fri, 1 Jul 2016 10:33:10 +0000 (07:33 -0300)]
[media] cec: fix Kconfig dependency problems

- Use IS_REACHABLE(RC_CORE) instead of IS_ENABLED: if cec is built-in and
  RC_CORE is a module, then CEC can't reach the RC symbols.
- Both cec and cec-edid should be bool and use the same build 'mode' as
  MEDIA_SUPPORT (just as is done for the media controller code).
- Add a note to staging that this should be changed once the cec framework
  is moved out of staging.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cec: add MEDIA_SUPPORT dependency
Arnd Bergmann [Wed, 29 Jun 2016 14:26:35 +0000 (11:26 -0300)]
[media] cec: add MEDIA_SUPPORT dependency

The MEDIA_CEC_EDID option is guarded by MEDIA_SUPPORT, so selecting
it from MEDIA_CEC produces a warning:

warning: (MEDIA_CEC) selects MEDIA_CEC_EDID which has unmet direct dependencies (MEDIA_SUPPORT)

The warning is harmless, but it's better to add an explicit
dependency to shut it up, to reduce the noise during randconfig
builds.

Fixes: ca684386e6e2 ("[media] cec: add HDMI CEC framework (api)")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] s5p_cec: mark suspend/resume as __maybe_unused
Arnd Bergmann [Wed, 29 Jun 2016 14:26:34 +0000 (11:26 -0300)]
[media] s5p_cec: mark suspend/resume as __maybe_unused

The suspend/resume functions in the s5p-cec driver are only
referenced when CONFIG_PM is enabled, so we get a warning
about unused functions otherwise:

drivers/staging/media/s5p-cec/s5p_cec.c:260:12: error: 's5p_cec_resume' defined but not used [-Werror=unused-function]
 static int s5p_cec_resume(struct device *dev)
            ^~~~~~~~~~~~~~
drivers/staging/media/s5p-cec/s5p_cec.c:253:12: error: 's5p_cec_suspend' defined but not used [-Werror=unused-function]
 static int s5p_cec_suspend(struct device *dev)

This marks them as __maybe_unused to avoid the warning without
having to introduce an extra #ifdef.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cec-adap: prevent write to out-of-bounds array index
Hans Verkuil [Thu, 30 Jun 2016 10:08:53 +0000 (07:08 -0300)]
[media] cec-adap: prevent write to out-of-bounds array index

CEC_MSG_REPORT_PHYSICAL_ADDR can theoretically be received from
an unregistered device, but in that case the code should not attempt
to write the received physical address to the phys_addrs array.

That would be pointless since there can be multiple unregistered
devices that report a physical address. We just ignore those.

While at it, improve the dprintk since it would attempt to read
from that array as well with the same out-of-bounds problem.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cec.h/cec-funcs.h: add option to use BSD license
Hans Verkuil [Thu, 30 Jun 2016 10:01:41 +0000 (07:01 -0300)]
[media] cec.h/cec-funcs.h: add option to use BSD license

Like the videodev2.h and other headers, explicitly allow these headers
to be used with the BSD license.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cec-adap: on reply, restore the tx_status value from the transmit
Hans Verkuil [Sun, 26 Jun 2016 09:57:56 +0000 (06:57 -0300)]
[media] cec-adap: on reply, restore the tx_status value from the transmit

When a reply to an earlier transmit is received, the tx_status of that
transmit needs to be restored. Otherwise the status that the transmit
was successful would be lost.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] rc-cec: Add HDMI CEC keymap module
Kamil Debski [Mon, 17 Aug 2015 11:47:41 +0000 (08:47 -0300)]
[media] rc-cec: Add HDMI CEC keymap module

Add the keymap module for HDMI CEC remote control commands.

Signed-off-by: Kamil Debski <kamil@wypas.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years agoMerge branch 'topic/cec' into patchwork
Mauro Carvalho Chehab [Fri, 8 Jul 2016 21:16:10 +0000 (18:16 -0300)]
Merge branch 'topic/cec' into patchwork

* topic/cec:
  [media] DocBook/media: add CEC documentation
  [media] s5p_cec: get rid of an unused var
  [media] move s5p-cec to staging
  [media] vivid: add CEC emulation
  [media] cec: s5p-cec: Add s5p-cec driver
  [media] cec: adv7511: add cec support
  [media] cec: adv7842: add cec support
  [media] cec: adv7604: add cec support
  [media] cec: add compat32 ioctl support
  [media] cec/TODO: add TODO file so we know why this is still in staging
  [media] cec: add HDMI CEC framework (api)
  [media] cec: add HDMI CEC framework (adapter)
  [media] cec: add HDMI CEC framework (core)
  [media] cec-funcs.h: static inlines to pack/unpack CEC messages
  [media] cec.h: add cec header
  [media] cec-edid: add module for EDID CEC helper functions
  [media] cec.txt: add CEC framework documentation
  [media] rc: Add HDMI CEC protocol handling

8 years agoMerge tag 'v4.7-rc6' into patchwork
Mauro Carvalho Chehab [Fri, 8 Jul 2016 21:14:03 +0000 (18:14 -0300)]
Merge tag 'v4.7-rc6' into patchwork

Linux 4.7-rc6

* tag 'v4.7-rc6': (1245 commits)
  Linux 4.7-rc6
  ovl: warn instead of error if d_type is not supported
  MIPS: Fix possible corruption of cache mode by mprotect.
  locks: use file_inode()
  usb: dwc3: st: Use explicit reset_control_get_exclusive() API
  phy: phy-stih407-usb: Use explicit reset_control_get_exclusive() API
  phy: miphy28lp: Inform the reset framework that our reset line may be shared
  namespace: update event counter when umounting a deleted dentry
  9p: use file_dentry()
  lockd: unregister notifier blocks if the service fails to come up completely
  ACPI,PCI,IRQ: correct operator precedence
  fuse: serialize dirops by default
  drm/i915: Fix missing unlock on error in i915_ppgtt_info()
  powerpc: Initialise pci_io_base as early as possible
  mfd: da9053: Fix compiler warning message for uninitialised variable
  mfd: max77620: Fix FPS switch statements
  phy: phy-stih407-usb: Inform the reset framework that our reset line may be shared
  usb: dwc3: st: Inform the reset framework that our reset line may be shared
  usb: host: ehci-st: Inform the reset framework that our reset line may be shared
  usb: host: ohci-st: Inform the reset framework that our reset line may be shared
  ...

8 years ago[media] media: rc: nuvoton: remove two unused elements in struct nvt_dev
Heiner Kallweit [Fri, 24 Jun 2016 05:40:02 +0000 (02:40 -0300)]
[media] media: rc: nuvoton: remove two unused elements in struct nvt_dev

These two fields are not used and can be removed.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: rc: nuvoton: remove unneeded check in nvt_get_rx_ir_data
Heiner Kallweit [Fri, 24 Jun 2016 05:39:55 +0000 (02:39 -0300)]
[media] media: rc: nuvoton: remove unneeded check in nvt_get_rx_ir_data

If the logical device is disabled then it can not generate interrupts.
Therefore this check is not needed.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: rc: nuvoton: simplify interrupt handling code
Heiner Kallweit [Fri, 24 Jun 2016 05:39:51 +0000 (02:39 -0300)]
[media] media: rc: nuvoton: simplify interrupt handling code

Simplify interupt handling code.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: rc: nuvoton: remove study states
Heiner Kallweit [Fri, 24 Jun 2016 05:39:45 +0000 (02:39 -0300)]
[media] media: rc: nuvoton: remove study states

Study states have never been used and are not needed. Remove them.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: rc: nuvoton: remove unneeded code in nvt_process_rx_ir_data
Heiner Kallweit [Fri, 24 Jun 2016 05:39:39 +0000 (02:39 -0300)]
[media] media: rc: nuvoton: remove unneeded code in nvt_process_rx_ir_data

The definition of rawir includes the initialization already.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: rc: nuvoton: simplify a few functions
Heiner Kallweit [Fri, 24 Jun 2016 05:39:28 +0000 (02:39 -0300)]
[media] media: rc: nuvoton: simplify a few functions

Simplify a few functions.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: rc: nuvoton: remove wake states
Heiner Kallweit [Fri, 24 Jun 2016 05:39:12 +0000 (02:39 -0300)]
[media] media: rc: nuvoton: remove wake states

Wake states have never been in use and now that we can set the
wakeup sequence via sysfs there's in general no need for them.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: rc: nuvoton: clean up initialization of wakeup registers
Heiner Kallweit [Fri, 24 Jun 2016 05:39:04 +0000 (02:39 -0300)]
[media] media: rc: nuvoton: clean up initialization of wakeup registers

The registers defining wakeup sequence handling are set when the
wakeup sequence is set via sysfs. There's no need to initialize them
otherwise.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: rc: nuvoton: remove interrupt handling for wakeup
Heiner Kallweit [Fri, 24 Jun 2016 05:38:54 +0000 (02:38 -0300)]
[media] media: rc: nuvoton: remove interrupt handling for wakeup

There is a rudimentary ISR for handling interrupts generated by the
wakeup part of the chip. Interrupts however have never been enabled
in the wakeup part.
Also, now that we can set the wakeup sequence via sysfs, there's in
general no need to enable interrupts in the wakeup part.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: rc: nuvoton: fix rx fifo overrun handling
Heiner Kallweit [Sun, 22 May 2016 13:43:40 +0000 (10:43 -0300)]
[media] media: rc: nuvoton: fix rx fifo overrun handling

To detect a rx fifo overrun it's checked whether the number of elements
in the chip fifo exceeds the fifo size. This check can never return true
and is wrong.
Instead we should generate an interrupt if the fifo overruns.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] rtl2832: do not allow driver unbind
Antti Palosaari [Wed, 29 Jun 2016 23:40:57 +0000 (20:40 -0300)]
[media] rtl2832: do not allow driver unbind

Disable runtime unbind as driver does not support it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] rtl2830: move statistics to read_status()
Antti Palosaari [Wed, 29 Jun 2016 23:40:56 +0000 (20:40 -0300)]
[media] rtl2830: move statistics to read_status()

Move statistics polling to read_status() in order to avoid use of
kernel work. Also replace home made sign extension used for
statistics with kernel sign_extend32().

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] rtl2830: do not allow driver unbind
Antti Palosaari [Wed, 29 Jun 2016 23:40:55 +0000 (20:40 -0300)]
[media] rtl2830: do not allow driver unbind

Disable runtime unbind as driver does not support it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] it913x: do not allow driver unbind
Antti Palosaari [Wed, 29 Jun 2016 23:40:23 +0000 (20:40 -0300)]
[media] it913x: do not allow driver unbind

Disable runtime unbind as driver does not support it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] af9033: do not allow driver unbind
Antti Palosaari [Wed, 29 Jun 2016 23:40:22 +0000 (20:40 -0300)]
[media] af9033: do not allow driver unbind

Disable runtime unbind as driver does not support it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] af9033: move statistics to read_status()
Antti Palosaari [Wed, 29 Jun 2016 23:40:21 +0000 (20:40 -0300)]
[media] af9033: move statistics to read_status()

Move statistics polling to read_status() in order to avoid use of
kernel work.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] m88ds3103: refactor firmware download
Antti Palosaari [Wed, 29 Jun 2016 23:39:48 +0000 (20:39 -0300)]
[media] m88ds3103: refactor firmware download

* remove some unneeded variable initialization
* rename variables
* use min() macro to calc max i2c xfer len
* change bad firmware error code from EFAULT to EINVAL

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] m88ds3103: use Hz instead of kHz on calculations
Antti Palosaari [Wed, 29 Jun 2016 23:39:47 +0000 (20:39 -0300)]
[media] m88ds3103: use Hz instead of kHz on calculations

There was some calculations where was kHz used in order to keep
calculation withing 32-bit. Convert all to Hz and use 64-bit
division helpers where needed.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] m88ds3103: improve ts clock setting
Antti Palosaari [Wed, 29 Jun 2016 23:39:46 +0000 (20:39 -0300)]
[media] m88ds3103: improve ts clock setting

Simplify TS clock divider calculation and programming slightly.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] m88ds3103: calculate DiSEqC message sending time
Antti Palosaari [Wed, 29 Jun 2016 23:39:45 +0000 (20:39 -0300)]
[media] m88ds3103: calculate DiSEqC message sending time

DiSEqC message sending takes 13.5 ms per byte, which is 54 ms total
when typical 4 byte message is sent. Don't hard-code time limit to
54 ms, but calculate it. Time limit is only used to determine when to
start poll "DiSEqC Tx ready" status from the chip.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] m88ds3103: remove useless most significant bit clear
Antti Palosaari [Wed, 29 Jun 2016 23:39:44 +0000 (20:39 -0300)]
[media] m88ds3103: remove useless most significant bit clear

No need to clear negative msb bits as those were dropped in any
case when data is written to register.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] si2157: do not allow driver unbind
Antti Palosaari [Wed, 29 Jun 2016 23:38:19 +0000 (20:38 -0300)]
[media] si2157: do not allow driver unbind

Disable runtime unbind as driver does not support it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] si2168: do not allow driver unbind
Antti Palosaari [Wed, 29 Jun 2016 23:38:18 +0000 (20:38 -0300)]
[media] si2168: do not allow driver unbind

Disable runtime unbind as driver does not support it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] si2168: add support for newer firmwares
Antti Palosaari [Wed, 29 Jun 2016 23:38:17 +0000 (20:38 -0300)]
[media] si2168: add support for newer firmwares

Si2168-B40 firmware API has changed somewhere between 4.0-11 and
4.0-19 so that sleep will lose firmware upgrade from the chip. Due
to that firmware re-upload is needed when newer firmwares are used.

Rewrote firmware handling logic partly at the same.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Cc: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] tw686x: make const structs static
Hans Verkuil [Fri, 1 Jul 2016 14:37:27 +0000 (11:37 -0300)]
[media] tw686x: make const structs static

Fix sparse warnings:

tw686x-video.c:148:29: warning: symbol 'memcpy_dma_ops' was not declared. Should it be static?
tw686x-video.c:195:29: warning: symbol 'contig_dma_ops' was not declared. Should it be static?
tw686x-video.c:361:29: warning: symbol 'sg_dma_ops' was not declared. Should it be static?

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] adv7604: Add support for hardware reset
Dragos Bogdan [Wed, 22 Jun 2016 11:30:42 +0000 (08:30 -0300)]
[media] adv7604: Add support for hardware reset

The part can be reset by a low pulse on the RESET pin (i.e. a hardware
reset) with a minimum width of 5 ms. It is recommended to wait 5 ms
after the low pulse before an I2C write is performed to the part.
For safety reasons, the delays will be between 5 and 10 ms.

The RESET pin can be tied high, so the GPIO is optional.

Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] ddbridge: Replace vmalloc with vzalloc
Amitoj Kaur Chawla [Mon, 20 Jun 2016 05:55:52 +0000 (02:55 -0300)]
[media] ddbridge: Replace vmalloc with vzalloc

vzalloc combines vmalloc and memset 0.

The Coccinelle semantic patch used to make this change is as follows:
@@
type T;
T *d;
expression e;
statement S;
@@

        d =
-            vmalloc
+            vzalloc
             (...);
        if (!d) S
-       memset(d, 0, sizeof(T));

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] dvb: use ktime_t for internal timeout
Arnd Bergmann [Fri, 17 Jun 2016 20:46:28 +0000 (17:46 -0300)]
[media] dvb: use ktime_t for internal timeout

The dvb demuxer code uses a 'struct timespec' to pass a timeout
as absolute time. This will cause problems on 32-bit architectures
in 2038 when time_t overflows, and it is racy with a concurrent
settimeofday() call.

This patch changes the code to use ktime_get() instead, using
the monotonic time base to avoid both the race and the overflow.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: coda: Fix probe() if reset controller is missing
Alexander Shiyan [Sat, 18 Jun 2016 14:45:15 +0000 (11:45 -0300)]
[media] media: coda: Fix probe() if reset controller is missing

Commit 39b4da71ca33 ("reset: use ENOTSUPP instead of ENOSYS") changed
return value for reset controller if it missing.

This patch changes the CODA driver to handle this value.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] V4L: fix the Z16 format definition
Guennadi Liakhovetski [Fri, 17 Jun 2016 17:38:01 +0000 (14:38 -0300)]
[media] V4L: fix the Z16 format definition

A copy paste error created that format with the same one-line
description as Y8I and Y12I, whereas Z16 is quite different from them
both.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] vb2: Fix comment
Ricardo Ribalda [Mon, 20 Jun 2016 12:47:25 +0000 (09:47 -0300)]
[media] vb2: Fix comment

The comment was referencing the wrong function.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] vb2: Merge vb2_internal_qbuf and vb2_qbuf
Ricardo Ribalda [Mon, 20 Jun 2016 12:47:24 +0000 (09:47 -0300)]
[media] vb2: Merge vb2_internal_qbuf and vb2_qbuf

After all the code refactoring, vb2_internal_qbuf is only called by
vb2_qbuf.

Since the function it is very simple, there is no need to have
two functions.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] vb2: Merge vb2_internal_dqbuf and vb2_dqbuf
Ricardo Ribalda [Mon, 20 Jun 2016 12:47:23 +0000 (09:47 -0300)]
[media] vb2: Merge vb2_internal_dqbuf and vb2_dqbuf

After all the code refactoring, vb2_internal_dqbuf is only called by
vb2_dqbuf.

Since the function it is very simple, there is no need to have two
functions.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] vb2: V4L2_BUF_FLAG_DONE is set after DQBUF
Ricardo Ribalda [Mon, 20 Jun 2016 12:47:22 +0000 (09:47 -0300)]
[media] vb2: V4L2_BUF_FLAG_DONE is set after DQBUF

According to the doc, V4L2_BUF_FLAG_DONE is cleared after DQBUF:

V4L2_BUF_FLAG_DONE 0x00000004  ... After calling the VIDIOC_QBUF or
VIDIOC_DQBUF it is always cleared ...

Unfortunately, it seems that videobuf2 keeps it set after DQBUF. This
can be tested with vivid and dev_debug:

[257604.338082] video1: VIDIOC_DQBUF: 71:33:25.00260479 index=3,
type=vid-cap, flags=0x00002004, field=none, sequence=163,
memory=userptr, bytesused=460800, offset/userptr=0x344b000,
length=460800

This patch forces FLAG_DONE to 0 after calling DQBUF.

Reported-by: Dimitrios Katsaros <patcherwork@gmail.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] sur40: drop unnecessary format description
Hans Verkuil [Mon, 27 Jun 2016 10:25:43 +0000 (07:25 -0300)]
[media] sur40: drop unnecessary format description

Don't fill in the format description. This is now done in the V4L2 core to ensure
consistent descriptions.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Nick Dyer <nick.dyer@itdev.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] usbtv: improve a comment
Lubomir Rintel [Wed, 1 Jun 2016 13:04:07 +0000 (10:04 -0300)]
[media] usbtv: improve a comment

Patrick Keshishian improved the explanation of the protocol when porting
the driver to OpenBSD. Given it's a reverse engineering one and there's
no documetnation it might be helpful to whoever hacks on the driver.

Signed-off-by: Patrick Keshishian <sidster@boxsoft.com>
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] usbtv: clarify the licensing
Lubomir Rintel [Wed, 1 Jun 2016 13:03:44 +0000 (10:03 -0300)]
[media] usbtv: clarify the licensing

OpenBSD would like to reuse some code but consider the licensing not
clear enough. Let's clarify it a bit so that it suits their conventions:

1.) Keep the "extra text" away from the copyright statement and the
rights grant.

2.) Add the warranty disclaimer -- it should not be legally required,
nevertheless the clause 1. of the rights grant refest to it.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Acked-by: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] sur40: fix occasional oopses on device close
Florian Echtler [Tue, 31 May 2016 20:15:33 +0000 (17:15 -0300)]
[media] sur40: fix occasional oopses on device close

Closing the V4L2 device sometimes triggers a kernel oops.
Present patch fixes this.

Signed-off-by: Martin Kaltenbrunner <modin@yuri.at>
Signed-off-by: Florian Echtler <floe@butterbrot.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org> # for v4.2 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] sur40: lower poll interval to fix occasional FPS drops to ~56 FPS
Florian Echtler [Tue, 31 May 2016 20:15:32 +0000 (17:15 -0300)]
[media] sur40: lower poll interval to fix occasional FPS drops to ~56 FPS

The framerate sometimes drops below 60 Hz if the poll interval is too high.
Lowering it to the minimum of 1 ms fixes this.

Signed-off-by: Martin Kaltenbrunner <modin@yuri.at>
Signed-off-by: Florian Echtler <floe@butterbrot.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org> # for v4.2 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] DocBook: mention the memory type to be set for all streaming I/O
Javier Martinez Canillas [Tue, 31 May 2016 16:56:08 +0000 (13:56 -0300)]
[media] DocBook: mention the memory type to be set for all streaming I/O

The DMA buffer importing streaming I/O section mentions the memory type
value that has to be set when calling the VIDIOC_REQBUFS ioctl but this
isn't mentioned in neither the Memory Mapping nor User Pointer sections.

A user can know the values by looking at the examples but it's better
to explicitly mention in the documentation, and also makes all sections
about streaming I/O methods more consistent.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] DocBook: add dmabuf as streaming I/O in VIDIOC_REQBUFS description
Javier Martinez Canillas [Tue, 31 May 2016 16:56:07 +0000 (13:56 -0300)]
[media] DocBook: add dmabuf as streaming I/O in VIDIOC_REQBUFS description

Commit 4b9c1cb641c46 ("[media] Documentation: media: description of DMABUF
importing in V4L2") documented the V4L2 dma-buf importing support but did
not update the VIDIOC_REQBUFS description, so only the Memory Mapping and
User Pointer I/O methods are mentioned.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] saa7164: Replace if and BUG with BUG_ON
Amitoj Kaur Chawla [Sat, 28 May 2016 16:43:39 +0000 (13:43 -0300)]
[media] saa7164: Replace if and BUG with BUG_ON

Replace if condition and BUG() with a BUG_ON having the conditional
expression of the if statement as argument.

The Coccinelle semantic patch used to make this change is as follows:
@@ expression E,f; @@

(
  if (<+... f(...) ...+>) { BUG(); }
|
- if (E) { BUG(); }
+ BUG_ON(E);
)

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] bt8xx: remove needless module refcounting
Alexey Khoroshilov [Fri, 8 Apr 2016 23:09:49 +0000 (20:09 -0300)]
[media] bt8xx: remove needless module refcounting

It is responsibility of a caller of fops->open(),
to make sure an owner of the fops is available until file is closed.
So, there is no need to lock THIS_MODULE explicitly.

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@s-opensource.com>
8 years ago[media] rc-main: fix kernel oops after unloading keymap module
Hans Verkuil [Sun, 26 Jun 2016 10:44:56 +0000 (07:44 -0300)]
[media] rc-main: fix kernel oops after unloading keymap module

When the rc_map table is created the char pointer of the name of the keymap
is copied to the rc_map->name field. However, this pointer points to memory
from the keymap module itself.

Since these keymap modules are not refcounted, that means anyone can call
rmmod to unload that module. Which is not a big deal because the contents of
the map is all copied to rc_map, except for the keymap name.

So after a keymap module is unloaded the name pointer has become stale. Unloading
the rc-core module will now cause a kernel oops in rc_dev_uevent().

The solution is to kstrdup the name so there are no more references to the
keymap module remaining.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-tpg: ignore V4L2_DV_RGB_RANGE setting for YUV formats
Hans Verkuil [Tue, 28 Jun 2016 14:14:19 +0000 (11:14 -0300)]
[media] v4l2-tpg: ignore V4L2_DV_RGB_RANGE setting for YUV formats

The V4L2_DV_RGB_RANGE_* settings are, as the name says, for RGB formats only.
So they should be ignored for non-RGB formats.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] drivers/media/platform/Kconfig: fix VIDEO_MEDIATEK_VCODEC dependency
Hans Verkuil [Fri, 8 Jul 2016 19:11:19 +0000 (16:11 -0300)]
[media] drivers/media/platform/Kconfig: fix VIDEO_MEDIATEK_VCODEC dependency

Allow VIDEO_MEDIATEK_VCODEC to build when COMPILE_TEST is set (even
without MTK_IOMMU).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] mtk-vcodec: convert driver to use the new vb2_queue dev field
Hans Verkuil [Fri, 8 Jul 2016 19:11:18 +0000 (16:11 -0300)]
[media] mtk-vcodec: convert driver to use the new vb2_queue dev field

The patch dropping the vb2_dma_contig_init_ctx() and _cleanup_ctx()
functions was already applied before this driver was added. So convert
this driver as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] gspca: avoid unused variable warnings
Arnd Bergmann [Mon, 4 Jul 2016 13:21:40 +0000 (10:21 -0300)]
[media] gspca: avoid unused variable warnings

When CONFIG_INPUT is disabled, multiple gspca backend drivers
print compile-time warnings about unused variables:

media/usb/gspca/cpia1.c: In function 'sd_stopN':
media/usb/gspca/cpia1.c:1627:13: error: unused variable 'sd' [-Werror=unused-variable]
media/usb/gspca/konica.c: In function 'sd_stopN':
media/usb/gspca/konica.c:246:13: error: unused variable 'sd' [-Werror=unused-variable]

This annotates the variables as __maybe_unused, to let the compiler
know that they are declared intentionally.

Fixes: ee186fd96a5f ("[media] gscpa_t613: Add support for the camera button")
Fixes: c2f644aeeba3 ("[media] gspca_cpia1: Add support for button")
Fixes: b517af722860 ("V4L/DVB: gspca_konica: New gspca subdriver for konica chipset using cams")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] gspca: correct speed testing
Oliver Neukum [Mon, 2 May 2016 11:22:26 +0000 (08:22 -0300)]
[media] gspca: correct speed testing

Allow for SS+ devices

Signed-off-by: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] MAINTAINERS: change maintainer for gscpa/pwc/radio-shark
Hans Verkuil [Mon, 4 Jul 2016 13:18:10 +0000 (10:18 -0300)]
[media] MAINTAINERS: change maintainer for gscpa/pwc/radio-shark

Hans de Goede has no more time to work on those, so I'll take over.
For gspca/pwc I'll do 'Odd Fixes', for radio-shark I'll be a
full maintainer.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] hdpvr: Remove deprecated create_singlethread_workqueue
Bhaktipriya Shridhar [Sat, 2 Jul 2016 10:47:31 +0000 (07:47 -0300)]
[media] hdpvr: Remove deprecated create_singlethread_workqueue

The workqueue "workqueue" is involved in transmitting hdpvr buffers.
It has a single work item(&dev->worker) and hence doesn't require
ordering. Also, it is not being used on a memory reclaim path. Hence,
the singlethreaded workqueue has been replaced with the use of system_wq.

System workqueues have been able to handle high level of concurrency
for a long time now and hence it's not required to have a singlethreaded
workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue
created with create_singlethread_workqueue(), system_wq allows multiple
work items to overlap executions even on the same CPU; however, a
per-cpu workqueue doesn't have any CPU locality or global ordering
guarantee unless the target CPU is explicitly specified and thus the
increase of local concurrency shouldn't make any difference.

Work item has been flushed in hdpvr_device_release() to ensure
that there are no pending tasks while disconnecting the driver.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] adv7604: Remove deprecated create_singlethread_workqueue
Bhaktipriya Shridhar [Sat, 2 Jul 2016 10:43:55 +0000 (07:43 -0300)]
[media] adv7604: Remove deprecated create_singlethread_workqueue

The workqueue "work_queues" enables hotplugging.
It has a single work item(&state->delayed_work_enable_hotplug) and hence
doesn't require ordering. Also, it is not being used on a memory
reclaim path. Hence, the singlethreaded workqueue has been replaced with
the use of system_wq.

System workqueues have been able to handle high level of concurrency
for a long time now and hence it's not required to have a singlethreaded
workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue
created with create_singlethread_workqueue(), system_wq allows multiple
work items to overlap executions even on the same CPU; however, a
per-cpu workqueue doesn't have any CPU locality or global ordering
guarantee unless the target CPU is explicitly specified and thus the
increase of local concurrency shouldn't make any difference.

Work item has been sync cancelled in adv76xx_remove() to ensure
that there are no pending tasks while disconnecting the driver.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] tc358743: Remove deprecated create_singlethread_workqueue
Bhaktipriya Shridhar [Sat, 2 Jul 2016 10:41:53 +0000 (07:41 -0300)]
[media] tc358743: Remove deprecated create_singlethread_workqueue

The workqueue "work_queues" enables hotplugging.
It has a single work item(&state->delayed_work_enable_hotplug) and hence
doesn't require ordering. Also, it is not being used on a memory
reclaim path. Hence, the singlethreaded workqueue has been replaced with
the use of system_wq.

System workqueues have been able to handle high level of concurrency
for a long time now and hence it's not required to have a singlethreaded
workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue
created with create_singlethread_workqueue(), system_wq allows multiple
work items to overlap executions even on the same CPU; however, a
per-cpu workqueue doesn't have any CPU locality or global ordering
guarantee unless the target CPU is explicitly specified and thus the
increase of local concurrency shouldn't make any difference.

Work item has been sync cancelled in tc358743_remove() to ensure
that there are no pending tasks while disconnecting the driver.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] adv7842: Remove deprecated create_singlethread_workqueue
Bhaktipriya Shridhar [Sat, 2 Jul 2016 10:37:22 +0000 (07:37 -0300)]
[media] adv7842: Remove deprecated create_singlethread_workqueue

The workqueue "work_queues" enables hotplugging.
It has a single work item(&state->delayed_work_enable_hotplug) and hence
doesn't require ordering. Also, it is not being used on a memory
reclaim path. Hence, the singlethreaded workqueue has been replaced with
the use of system_wq.

System workqueues have been able to handle high level of concurrency
for a long time now and hence it's not required to have a singlethreaded
workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue
created with create_singlethread_workqueue(), system_wq allows multiple
work items to overlap executions even on the same CPU; however, a
per-cpu workqueue doesn't have any CPU locality or global ordering
guarantee unless the target CPU is explicitly specified and thus the
increase of local concurrency shouldn't make any difference.

Work item has been sync cancelled in adv7842_remove() to ensure
that there are no pending tasks while disconnecting the driver.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] sn9c20x: Remove deprecated create_singlethread_workqueue
Bhaktipriya Shridhar [Sat, 2 Jul 2016 10:51:22 +0000 (07:51 -0300)]
[media] sn9c20x: Remove deprecated create_singlethread_workqueue

The workqueue "work_thread" is involved in JPEG quality update.
It has a single work item(&sd->work) and hence doesn't require ordering.
Also, it is not being used on a memory reclaim path. Hence, the
singlethreaded workqueue has been replaced with the use of system_wq.

System workqueues have been able to handle high level of concurrency
for a long time now and hence it's not required to have a singlethreaded
workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue
created with create_singlethread_workqueue(), system_wq allows multiple
work items to overlap executions even on the same CPU; however, a
per-cpu workqueue doesn't have any CPU locality or global ordering
guarantee unless the target CPU is explicitly specified and thus the
increase of local concurrency shouldn't make any difference.

Work item has been flushed in sd_stop0() to ensure that there are no
pending tasks while disconnecting the driver.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] gspca: fix a v4l2-compliance failure about buffer timestamp
Antonio Ospite [Wed, 9 Mar 2016 16:03:19 +0000 (13:03 -0300)]
[media] gspca: fix a v4l2-compliance failure about buffer timestamp

v4l2-compliance fails with this message:

  fail: v4l2-test-buffers.cpp(250): \
      timestamp != V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC && \
      timestamp != V4L2_BUF_FLAG_TIMESTAMP_COPY
  ...
  test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL

When setting the frame time, gspca uses v4l2_get_timestamp() which uses
ktime_get_ts() which uses ktime_get_ts64() which returns a monotonic
timestamp, so it's safe to initialize the buffer flags to
V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC to fix the failure.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] gspca: fix a v4l2-compliance failure about VIDIOC_ENUM_FRAMEINTERVALS
Antonio Ospite [Wed, 9 Mar 2016 16:03:18 +0000 (13:03 -0300)]
[media] gspca: fix a v4l2-compliance failure about VIDIOC_ENUM_FRAMEINTERVALS

According to v4l2-compliance VIDIOC_ENUM_FRAMEINTERVALS should fail for
unsupported frame sizes, but gspca is too tolerant and tries to find
the frame intervals for the frame size nearest to the requested one.

This makes v4l2-compliance fail with this message:

  fail: v4l2-test-formats.cpp(123): \
      found frame intervals for invalid size 321x240
  test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: FAIL

Fix this by using an exact match for the frame size when enumerating
frame intervals, and retuning an error if the frame size for which the
frame intervals have been asked is not supported.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] gspca: rename wxh_to_mode() to wxh_to_nearest_mode()
Antonio Ospite [Wed, 9 Mar 2016 16:03:17 +0000 (13:03 -0300)]
[media] gspca: rename wxh_to_mode() to wxh_to_nearest_mode()

The name wxh_to_nearest_mode() reflects better what the function does.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] gspca: fix setting frame interval type in vidioc_enum_frameintervals()
Antonio Ospite [Wed, 9 Mar 2016 16:03:16 +0000 (13:03 -0300)]
[media] gspca: fix setting frame interval type in vidioc_enum_frameintervals()

Set the frame _interval_ type to V4L2_FRMIVAL_TYPE_DISCRETE instead of
using V4L2_FRMSIZE_TYPE_DISCRETE which is meant for frame _size_.

The old and new values happen to be the same so there is no functional
change.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] gspca: ov534/topro: use a define for the default framerate
Antonio Ospite [Wed, 9 Mar 2016 16:03:15 +0000 (13:03 -0300)]
[media] gspca: ov534/topro: use a define for the default framerate

When writing the change in commit dcc7fdbec53a ("[media] gspca:
ov534/topro: prevent a division by 0") I used magic numbers for the
default framerate to minimize the code footprint to make it easier to
backport the patch to the stable trees.

However it's better if the default framerate has its own define to avoid
risking using different values in different places, and for readability.

While at it also remove some trivial comments about the framerates which
don't add much to the code anymore.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] pwc: hide unused label
Arnd Bergmann [Tue, 26 Jan 2016 16:17:24 +0000 (14:17 -0200)]
[media] pwc: hide unused label

The pwc driver causes a warning when CONFIG_USB_PWC_INPUT_EVDEV is unset:

drivers/media/usb/pwc/pwc-if.c: In function 'usb_pwc_probe':
drivers/media/usb/pwc/pwc-if.c:1115:1: warning: label 'err_video_unreg' defined but not used [-Wunused-label]

This moves the unused label and code inside another #ifdef to
get rid of the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] vb2: replace void *alloc_ctxs by struct device *alloc_devs
Hans Verkuil [Fri, 15 Apr 2016 12:15:05 +0000 (09:15 -0300)]
[media] vb2: replace void *alloc_ctxs by struct device *alloc_devs

Make this a proper typed array. Drop the old allocate context code since
that is no longer used.

Note that the memops functions now get a struct device pointer instead of
the struct device ** that was there initially (actually a void pointer to
a struct containing only a struct device pointer).

This code is now a lot cleaner.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media/platform: convert drivers to use the new vb2_queue dev field
Hans Verkuil [Tue, 16 Feb 2016 09:30:19 +0000 (07:30 -0200)]
[media] media/platform: convert drivers to use the new vb2_queue dev field

Stop using alloc_ctx and just fill in the device pointer.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>