History log of /linux-master/include/media/v4l2-mc.h
Revision Date Author Comments
# b97213a4 22-Aug-2023 Sakari Ailus <sakari.ailus@linux.intel.com>

media: v4l2-mc: Make v4l2_pipeline_pm_{get,put} deprecated

The v4l2_pipeline_pm_get() and v4l2_pipeline_pm_put() functions were
needed to control sub-devices' power states before runtime PM. These
functions should no longer be used, and instead sub-device drivers should
use runtime PM.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>


# bd5a03bc 23-Mar-2023 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

media: Accept non-subdev sinks in v4l2_create_fwnode_links_to_pad()

The v4l2_create_fwnode_links_to_pad() helper requires the sink pad
passed to it to belong to a subdev. This requirement can be lifted
easily. Make the function usable for non-subdev sinks, which allows
using it with video_device sinks.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>


# dbedd2f4 14-Feb-2021 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

media: v4l2-mc: Add link flags to v4l2_create_fwnode_links_to_pad()

Add a flags argument to the v4l2_create_fwnode_links_to_pad() function
to specify the link flags. This allows drivers to create immutable links
for instance.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 6d10fc2b 19-Jul-2020 Colton Lewis <colton.w.lewis@protonmail.com>

media: v4l2: Correct kernel-doc inconsistency

Silence documentation build warnings by correcting kernel-doc comment
v4l2_create_fwnode_links_to_pad and v4l2_create_fwnode_links functions.

./include/media/v4l2-mc.h:110: warning: Function parameter or member 'src_sd' not described in 'v4l2_create_fwnode_links_to_pad'
./include/media/v4l2-mc.h:110: warning: Function parameter or member 'sink' not described in 'v4l2_create_fwnode_links_to_pad'
./include/media/v4l2-mc.h:134: warning: Function parameter or member 'src_sd' not described in 'v4l2_create_fwnode_links'
./include/media/v4l2-mc.h:134: warning: Function parameter or member 'sink_sd' not described in 'v4l2_create_fwnode_links'

Signed-off-by: Colton Lewis <colton.w.lewis@protonmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 0d3c81e8 01-May-2020 Steve Longerbeam <slongerbeam@gmail.com>

media: v4l2-mc: add v4l2_create_fwnode_links helpers

Add functions to create media links between source and sink subdevices,
based on the fwnode endpoint connections between them:

v4l2_create_fwnode_links_to_pad() - create links from a source subdev to
a single sink pad based on fwnode
endpoint connections.

v4l2_create_fwnode_links() - create all links from a source to sink subdev
based on fwnode endpoint connections.

These functions can be used in a sink's v4l2-async notifier subdev
bound callback to make the links from the bound subdev.

Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 8fd390b8 24-Jan-2020 Ezequiel Garcia <ezequiel@collabora.com>

media: Split v4l2_pipeline_pm_use into v4l2_pipeline_pm_{get, put}

Currently, v4l2_pipeline_pm_use() prototype is:

int v4l2_pipeline_pm_use(struct media_entity *entity, int use)

Where the 'use' argument shall only be set to '1' for enable/power-on,
or to '0' for disable/power-off. The integer return is specified
as only meaningful when 'use' is set to '1'.

Let's enforce this semantic by splitting the function in two:
v4l2_pipeline_pm_get and v4l2_pipeline_pm_put. This is done
for several reasons.

It makes the API easier to use (or harder to misuse).
It removes the constraint on the values the 'use' argument
shall take. Also, it removes the need to constraint
the return value, by making v4l2_pipeline_pm_put void return.

And last, it's more consistent with other kernel APIs, such
as the runtime pm APIs, which makes the code more symmetric.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# c942fddf 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157

