cascardo/linux.git
8 years agomedia: au0828 disable tuner to demod link in au0828_media_device_register()
Shuah Khan [Thu, 10 Mar 2016 02:15:38 +0000 (19:15 -0700)]
media: au0828 disable tuner to demod link in au0828_media_device_register()

Disable tuner to demod link in au0828_media_device_register(). This step
should be done after dvb graph is created.

[mchehab@osg.samsung.com: Solve conflictst to apply it upstream]
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] touptek: cast char types on %x printk
Mauro Carvalho Chehab [Sun, 6 Mar 2016 13:15:24 +0000 (10:15 -0300)]
[media] touptek: cast char types on %x printk

This fixes those two smatch warnings:
drivers/media/usb/gspca/touptek.c:206 val_reply() warn: argument 3 to %02x specifier has type 'char'
drivers/media/usb/gspca/touptek.c:222 reg_w() warn: argument 4 to %02x specifier has type 'char'

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] touptek: don't DMA at the stack
Mauro Carvalho Chehab [Sun, 6 Mar 2016 13:12:32 +0000 (10:12 -0300)]
[media] touptek: don't DMA at the stack

As warned by smatch:
drivers/media/usb/gspca/touptek.c:220 reg_w() error: doing dma on the stack (buff)
drivers/media/usb/gspca/touptek.c:458 configure() error: doing dma on the stack (buff)

This can fail, as the stack may not be in a memory that would
allod DMA. So, use the usb_buf instead.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] mceusb: use %*ph for small buffer dumps
Mauro Carvalho Chehab [Sun, 6 Mar 2016 13:00:09 +0000 (10:00 -0300)]
[media] mceusb: use %*ph for small buffer dumps

It makes the printk cleaner. As a side efect, it also fixes those smatch
warnings:
drivers/media/rc/mceusb.c:590 mceusb_dev_printdata() warn: argument 6 to %02x specifier has type 'char'
drivers/media/rc/mceusb.c:590 mceusb_dev_printdata() warn: argument 7 to %02x specifier has type 'char'

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: exynos4-is: Drop unneeded check when setting up fimc-lite links
Laurent Pinchart [Tue, 1 Mar 2016 09:31:53 +0000 (06:31 -0300)]
[media] v4l: exynos4-is: Drop unneeded check when setting up fimc-lite links

The driver verifies that the type of the remote entity matches its
expectations when setting up fimc-lite links and returns an error if it
doesn't. Those checks can never fail as the links are created by the
driver in a way that always match its expectations (the SINK and
SOURCE_ISP pads are connected to subdevs only and the SOURCE_DMA pad is
connected to a video node only). Remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Check if an entity is a subdev with the right function
Laurent Pinchart [Tue, 1 Mar 2016 09:27:10 +0000 (06:27 -0300)]
[media] v4l: vsp1: Check if an entity is a subdev with the right function

Use is_media_entity_v4l2_subdev() instead of is_media_entity_v4l2_io()
to check whether the entity is a subdev.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] hide unused functions for !MEDIA_CONTROLLER
Arnd Bergmann [Sat, 5 Mar 2016 00:06:43 +0000 (21:06 -0300)]
[media] hide unused functions for !MEDIA_CONTROLLER

Some functions in the au0828 driver are only used when CONFIG_MEDIA_CONTROLLER
is enabled, and otherwise defined as empty functions:

media/usb/au0828/au0828-core.c:208:13: error: 'au0828_media_graph_notify' defined but not used [-Werror=unused-function]
media/usb/au0828/au0828-core.c:262:12: error: 'au0828_enable_source' defined but not used [-Werror=unused-function]
media/usb/au0828/au0828-core.c:412:13: error: 'au0828_disable_source' defined but not used [-Werror=unused-function]

This moves the #ifdef so the entire definitions are hidden in this case.

[mchehab@osg.samsung.com: As pointed by Shuah Khan, a return 0 can be removed]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] em28xx: fix Terratec Grabby AC97 codec detection
Matthieu Rogez [Fri, 4 Mar 2016 21:33:08 +0000 (18:33 -0300)]
[media] em28xx: fix Terratec Grabby AC97 codec detection

EMP202 chip inside Terratec Grabby (hw rev 2) seems to require some time
before accessing reliably its registers. Otherwise it returns some values
previously put on the I2C bus.

To account for that period, we delay card setup until we have a proof that
accessing AC97 registers is reliable. We get this proof by polling
AC97_RESET until the expected value is read. We also check that unrelated
registers don't return the same value. This second check handles the case
where the expected value is constantly returned no matter which register
is accessed.

Signed-off-by: Matthieu Rogez <matthieu.rogez@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: add prefixes to interface types
Shuah Khan [Fri, 4 Mar 2016 21:14:05 +0000 (18:14 -0300)]
[media] media: add prefixes to interface types

Add missing prefixes for DVB, V4L, and ALSA interface types.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: rc: nuvoton: switch attribute wakeup_data to text
Heiner Kallweit [Fri, 4 Mar 2016 19:11:40 +0000 (16:11 -0300)]
[media] media: rc: nuvoton: switch attribute wakeup_data to text

Switch attribute wakeup_data from binary to a text attribute.
This makes it easier to handle in userspace and allows to
use the output of tools like mode2 almost as is to set a
wakeup sequence.
Changing to a text format and values in microseconds also
makes the userspace interface independent of the setting of
SAMPLE_PERIOD in the driver.

In addition document the new sysfs attribute in
Documentation/ABI/testing/sysfs-class-rc-nuvoton.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l2-ioctl: fix YUV422P pixel format description
Philipp Zabel [Fri, 4 Mar 2016 16:03:00 +0000 (13:03 -0300)]
[media] v4l2-ioctl: fix YUV422P pixel format description

The plane order is YUV, not YVU.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: fix null pointer dereference in v4l_vb2q_enable_media_source()
Shuah Khan [Fri, 4 Mar 2016 02:24:58 +0000 (23:24 -0300)]
[media] media: fix null pointer dereference in v4l_vb2q_enable_media_source()

Fix the null pointer dereference in v4l_vb2q_enable_media_source().
DVB only drivers don't have valid struct v4l2_fh pointer.

