1
0
Fork 0
Commit Graph

12 Commits (30cebb6ca1e0eb2691339a0caa6600f646af0be5)

Author SHA1 Message Date
Shuah Khan 840f5b0572 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>
2016-03-10 13:44:10 -03:00
Shuah Khan 7e53898a76 [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>
2016-03-05 08:18:21 -03:00
Sakari Ailus 76413791a0 [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>
2016-03-03 12:29:25 -03:00
Mauro Carvalho Chehab 9822f4173f [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>
2016-03-03 06:23:20 -03:00
Shuah Khan d0a164f593 [media] media: v4l-core add enable/disable source common interfaces
Add a new interfaces to be used by v4l-core to invoke enable
source and disable_source handlers in the media_device. The
enable_source helper function invokes the enable_source handler
to find media source entity connected to the entity and check
is it is available or busy. If source is available, link is
activated and pipeline is started. The disable_source helper
function invokes the disable_source handler to deactivate and
stop the pipeline.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 08:33:29 -03:00
Mauro Carvalho Chehab 41b44e35ba [media] media-device: move PCI/USB helper functions from v4l2-mc
Those ancillary functions could be called even when compiled
without V4L2 support, as warned by ktest build robot:

All errors (new ones prefixed by >>):

>> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/dvb-usb/dvb-usb.ko] undefined!
>> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/dvb-usb-v2/dvb_usb_v2.ko] undefined!
>> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/au0828/au0828.ko] undefined!

Also, there's nothing there that are specific to V4L2. So, move
those ancillary functions to MC core.

No functional changes. Just function rename.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:18:45 -03:00
Mauro Carvalho Chehab 8e9a8b1212 [media] v4l2-mc: fix hardware version for PCI devices
It should be a bitwise or, and not a logical one. Also, add
parenthesis, to make sure it will be applied in the right order.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:14:50 -03:00
Mauro Carvalho Chehab 360104e3b8 [media] media.h: get rid of MEDIA_ENT_F_CONN_TEST
Defining it as a connector was a bad idea. Remove it while it is
not too late.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-16 09:16:56 -02:00
Mauro Carvalho Chehab 153d41a1d0 [media] v4l2-mc: remove the unused sensor var
This fixes this warning:

	v4l2-mc.c: In function 'v4l2_mc_create_media_graph':
	v4l2-mc.c:60:69: warning: variable 'sensor' set but not used [-Wunused-but-set-variable]

We could solve it the other way: don't do the second loop for
webcams. However, that would fail if a chip would have two sensors
plugged. This is not the current case, but it doesn't hurt to be
future-safe here, specially since this code runs only once during
device probe. So, performance is not an issue here.

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-16 08:55:58 -02:00
Mauro Carvalho Chehab eee7d353a1 [media] v4l2-mc: add a routine to create USB media_device
Instead of copying exactly the same code on all USB devices,
add an ancillary routine that will create and fill the
struct media_device with the values imported from the USB
device.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-16 08:38:59 -02:00
Mauro Carvalho Chehab 7047f2982a [media] v4l2-mc: add an ancillary routine for PCI-based MC
Instead of copyping the same code on all PCI devices that
would have a media controller, add a core ancillary routine.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-10 07:23:44 -02:00
Mauro Carvalho Chehab 54d0dbac12 [media] v4l2-mc: add a generic function to create the media graph
The em28xx_v4l2_create_media_graph() is almost generic enough to
be at the core, as an ancillary function. Make it even more generic,
by getting rid of em28xx-specific code, relying only at the
media_device, in order to discover all entities found on PC-customer's
hardware and add it at the V4L2 core.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-10 07:23:40 -02:00