summaryrefslogtreecommitdiff
path: root/drivers/media/v4l2-core/v4l2-mc.c
AgeCommit message (Collapse)Author
2016-06-15Update my main e-mails at the Kernel treeMauro Carvalho Chehab
For the third time in three years, I'm changing my e-mail at Samsung. That's bad, as it may stop communications with me for a while. So, this time, I'll also add the mchehab@kernel.org e-mail, as it remains stable since ever. Cc: stable@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-04-13[media] media: Rename is_media_entity_v4l2_io to ↵Laurent Pinchart
is_media_entity_v4l2_video_device All users of is_media_entity_v4l2_io() (the exynos4-is, omap3isp, davince_vpfe and omap4iss drivers and the v4l2-mc power management code) use the function to check whether entities are video_device instances, either to ensure they can cast the entity to a struct video_device, or to count the number of video nodes users. The purpose of the function is thus to identify whether the media entity instance is an instance of the video_device object, not to check whether it can perform I/O. Rename it accordingly, we will introduce a more specific is_media_entity_v4l2_io() check when needed. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-04-03v4l2-mc: avoid warning about unused variableLinus Torvalds
Commit 840f5b0572ea ("media: au0828 disable tuner to demod link in au0828_media_device_register()") removed all uses of the 'dtv_demod', but left the variable itself around. Remove it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-03-10media: au0828 disable tuner to demod link in au0828_media_device_register()Shuah Khan
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-05[media] media: fix null pointer dereference in v4l_vb2q_enable_media_source()Shuah Khan
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-03[media] v4l: Add generic pipeline power management codeSakari Ailus
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[media] au0828: use v4l2_mc_create_media_graph()Mauro Carvalho Chehab
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-02-27[media] media: v4l-core add enable/disable source common interfacesShuah Khan
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-23[media] media-device: move PCI/USB helper functions from v4l2-mcMauro Carvalho Chehab
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[media] v4l2-mc: fix hardware version for PCI devicesMauro Carvalho Chehab
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-16[media] media.h: get rid of MEDIA_ENT_F_CONN_TESTMauro Carvalho Chehab
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[media] v4l2-mc: remove the unused sensor varMauro Carvalho Chehab
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[media] v4l2-mc: add a routine to create USB media_deviceMauro Carvalho Chehab
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-10[media] v4l2-mc: add an ancillary routine for PCI-based MCMauro Carvalho Chehab
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[media] v4l2-mc: add a generic function to create the media graphMauro Carvalho Chehab
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>