[  548.443272] BUG: unable to handle kernel NULL pointer dereference
at 0000000000000010
[  548.452036] IP: [<ffffffffc020ffc9>]
v4l_vb2q_enable_media_source+0x9/0x50 [videodev]
[  548.460792] PGD b820e067 PUD bb3df067 PMD 0
[  548.465582] Oops: 0000 [#1] SMP

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Reported-by: Olli Salonen <olli.salonen@iki.fi>
Tested-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l2-mc.h: fix yet more compiler errors
Hans Verkuil [Fri, 4 Mar 2016 08:46:58 +0000 (05:46 -0300)]
[media] v4l2-mc.h: fix yet more compiler errors

The newly added functions have an extra semicolon, which
prevents compilation, and they need to be marked inline:

In file included from ../include/media/tuner.h:23:0,
                 from ../drivers/media/tuners/tuner-simple.c:10:
../include/media/v4l2-mc.h:233:1: error: expected identifier or '(' before '{' token

Remove spurious return, remove copy-and-pasted semi-colons, add static
inline.

Fixes: a77bf7048add ("v4l2-mc.h: Add stubs for the V4L2 PM/pipeline routines")

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] staging/media: add missing TODO files
Hans Verkuil [Thu, 3 Mar 2016 11:24:40 +0000 (08:24 -0300)]
[media] staging/media: add missing TODO files

Add TODO files for mx2/mx3/omap1 to explain the status of these drivers
and what needs to be done in order to keep them from being removed soon.

Also a small fix for the mx2/Kconfig that mistakingly mentioned a vb2
conversion. That's not needed for that driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media.h: always start with 1 for the audio entities
Hans Verkuil [Thu, 3 Mar 2016 13:47:33 +0000 (10:47 -0300)]
[media] media.h: always start with 1 for the audio entities

Start the audio defines with BASE + 0x03001 instead of 0x03000. This is consistent
with the other defines, and I think it is good practice not to start with 0, just in
case we want to do something like (id & 0xfff) in the future and treat the value 0
as a special case.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Suggested-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] sound/usb: Use meaninful names for goto labels
Shuah Khan [Thu, 3 Mar 2016 16:51:26 +0000 (13:51 -0300)]
[media] sound/usb: Use meaninful names for goto labels

Fix to use meaningful names instead of numbered goto labels

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l2-mc.h: fix compiler warnings
Hans Verkuil [Thu, 3 Mar 2016 07:37:14 +0000 (04:37 -0300)]
[media] v4l2-mc.h: fix compiler warnings

Fix these warnings when CONFIG_MEDIA_CONTROLLER is not defined:

In file included from drivers/media/v4l2-core/v4l2-fh.c:32:0:
include/media/v4l2-mc.h:173:12: warning: 'v4l_enable_media_source' defined but not used [-Wunused-function]
 static int v4l_enable_media_source(struct video_device *vdev)
            ^
include/media/v4l2-mc.h:183:12: warning: 'v4l_vb2q_enable_media_source' defined but not used [-Wunused-function]
 static int v4l_vb2q_enable_media_source(struct vb2_queue *q)
            ^
In file included from include/media/tuner.h:23:0,
                 from drivers/media/tuners/tuner-types.c:9:
include/media/v4l2-mc.h:173:12: warning: 'v4l_enable_media_source' defined but not used [-Wunused-function]
 static int v4l_enable_media_source(struct video_device *vdev)
            ^
include/media/v4l2-mc.h:178:13: warning: 'v4l_disable_media_source' defined but not used [-Wunused-function]
 static void v4l_disable_media_source(struct video_device *vdev)
             ^

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828 audio mixer isn't connected to decoder
Shuah Khan [Thu, 3 Mar 2016 03:38:19 +0000 (00:38 -0300)]
[media] media: au0828 audio mixer isn't connected to decoder

When snd_usb_audio gets probed first, audio mixer doesn't get linked to
the decoder.

Change au0828_media_graph_notify() to handle the mixer entity getting
registered before the decoder.

Change au0828_media_device_register() to invoke
au0828_media_graph_notify() to connect entites that were created prior
to registering the notify handler.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Reported-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] sound/usb: Use Media Controller API to share media resources
Shuah Khan [Wed, 2 Mar 2016 16:50:31 +0000 (13:50 -0300)]
[media] sound/usb: Use Media Controller API to share media resources

Change ALSA driver to use Media Controller API to share media resources
with DVB and V4L2 drivers on a AU0828 media device. Media Controller
specific initialization is done after sound card is registered. ALSA
creates Media interface and entity function graph nodes for Control,
Mixer, PCM Playback, and PCM Capture devices.

snd_usb_hw_params() will call Media Controller enable source handler
interface to request the media resource. If resource request is
granted, it will release it from snd_usb_hw_free(). If resource is
busy, -EBUSY is returned.

Media specific cleanup is done in usb_audio_disconnect().

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] dw2102: add support for TeVii S662
Olli Salonen [Wed, 2 Mar 2016 11:06:06 +0000 (08:06 -0300)]
[media] dw2102: add support for TeVii S662

TeVii S662 is a USB 2.0 DVB-S2 tuner that's identical to TechnoTrend
S2-4600 tuner. Add the USB ID to dw2102 driver.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] dw2102: ts2020 included twice
Olli Salonen [Wed, 2 Mar 2016 11:06:05 +0000 (08:06 -0300)]
[media] dw2102: ts2020 included twice

ts2020.h was already included a few lines earlier. Remove the unnecessary entry.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] dvb-core: fix return code checking for devices with CA
Olli Salonen [Tue, 1 Mar 2016 19:28:54 +0000 (16:28 -0300)]
[media] dvb-core: fix return code checking for devices with CA

The test for the return code was mistakenly inverted. This caused DVB
devices with CA module to fail on modprobe.

Tested with TechnoTrend CT2-4650 CI USB tuner.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] Staging: media/lirc: lirc_zilog.c : fixed a string split in multi-line issue
RitwikGopi [Tue, 1 Mar 2016 18:47:00 +0000 (15:47 -0300)]
[media] Staging: media/lirc: lirc_zilog.c : fixed a string split in multi-line issue