Based on 3 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version this program is distributed in the
hope that it will be useful but without any warranty without even
the implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version [author] [kishon] [vijay] [abraham]
[i] [kishon]@[ti] [com] this program is distributed in the hope that
it will be useful but without any warranty without even the implied
warranty of merchantability or fitness for a particular purpose see
the gnu general public license for more details

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version [author] [graeme] [gregory]
[gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
[kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
[hk] [hemahk]@[ti] [com] this program is distributed in the hope
that it will be useful but without any warranty without even the
implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 1105 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 65e83fb0 01-Aug-2018 Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

media: v4l2-mc: get rid of global pad indexes

Now that all drivers are using pad signal types, we can get
rid of the global static definition, as routes are stablished
using the pad signal type.

The tuner and IF-PLL pads are now used only by the tuner core,
so move the definitions to be there.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 092a3787 30-Jul-2018 Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

media: v4l2: remove VBI output pad

The signal there is the same as the video output (well,
except for sliced VBI, but let's simplify the model and ignore
it, at least for now - as it is routed together with raw
VBI).

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# e383ce07 22-Sep-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] get rid of a number of problems at the cross references

As warned by linuxdoc[1] tool, using:

$ for i in $(git grep kernel-doc Documentation/media/kapi/|cut -d: -f4); do kernel-lintdoc --sloppy $i; done

include/media/v4l2-dev.h:118 :WARN: function name from comment differs: v4l2_prio_close <--> v4l2_prio_check
include/media/v4l2-mc.h:56 [kernel-doc WARN] : enum name from comment differs: if_vid_dec_index <--> if_vid_dec_pad_index
include/media/v4l2-mc.h:71 [kernel-doc WARN] : enum name from comment differs: if_aud_dec_index <--> if_aud_dec_pad_index
include/media/v4l2-mem2mem.h:396 [kernel-doc WARN] : function name from comment differs: v4l2_m2m_num_src_bufs_ready <--> v4l2_m2m_num_dst_bufs_ready
drivers/media/dvb-core/dvb_math.h:28 [kernel-doc WARN] : function name from comment differs: cintlog2 <--> intlog2
include/media/v4l2-subdev.h:215 [kernel-doc WARN] : struct name from comment differs: s_radio <--> v4l2_subdev_tuner_ops
include/media/v4l2-subdev.h:890 [kernel-doc WARN] : function name from comment differs: v4l2_set_subdevdata <--> v4l2_set_subdev_hostdata
include/media/v4l2-subdev.h:901 [kernel-doc WARN] : function name from comment differs: v4l2_get_subdevdata <--> v4l2_get_subdev_hostdata
drivers/media/dvb-core/dvb_ringbuffer.h:196 [kernel-doc WARN] : function name from comment differs: dvb_ringbuffer_writeuser <--> dvb_ringbuffer_write_user
include/media/videobuf2-core.h:399 [kernel-doc WARN] : struct name from comment differs: vb2_ops <--> vb2_buf_ops
include/media/media-entity.h:132 [kernel-doc ERROR] : duplicate parameter definition 'source'
include/media/media-entity.h:477 [kernel-doc WARN] : function name from comment differs: media_entity_enum_test <--> media_entity_enum_test_and_set
include/media/media-entity.h:535 [kernel-doc WARN] : function name from comment differs: gobj_to_entity <--> gobj_to_pad
include/media/media-entity.h:544 [kernel-doc WARN] : function name from comment differs: gobj_to_entity <--> gobj_to_link
include/media/media-entity.h:553 [kernel-doc WARN] : function name from comment differs: gobj_to_entity <--> gobj_to_intf
include/media/media-entity.h:562 [kernel-doc WARN] : function name from comment differs: gobj_to_entity <--> intf_to_devnode
include/media/rc-core.h:234 [kernel-doc WARN] : function name from comment differs: rc_open <--> rc_close
include/media/v4l2-ctrls.h:397 [kernel-doc WARN] : missing initial short description of 'v4l2_ctrl_handler_init'
include/media/v4l2-dev.h:118 [kernel-doc WARN] : function name from comment differs: v4l2_prio_close <--> v4l2_prio_check
include/media/v4l2-event.h:225 [kernel-doc WARN] : missing initial short description of 'v4l2_src_change_event_subscribe'

[1] https://return42.github.io/linuxdoc/linux.html

The above are real issues at the documentation. On several cases,
caused by cut-and-paste.

Fix them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 89cb3ddb 17-Jul-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] doc-rst: Fix conversion for v4l2 core functions

The conversion from DocBook lead into some conversion issues,
basically due to the lack of proper support at kernel-doc.

So, address them:

- Now, the C files with the exported symbols also need to be
added. So, all headers need to be included twice: one to
get the structs/enums/.. and another one for the functions;

- Notes should use the ReST tag, as kernel-doc doesn't
recognizes it anymore;

- Identation needs to be fixed, as ReST uses it to identify
when a format "tag" ends.

- kernel-doc doesn't escape things like *pointer, so we
need to manually add a escape char before it.

- On some cases, kernel-doc conversion requires violating
the 80-cols, as otherwise it won't properly parse the
source code.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 5dc8a864 14-Jun-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

Update my main e-mails at the Kernel tree

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>


# dc19ed15 14-Jun-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

Update my main e-mails at the Kernel tree

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 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>


# 1e89f584 04-Mar-2016 Hans Verkuil <hverkuil@xs4all.nl>

[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>


# 9532e6bb 03-Mar-2016 Hans Verkuil <hverkuil@xs4all.nl>

[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>


# a77bf704 02-Mar-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

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>


# 76413791 21-Feb-2016 Sakari Ailus <sakari.ailus@linux.intel.com>

[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>


# 4f27dba6 02-Mar-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[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>


# bddc4187 02-Mar-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[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>


# d0a164f5 11-Feb-2016 Shuah Khan <shuah@kernel.org>

[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>


# 41b44e35 22-Feb-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[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>


# eee7d353 11-Feb-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[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>


# db152276 12-Feb-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] v4l2-mc.h: prevent it for being included twice

Don't let it be included twice, to avoid compiler issues.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 7047f298 05-Feb-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[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>


# 54d0dbac 05-Feb-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[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>


# e4001e95 29-Jan-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] v4l2-mc: add analog TV demodulator pad index macros

We also need to standardize the PAD index macros for demods,
as they all should look the same in a media graph.

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


# 953a457e 29-Jan-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] v4l2-mc.h Add pads for audio and video IF-PLL decoders

The audio and video IF-PLL decoders have one sink and one source
PAD. Add macro names for those pads and describe what kind of
signals are represented at such pads.

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


# 5c9077ea 29-Jan-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] v4l2-mc.h: Split audio from baseband output

Analog TV tuners have a separate output pad for the audio
IF or audio sampled data. This pad is connected to a different
chipset.

Add an extra pad for it and improve the documentation.

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


# 6aad127d 29-Jan-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] v4l2-mc.h: move tuner PAD definitions to this new header

The customer PC hardware can be shipped with lots of different
configurations, as vendors use to replace some of the chips on
their hardware along the time. All drivers that support such
devices are prepared to handle the hardware differences, using
their own auto-probing logic.

They do it in a way that number of inputs and outputs for a given
hardware type doesn't change.

Now that we're adding media controller capabilities to those drivers,
we need to standardize the number of inputs and outputs for each
hardware type, as we want to have a generic function at the V4L2
core that would create the links for the entities that are expected
on such hardware.

Such standard is already there for tuners, but tuner.h is not the
best place to store such data, as we'll need to add definitions also
for analog TV demodulators.

Also, we'll need a place to put a set of MC handling functions. So,
let's create a v4l2-mc.h to store such kind of definitions.

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