Fixed a quoted string split in to multiple line issue(Actually fixed 2
warnings since it was split in to 3 lines.)

Signed-off-by: Ritwik G <ritwikgopi@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] cx24120: make sure tuner is locked at get_frontend
Jemma Denson [Sun, 28 Feb 2016 18:29:50 +0000 (15:29 -0300)]
[media] cx24120: make sure tuner is locked at get_frontend

Change get_frontend to re-check current lock status rather than relying
on a cached value from get_status. Removes potential for tuning failure
if get_frontend is called during tuning.

Probably not too essential as other changes work around this:
https://patchwork.linuxtv.org/patch/32845/

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] em28xx: add support for Terratec Grabby Record led
Matthieu Rogez [Sun, 28 Feb 2016 11:26:22 +0000 (08:26 -0300)]
[media] em28xx: add support for Terratec Grabby Record led

Terratec Grabby (hw rev 2) Record led is connected to GPIO 3
and its logic is inverted: (PIO3 = 0: on, PIO3 = 1: off).

Signed-off-by: Matthieu Rogez <matthieu.rogez@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] em28xx: add support for Terratec Grabby REC button
Matthieu Rogez [Sun, 28 Feb 2016 11:26:21 +0000 (08:26 -0300)]
[media] em28xx: add support for Terratec Grabby REC button

Terratec Grabby (hw rev 2) REC button uses the standard snapshot button
configuration.

Signed-off-by: Matthieu Rogez <matthieu.rogez@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] saa7134: fix warning with !MEDIA_CONTROLLER
Arnd Bergmann [Fri, 26 Feb 2016 15:25:17 +0000 (12:25 -0300)]
[media] saa7134: fix warning with !MEDIA_CONTROLLER

When CONFIG_MEDIA_CONTROLLER is disabled, we get a warning
about an unused function:

drivers/media/pci/saa7134/saa7134-core.c:832:13: error: 'saa7134_create_entities' defined but not used [-Werror=unused-function]

This moves the #ifdef outside of the function, as it is
never called here.

Fixes: ac90aa02d5b9 ("[media] saa7134: add media controller support")

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] em28xx: restore lost #ifdef
Arnd Bergmann [Fri, 26 Feb 2016 11:53:22 +0000 (08:53 -0300)]
[media] em28xx: restore lost #ifdef

The cleanup that changed the em28xx driver to use v4l2_mc_create_media_graph
instead of its own implementation causes a build error when CONFIG_MEDIA_CONTROLLER
is disabled:

drivers/media/usb/em28xx/em28xx-video.c: In function 'em28xx_v4l2_init':
drivers/media/usb/em28xx/em28xx-video.c:2717:38: error: 'struct em28xx' has no member named 'media_dev'

This puts the new code inside the same #ifdef that controls the presence
of the 'media_dev' member, and that the old code was in.

Fixes: de39078779cb ("[media] em2xx: use v4l2_mc_create_media_graph()")

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] coda: fix error path in case of missing pdata on non-DT platform
Philipp Zabel [Fri, 26 Feb 2016 11:21:35 +0000 (08:21 -0300)]
[media] coda: fix error path in case of missing pdata on non-DT platform

If we bail out this early, v4l2_device_register() has not been called
yet, so no need to call v4l2_device_unregister().

Fixes: b7bd660a51f0 ("[media] coda: Call v4l2_device_unregister() from a single location")

Reported-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] Revert "[media] tvp5150: document input connectors DT bindings"
Javier Martinez Canillas [Tue, 23 Feb 2016 18:48:08 +0000 (15:48 -0300)]
[media] Revert "[media] tvp5150: document input connectors DT bindings"

This reverts commit 82c2ffeb217a ("[media] tvp5150: document input
connectors DT bindings") since the DT binding is too device driver
specific and should instead be more generic and use the bindings
in Documentation/devicetree/bindings/display/connector/ and linked
to the tvp5150 using the OF graph port and endpoints.

There are still ongoing discussions about how the input connectors
will be supported by the Media Controller framework so until that
is settled, it is better to revert the connectors portion of the
bindings to avoid known to be broken bindings docs to hit mainline.

Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: Properly handle user pointers
Sakari Ailus [Mon, 22 Feb 2016 20:47:03 +0000 (17:47 -0300)]
[media] media: Properly handle user pointers

Mark pointers containing user pointers as such.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: Move media_get_uptr() macro out of the media.h user space header
Sakari Ailus [Mon, 22 Feb 2016 20:47:04 +0000 (17:47 -0300)]
[media] media: Move media_get_uptr() macro out of the media.h user space header

The media_get_uptr() macro is mostly useful only for the IOCTL handling
code in media-device.c so move it there.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] usb: musb: sunxi: support module autoloading
Emilio López [Mon, 22 Feb 2016 01:26:36 +0000 (22:26 -0300)]
[media] usb: musb: sunxi: support module autoloading

MODULE_DEVICE_TABLE() is missing, so the module isn't auto-loading on
sunxi systems using the OTG controller. This commit adds the missing
line so it loads automatically when building it as a module and running
on a system with an USB OTG port.

Signed-off-by: Emilio López <emilio.lopez@collabora.co.uk>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] rc: sunxi-cir: support module autoloading
Emilio López [Mon, 22 Feb 2016 01:26:34 +0000 (22:26 -0300)]
[media] rc: sunxi-cir: support module autoloading

MODULE_DEVICE_TABLE() is missing, so the module isn't auto-loading on
systems supporting infrared. This commit adds the missing line so it
works out of the box when built as a module and running on a sunxi
system with an infrared receiver.

Signed-off-by: Emilio López <emilio.lopez@collabora.co.uk>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] staging: v4l: omap4iss: Use V4L2 graph PM operations
Sakari Ailus [Sun, 21 Feb 2016 16:25:11 +0000 (13:25 -0300)]
[media] staging: v4l: omap4iss: Use V4L2 graph PM operations

Power on devices represented by entities in the graph through the pipeline
state using V4L2 graph PM operations instead of what was in the omap3isp
driver.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: omap3isp: Use V4L2 graph PM operations
Sakari Ailus [Sun, 21 Feb 2016 16:25:10 +0000 (13:25 -0300)]
[media] v4l: omap3isp: Use V4L2 graph PM operations

Power on devices represented by entities in the graph through the pipeline
state using V4L2 graph PM operations instead of what was in the omap3isp
driver.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years agov4l2-mc.h: Add stubs for the V4L2 PM/pipeline routines
Mauro Carvalho Chehab [Thu, 3 Mar 2016 15:30:51 +0000 (12:30 -0300)]
v4l2-mc.h: Add stubs for the V4L2 PM/pipeline routines

Let's add stubs for the case where the Kernel gets compiled
without MEDIA_CONTROLLER.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: Add generic pipeline power management code
Sakari Ailus [Sun, 21 Feb 2016 16:25:09 +0000 (13:25 -0300)]
[media] v4l: Add generic pipeline power management code

When the Media controller framework was merged, it was decided not to add
pipeline power management code for it was not seen generic. As a result, a
number of drivers have copied the same piece of code, with same bugfixes
done to them at different points of time (or not at all).

Add these functions to V4L2. Their use is optional for drivers.

[mchehab@osg.samsung.com: Fix merge conflicts]

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: Always keep a graph walk large enough around
Sakari Ailus [Sun, 21 Feb 2016 16:25:08 +0000 (13:25 -0300)]
[media] media: Always keep a graph walk large enough around

Re-create the graph walk object as needed in order to have one large enough
available for all entities in the graph.

This enumeration is used for pipeline power management in the future.

[mchehab@osg.samsung.com: fix documentation bug:
 " warning: bad line: graph_mutex"]

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l2-mc: Fix parameter description
Mauro Carvalho Chehab [Thu, 3 Mar 2016 15:14:33 +0000 (12:14 -0300)]
[media] v4l2-mc: Fix parameter description

.//include/media/v4l2-mc.h:138: warning: No description found for parameter 'vdev'
.//include/media/v4l2-mc.h:152: warning: No description found for parameter 'vdev'

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] cx23885: incorrect I2C bus used in the CI registration
Olli Salonen [Tue, 23 Dec 2014 15:48:07 +0000 (13:48 -0200)]
[media] cx23885: incorrect I2C bus used in the CI registration

This patch fixes a bug that was introduced by the commit:

commit 2b0aac3011bc7a9db27791bed4978554263ef079
Author: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

    [media] cx23885: move CI/MAC registration to a separate function

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] igorplugusb: fix leaks in error path
Sean Young [Fri, 19 Feb 2016 14:33:53 +0000 (12:33 -0200)]
[media] igorplugusb: fix leaks in error path

Since rc_allocate_device() uses kmalloc, it can returns NULL,
so need to check,  otherwise, NULL derefenrece can happen.

Reported-by: Insu Yun <wuninsu@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828 enable the right media source when input changes
Shuah Khan [Fri, 19 Feb 2016 00:28:48 +0000 (22:28 -0200)]
[media] media: au0828 enable the right media source when input changes

Change vidioc_s_input() to enable the media source for the newly
selected input.

v4l2-core enables source before calling au0828's vidioc_s_input()
handler. Hence, when input selection changes, media source for the
newly selected input needs to be enabled.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
8 years ago[media] cx23885: fix reversed I2C bus numbering
Olli Salonen [Tue, 16 Feb 2016 20:17:45 +0000 (18:17 -0200)]
[media] cx23885: fix reversed I2C bus numbering

I2C buses for DVBSky T980C and S950C were numbered in an opposite
way compared to every other board in the driver. Switch numbering
to a more logical way.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] dw2102: convert TechnoTrend S2-4600 to use I2C binding for demod
Olli Salonen [Tue, 16 Feb 2016 17:53:45 +0000 (15:53 -0200)]
[media] dw2102: convert TechnoTrend S2-4600 to use I2C binding for demod

Convert the TT S2-4600 USB tuner to use the I2C binding for attaching
the demodulator instead of the old m88ds3103_attach method.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media-entity: include linux/bug.h for WARN_ON
Philipp Zabel [Mon, 15 Feb 2016 11:08:06 +0000 (09:08 -0200)]
[media] media-entity: include linux/bug.h for WARN_ON

WARN_ON is used by this header file, but none of its direct includes
include asm/bug.h by way of linux/bug.h yet.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] rtl2832: move stats polling to read status
Antti Palosaari [Sat, 6 Feb 2016 22:12:05 +0000 (20:12 -0200)]
[media] rtl2832: move stats polling to read status

Do statistics polling on read status in order to avoid
unnecessary delayed work.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] rtl2832: improve slave TS control
Antti Palosaari [Fri, 5 Feb 2016 20:26:30 +0000 (18:26 -0200)]
[media] rtl2832: improve slave TS control

Add callback parameter to select enable / disable slave TS and use
it when slave demod is in use.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] mn88473: finalize driver
Antti Palosaari [Thu, 4 Feb 2016 19:01:51 +0000 (17:01 -0200)]
[media] mn88473: finalize driver

Finalize the driver.
It still lacks a lot of features, like all statistics and PLP
filtering, but basic functionality and sensitivity is pretty good
shape.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] mn88473: move out of staging
Antti Palosaari [Fri, 5 Feb 2016 06:04:48 +0000 (08:04 +0200)]
[media] mn88473: move out of staging

Move driver to drivers.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] saa7134: Add support for Snazio TvPVR PRO
GEORGE [Sun, 14 Feb 2016 21:23:15 +0000 (19:23 -0200)]
[media] saa7134: Add support for Snazio TvPVR PRO

This board has PCI ID: 1779:13cf

[mchehab@osg.samsung.com: Make scripts/checkpatch.pl happy]
Signed-off-by: Pojar George <geoubuntu@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828 set ctrl_input in au0828_s_input()
Shuah Khan [Fri, 12 Feb 2016 23:18:03 +0000 (21:18 -0200)]
[media] media: au0828 set ctrl_input in au0828_s_input()

dev->ctrl_input is set in vidioc_s_input() and doesn't get set in
au0828_s_input(). As a result, dev->ctrl_input is left uninitialized
until user space calls s_input.

It works correctly because the default input value is 0 and which is
what dev->ctrl_input gets initialized via kzalloc().

Change to set dev->ctrl_input in au0828_s_input(). Also optimize
vidioc_s_input() to return if the new input value is same as the
current.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] Fix AverMedia RM-KS remote keymap
Philippe Valembois [Tue, 9 Feb 2016 08:09:32 +0000 (06:09 -0200)]
[media] Fix AverMedia RM-KS remote keymap

Fix AverMedia RM-KS keymap using user guide to meet LinuxTV wiki rules.
The remote command didn't seem to change in itself since its creation: it's
just to make keys more standard and remove the FIXME.

Signed-off-by: Philippe Valembois <lephilousophe@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] Add support for Avermedia AverTV Volar HD 2 (TD110)
Philippe Valembois [Tue, 9 Feb 2016 08:08:01 +0000 (06:08 -0200)]
[media] Add support for Avermedia AverTV Volar HD 2 (TD110)

Signed-off-by: Philippe Valembois <lephilousophe@users.sourceforge.net>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: rc: nuvoton: support reading / writing wakeup sequence via sysfs
Heiner Kallweit [Mon, 8 Feb 2016 19:25:59 +0000 (17:25 -0200)]
[media] media: rc: nuvoton: support reading / writing wakeup sequence via sysfs

This patch adds a binary attribute /sys/class/rc/rc?/wakeup_data which
allows to read / write the wakeup sequence.

In combination with the core extension for exposing the most recent raw
packet this allows to easily define and set a wakeup sequence.

At least on my Zotac CI321 the BIOS resets the wakeup sequence at each boot
to a factory default. Therefore I use a udev rule
SUBSYSTEM=="rc", DRIVERS=="nuvoton-cir", ACTION=="add", RUN+="<script>"
with the script basically doing
cat <stored wakeup sequence> >/sys${DEVPATH}/wakeup_data

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] soc_camera/mx3_camera.c: move to staging in preparation, for removal
Hans Verkuil [Tue, 23 Feb 2016 16:39:10 +0000 (13:39 -0300)]
[media] soc_camera/mx3_camera.c: move to staging in preparation, for removal

This driver is deprecated: it should become a stand-alone driver
instead of using the soc-camera framework.

Unless someone is willing to take this on (unlikely with such
ancient hardware) it is going to be removed from the kernel
soon.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] soc_camera/mx2_camera.c: move to staging in preparation, for removal
Hans Verkuil [Tue, 23 Feb 2016 16:38:43 +0000 (13:38 -0300)]
[media] soc_camera/mx2_camera.c: move to staging in preparation, for removal

This driver is deprecated: it should become a stand-alone driver
instead of using the soc-camera framework.

Unless someone is willing to take this on (unlikely with such
ancient hardware) it is going to be removed from the kernel
soon.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] soc_camera/omap1: move to staging in preparation for removal
Hans Verkuil [Tue, 23 Feb 2016 12:13:04 +0000 (09:13 -0300)]
[media] soc_camera/omap1: move to staging in preparation for removal

This driver is deprecated: it needs to be converted to vb2 and
it should become a stand-alone driver instead of using the
soc-camera framework.

Unless someone is willing to take this on (unlikely with such
ancient hardware) it is going to be removed from the kernel
soon.

Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] vivid: support new multiplanar YUV formats
Hans Verkuil [Sat, 20 Feb 2016 08:57:38 +0000 (06:57 -0200)]
[media] vivid: support new multiplanar YUV formats

Add support for the new YUV422M, YVU422M, YUV444M and YVU444M formats.
This allows applications to check their support for these formats.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] coda: add support for firmware files named as distributed by NXP
Philipp Zabel [Fri, 19 Feb 2016 09:18:57 +0000 (07:18 -0200)]
[media] coda: add support for firmware files named as distributed by NXP

Try loading the firmware from firmware files named vpu_fw_imx*.bin, as
they are originally distributed by NXP. Fall back to v4l-coda*-imx6*.bin.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] adv7604: fix SPA register location for ADV7612
Ulrich Hecht [Wed, 17 Feb 2016 14:57:56 +0000 (12:57 -0200)]
[media] adv7604: fix SPA register location for ADV7612

SPA location LSB register is at 0x70.

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] coda: add support for native order firmware files with Freescale header
Philipp Zabel [Wed, 17 Feb 2016 13:21:10 +0000 (11:21 -0200)]
[media] coda: add support for native order firmware files with Freescale header

Freescale distribute their VPU firmware files with a 16 byte header
in BIT processor native order. This patch allows to detect the header
and to reorder the firmware on the fly.
With this patch it should be possible to use the distributed
vpu_fw_imx{53,6q,6d}.bin files directly after renaming them to
v4l-coda*-imx{53,6q,6dl}.bin.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] V4L: fix a confusing function name
Guennadi Liakhovetski [Sun, 21 Feb 2016 16:34:59 +0000 (13:34 -0300)]
[media] V4L: fix a confusing function name

is_state_active_or_queued() actually returns true if the buffer's state
is neither active nore queued. Rename it for clarity.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] atmel-isi: Fix bad usage of IS_ERR_VALUE
Guenter Roeck [Tue, 9 Feb 2016 14:43:42 +0000 (12:43 -0200)]
[media] atmel-isi: Fix bad usage of IS_ERR_VALUE

IS_ERR_VALUE() assumes that its parameter is an unsigned long.
It can not be used to check if an unsigned int reflects an error.
Doing so can result in the following build warning.

drivers/media/platform/soc_camera/atmel-isi.c:
In function "atmel_isi_probe":
include/linux/err.h:21:38: warning:
comparison is always false due to limited range of data type
drivers/media/platform/soc_camera/atmel-isi.c:1089:6: note:
in expansion of macro "IS_ERR_VALUE"

If that warning is seen, the return value from platform_get_irq() is not
checked for errors.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] pxa_camera: conversion to dmaengine
Robert Jarzmik [Sun, 6 Sep 2015 11:42:13 +0000 (08:42 -0300)]
[media] pxa_camera: conversion to dmaengine

Convert pxa_camera to dmaengine. This removes all DMA registers
manipulation in favor of the more generic dmaengine API.

The functional level should be the same as before. The biggest change is
in the sg_split() function, which splits a videobuf-dma into several
scatterlists for 3 planes captures (Y, U, V).

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
[g.liakhovetski@gmx.de: fix a function prototype, use bool, struct init]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] pxa_camera: trivial move of dma irq functions
Robert Jarzmik [Sun, 6 Sep 2015 11:42:12 +0000 (08:42 -0300)]
[media] pxa_camera: trivial move of dma irq functions

This moves the dma irq handling functions up in the source file, so that
they are available before DMA preparation functions. It prepares the
conversion to DMA engine, where the descriptors are populated with these
functions as callbacks.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] pxa_camera: move interrupt to tasklet
Robert Jarzmik [Sun, 6 Sep 2015 11:42:11 +0000 (08:42 -0300)]
[media] pxa_camera: move interrupt to tasklet

In preparation for dmaengine conversion, move the camera interrupt
handling into a tasklet. This won't change the global flow, as this
interrupt is only used to detect the end of frame and activate DMA fifos
handling.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] pxa_camera: fix the buffer free path
Robert Jarzmik [Sun, 6 Sep 2015 11:42:10 +0000 (08:42 -0300)]
[media] pxa_camera: fix the buffer free path

Fix the error path where the video buffer wasn't allocated nor
mapped. In this case, in the driver free path don't try to unmap memory
which was not mapped in the first place.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] mx3_camera: use %pad format string for dma_ddr_t
Arnd Bergmann [Mon, 1 Feb 2016 16:45:39 +0000 (14:45 -0200)]
[media] mx3_camera: use %pad format string for dma_ddr_t

The mx3_camera driver prints DMA addresses using the "%x" format
string, which is wrong when using a 64-bit dma_addr_t definition:

media/platform/soc_camera/mx3_camera.c: In function 'mx3_cam_dma_done':
media/platform/soc_camera/mx3_camera.c:149:125: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Werror=format=]
media/platform/soc_camera/mx3_camera.c: In function 'mx3_videobuf_queue':
media/platform/soc_camera/mx3_camera.c:317:119: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Werror=format=]
media/platform/soc_camera/mx3_camera.c: In function 'mx3_videobuf_release':
media/platform/soc_camera/mx3_camera.c:346:119: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Werror=format=]

This changes the code to use the special %pad format string, which
always does the right thing.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] soc_camera: rcar_vin: Add ARGB8888 caputre format support
Koji Matsuoka [Sun, 24 Jan 2016 16:13:29 +0000 (14:13 -0200)]
[media] soc_camera: rcar_vin: Add ARGB8888 caputre format support

This patch adds ARGB8888 capture format support for R-Car Gen3.

Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] UVC: Add support for R200 depth camera
Aviv Greenberg [Wed, 3 Feb 2016 17:08:52 +0000 (15:08 -0200)]
[media] UVC: Add support for R200 depth camera

Add support for Intel R200 depth camera in uvc driver.
This includes adding new uvc GUIDs for the new pixel formats,
adding new V4L pixel format definition to user api headers,
and updating the uvc driver GUID-to-4cc tables with the new formats.

Tested-by: Greenberg, Aviv D <aviv.d.greenberg@intel.com>
Signed-off-by: Aviv Greenberg <aviv.d.greenberg@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] V4L: add Y12I, Y8I and Z16 pixel format documentation
Guennadi Liakhovetski [Tue, 15 Dec 2015 16:35:33 +0000 (14:35 -0200)]
[media] V4L: add Y12I, Y8I and Z16 pixel format documentation

Add documentation for 3 formats, used by RealSense cameras like R200.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] au0828: use v4l2_mc_create_media_graph()
Mauro Carvalho Chehab [Wed, 2 Mar 2016 13:11:41 +0000 (10:11 -0300)]
[media] au0828: use v4l2_mc_create_media_graph()

There's no reason to implement its own function to create the
media graph. So, use the core one.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] au0828: use standard demod pads struct
Mauro Carvalho Chehab [Wed, 2 Mar 2016 12:48:36 +0000 (09:48 -0300)]
[media] au0828: use standard demod pads struct

As we want au0828 to use the core function to create the MC
graphs, use enum demod_pad_index instead of
enum au8522_media_pads.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] rc-core: allow calling rc_open with device not initialized
Mauro Carvalho Chehab [Wed, 2 Mar 2016 11:00:15 +0000 (08:00 -0300)]
[media] rc-core: allow calling rc_open with device not initialized

The device initialization completes only after calling
input_register_device(). However, rc_open() can be called while
the device is being registered by the input/evdev core. So, we
can't expect that rc_dev->initialized to be true.

Change the logic to don't require initialized == true at rc_open
and change the type of initialized to be atomic.

this way, we can check for it earlier where it is really needed,
without needing to lock the mutex just for testing it.

Tested with nuvoton_cir driver on a NUC5i7RYB with CIR integrated on it.

Reported-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media.h: use hex values for IF and AUDIO entities too
Hans Verkuil [Mon, 29 Feb 2016 08:02:47 +0000 (05:02 -0300)]
[media] media.h: use hex values for IF and AUDIO entities too

Make the base offset hexadecimal to simplify debugging since the base
addresses are hex too.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years agoMerge branch 'v4l_for_linus' into patchwork
Mauro Carvalho Chehab [Thu, 3 Mar 2016 09:07:04 +0000 (06:07 -0300)]
Merge branch 'v4l_for_linus' into patchwork

We need to import the changes at media.h, as we have a
followup patch that depends on it.

* v4l_for_linus:
  [media] media.h: use hex values for range offsets,  move connectors base up.
  [media] adv7604: fix tx 5v detect regression

8 years ago[media] media.h: use hex values for range offsets, move connectors base up.
Hans Verkuil [Mon, 29 Feb 2016 08:02:47 +0000 (09:02 +0100)]
[media] media.h: use hex values for range offsets,  move connectors base up.

Make the base offset hexadecimal to simplify debugging since the base
addresses are hex too.

The offsets for connectors is also changed to start after the 'reserved'
range 0x10000-0x2ffff.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media-device.h: fix compiler warning
Hans Verkuil [Fri, 26 Feb 2016 07:44:35 +0000 (04:44 -0300)]
[media] media-device.h: fix compiler warning

Fix these compiler warnings:

media-git/include/media/media-device.h: In function 'media_device_pci_init':
media-git/include/media/media-device.h:610:9: warning: 'return' with a value, in function returning void
  return NULL;
         ^
media-git/include/media/media-device.h: In function '__media_device_usb_init':
media-git/include/media/media-device.h:618:9: warning: 'return' with a value, in function returning void
  return NULL;
         ^

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] lirc_dev: avoid double mutex unlock
Mauro Carvalho Chehab [Sat, 27 Feb 2016 10:51:13 +0000 (07:51 -0300)]
[media] lirc_dev: avoid double mutex unlock

We can only unlock if mutex_lock() succeeds.

Fixes the following warning:
drivers/media/rc/lirc_dev.c:535 lirc_dev_fop_close() error: double unlock 'mutex:&lirc_dev_lock'

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] ati_remote: Put timeouts at the accel array
Mauro Carvalho Chehab [Sat, 27 Feb 2016 10:51:12 +0000 (07:51 -0300)]
[media] ati_remote: Put timeouts at the accel array

Instead of having the timeouts hardcoded, and getting only the
accel value from the array, put everything in the same place.

That simplifies the logic.

As a side effect, it also cleans several smatch errors:
include/linux/jiffies.h:359:41: error: strange non-value function or array
include/linux/jiffies.h:361:42: error: strange non-value function or array
(one per time_after/time_before line)

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] pt3: fix device identification
Mauro Carvalho Chehab [Sat, 27 Feb 2016 10:51:11 +0000 (07:51 -0300)]
[media] pt3: fix device identification

As warned by smatch:
drivers/media/pci/pt3/pt3.c:398 pt3_attach_fe() error: strncmp() '"tc90522sat"' too small (11 vs 20)

Clearly, the logic is doing the wrong thing, as it is not comparing the strings
on the right way.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] technisat-usb2: don't do DMA on the stack
Mauro Carvalho Chehab [Sat, 27 Feb 2016 10:51:10 +0000 (07:51 -0300)]
[media] technisat-usb2: don't do DMA on the stack

As warned by smatch:
drivers/media/usb/dvb-usb/technisat-usb2.c:263 technisat_usb2_set_led() error: doing dma on the stack (led)
drivers/media/usb/dvb-usb/technisat-usb2.c:280 technisat_usb2_set_led_timer() error: doing dma on the stack (&b)
drivers/media/usb/dvb-usb/technisat-usb2.c:341 technisat_usb2_identify_state() error: doing dma on the stack (version)
drivers/media/usb/dvb-usb/technisat-usb2.c:609 technisat_usb2_get_ir() error: doing dma on the stack (buf)
drivers/media/usb/dvb-usb/technisat-usb2.c:619 technisat_usb2_get_ir() error: doing dma on the stack (buf)

Create a buffer at the device state and use it for all the DMA
transfers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] dib0090: Do the right check for state->rf_ramp
Mauro Carvalho Chehab [Sat, 27 Feb 2016 10:51:09 +0000 (07:51 -0300)]
[media] dib0090: Do the right check for state->rf_ramp

Smatch with -pkernel --no-data keeps complaining about rf_ramp:
drivers/media/dvb-frontends/dib0090.c:1119 dib0090_pwm_gain_reset() error: we previously assumed 'state->rf_ramp' could be null (see line 1086)

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] drxj: don't do math if not needed
Mauro Carvalho Chehab [Sat, 27 Feb 2016 10:51:08 +0000 (07:51 -0300)]
[media] drxj: don't do math if not needed

While there's no risk of divison by zero, the logic there is akward, as it
does the calculus for the numerator and denominator before checking
if this will be used.

Change the order to check first if the denominator is zero, and only
calculating the numerator/denominator if not.

This should also avoid those smatch errors:
drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero
drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero
drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero
drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero
drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] airspy: fix bit set/clean mess on s->flags
Mauro Carvalho Chehab [Sat, 27 Feb 2016 10:51:07 +0000 (07:51 -0300)]
[media] airspy: fix bit set/clean mess on s->flags

As warned by smatch:
drivers/media/usb/airspy/airspy.c:541 airspy_start_streaming() warn: test_bit() takes a bit number
drivers/media/usb/airspy/airspy.c:569 airspy_start_streaming() warn: test_bit() takes a bit number
drivers/media/usb/airspy/airspy.c:605 airspy_stop_streaming() warn: test_bit() takes a bit number

set_bit/clear_bit argument is the bit number, and not 1 << bit.

Thankfully, one of the bits was not used (URB_BUF), with would
otherwise cause a driver misfunctioning.

Clean this mess by always using set_bit/clear_bit/test_bit and
removing the unused bit.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] gspca: Remove unused ovfx2_vga_mode/ovfx2_cif_mode arrays
Hans de Goede [Mon, 29 Feb 2016 19:00:01 +0000 (16:00 -0300)]
[media] gspca: Remove unused ovfx2_vga_mode/ovfx2_cif_mode arrays

Remove the unused ovfx2_vga_mode/ovfx2_cif_mode arrays from the ov519
driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] gspca: Fix ov519 i2c r/w not working when connected to a xhci host
Wesley Post [Mon, 29 Feb 2016 18:39:10 +0000 (15:39 -0300)]
[media] gspca: Fix ov519 i2c r/w not working when connected to a xhci host

Fix the ov519 driver not working (unable to talk to the sensor) when
plugged into a xhci host. The root cause here is that uhci/ohci/ehci
hosts typically will send any pending async requests every milli-second
and then go to sleep for the rest if the milli-second, where as xhci hosts
send them immediately, causing things to go too fast for the ov519 bridge.

This commit adds a few delays fixing this.

Signed-off-by: Wesley Post <pa4wdh@xs4all.nl>
[hdegoede@redhat.com: Also add delays to w996Xcf.c, as that needs them too]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] bttv: Width must be a multiple of 16 when capturing planar formats
Hans de Goede [Sun, 7 Feb 2016 11:24:29 +0000 (09:24 -0200)]
[media] bttv: Width must be a multiple of 16 when capturing planar formats

On my bttv card "Hauppauge WinTV [card=10]" capturing in YV12 fmt at max
size results in a solid green rectangle being captured (all colors 0 in
YUV).

This turns out to be caused by max-width (924) not being a multiple of 16.

We've likely never hit this problem before since normally xawtv / tvtime,
etc. will prefer packed pixel formats. But when using a video card which
is using xf86-video-modesetting + glamor, only planar XVideo fmts are
available, and xawtv will chose a matching capture format to avoid needing
to do conversion, triggering the solid green window problem.

Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828 video change to use v4l_enable_media_source()
Shuah Khan [Thu, 11 Feb 2016 23:41:37 +0000 (21:41 -0200)]
[media] media: au0828 video change to use v4l_enable_media_source()

Change au0828 to check if tuner is free or not before changing tuner
configuration.

vidioc_g_tuner(), and au0828_v4l2_close() now call v4l-core interface
v4l_enable_media_source() before changing tuner configuration.

Remove au0828_enable_analog_tuner() as it is no longer needed because
v4l2-core implements common interfaces to check for media source
availability.

In addition, queue_setup() no longer needs the tuner availability check
since v4l2-core does it.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: dvb-frontend invoke enable/disable_source handlers
Shuah Khan [Thu, 11 Feb 2016 23:41:36 +0000 (21:41 -0200)]
[media] media: dvb-frontend invoke enable/disable_source handlers

Change dvb frontend to check if tuner is free when device opened in RW
mode.

Call to enable_source handler either returns with an active pipeline to
tuner or error if tuner is busy.

Tuner is released when frontend is released calling the disable_source
handler.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828 add enable, disable source handlers
Shuah Khan [Thu, 11 Feb 2016 23:41:35 +0000 (21:41 -0200)]
[media] media: au0828 add enable, disable source handlers

Add enable_source and disable_source handlers. The enable source handler
is called from v4l2-core, dvb-core, and ALSA drivers to check if the
shared media source is free.

The disable source handler is called to release the shared media
source.

[mchehab@osg.samsung.com: fix merge conflicts]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828-core register entity_notify hook
Shuah Khan [Thu, 11 Feb 2016 23:41:34 +0000 (21:41 -0200)]
[media] media: au0828-core register entity_notify hook

Register entity_notify async hook to create links between existing
bridge driver entities and a newly added non-bridge driver entities. For
example, this handler creates link between V4L decoder entity and ALSA
mixer entity.

[mchehab@osg.samsung.com: fix merge conflicts and make
 au0828_media_graph_notify static to shut up a warning]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828 disable tuner to demod link
Shuah Khan [Thu, 11 Feb 2016 23:41:33 +0000 (21:41 -0200)]
[media] media: au0828 disable tuner to demod link

Change au0828_create_media_graph() to find and disable
tuner and demod link. This helps avoid an additional
disable step when tuner is requested by video or audio.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828 create tuner to decoder link in disabled state
Shuah Khan [Thu, 11 Feb 2016 23:41:32 +0000 (21:41 -0200)]
[media] media: au0828 create tuner to decoder link in disabled state

Create tuner to demod pad link in disabled state to avoid disable step
when tuner resource is requested by dvb.

[mchehab@osg.samsung.com: fix a merge conflict]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828 handle media_init and media_register window
Shuah Khan [Thu, 11 Feb 2016 23:41:31 +0000 (21:41 -0200)]
[media] media: au0828 handle media_init and media_register window

Media device initialization and registration steps are split. There is a
window between media device init and media device register during usb
probe.

au0828 bridge driver and snd-usb-audio could try to initialize the media
device, if they simply checked, whether the device has been registered.
They also need to check whether the device has been initialized.

Change the au0828-core to check if media device is already initialized
during initialization step and check if media device is already
registered during the registration step.

[mchehab@osg.samsung.com: fix a merge conflict]
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828 change to use Managed Media Controller API
Shuah Khan [Thu, 11 Feb 2016 23:41:30 +0000 (21:41 -0200)]
[media] media: au0828 change to use Managed Media Controller API

Change au0828 to use Managed Media Controller API to share media device
and coordinate creating/deleting the shared media device with the
snd-usb-audio driver. The shared media device is created as device
resource of the parent usb device of the two drivers.

Populate media device model with USB Device product name instead of
au0828 device board name. This change is necessary because, if the media
device is registered by the snd-usb-audio driver first, and it doesn't
know the au0828 board name.

[mchehab@osg.samsung.com: Fix merge conflicts]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: Change v4l-core to check if source is free
Shuah Khan [Thu, 11 Feb 2016 23:41:29 +0000 (21:41 -0200)]
[media] media: Change v4l-core to check if source is free

Change s_input, s_fmt, s_tuner, s_frequency, querystd, s_hw_freq_seek,
and vb2_core_streamon interfaces that alter the tuner configuration to
check if it is free, by calling v4l_enable_media_source().

If source isn't free, return -EBUSY.

v4l_disable_media_source() is called from v4l2_fh_exit() to release
tuner (source).

vb2_core_streamon() uses v4l_vb2q_enable_media_source().

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828 Use au8522_media_pads enum for pad defines
Shuah Khan [Thu, 11 Feb 2016 23:41:28 +0000 (21:41 -0200)]
[media] media: au0828 Use au8522_media_pads enum for pad defines

Change au0828-core to use au8522_media_pads enum defines
instead of hard-coding the pad values.

[mchehab@osg.samsung.com: patch rebased, as the code was
 moved to au0828-video.c. Also added AU8522_PAD_INPUT to the list
 of pad number replacements]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au8522 change to create MC pad for ALSA Audio Out
Shuah Khan [Thu, 11 Feb 2016 23:41:27 +0000 (21:41 -0200)]
[media] media: au8522 change to create MC pad for ALSA Audio Out

Add new pad for ALSA Audio Out to au8522_media_pads.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>