aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/media/v4l2-mc.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-03-02media: Split v4l2_pipeline_pm_use into v4l2_pipeline_pm_{get, put}Ezequiel Garcia1-15/+25
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>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157Thomas Gleixner1-10/+1
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>
2018-09-17media: v4l2-mc: get rid of global pad indexesMauro Carvalho Chehab1-76/+0
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>
2018-09-17media: v4l2: remove VBI output padMauro Carvalho Chehab1-2/+0
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>
2016-09-22[media] get rid of a number of problems at the cross referencesMauro Carvalho Chehab1-2/+2
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>
2016-07-17[media] doc-rst: Fix conversion for v4l2 core functionsMauro Carvalho Chehab1-5/+8
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>
2016-06-14Update my main e-mails at the Kernel treeMauro Carvalho Chehab1-1/+1
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>
2016-03-04[media] v4l2-mc.h: fix yet more compiler errorsHans Verkuil1-4/+3
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>
2016-03-03[media] v4l2-mc.h: fix compiler warningsHans Verkuil1-3/+3
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>
2016-03-03v4l2-mc.h: Add stubs for the V4L2 PM/pipeline routinesMauro Carvalho Chehab1-2/+14
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>
2016-03-03[media] v4l: Add generic pipeline power management codeSakari Ailus1-1/+42
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] v4l2-mc: Fix parameter descriptionMauro Carvalho Chehab1-2/+2
.//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>
2016-03-03[media] au0828: use standard demod pads structMauro Carvalho Chehab1-0/+2
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>
2016-02-27[media] media: v4l-core add enable/disable source common interfacesShuah Khan1-1/+64
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 Chehab1-46/+0
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-16[media] v4l2-mc: add a routine to create USB media_deviceMauro Carvalho Chehab1-5/+34
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[media] v4l2-mc.h: prevent it for being included twiceMauro Carvalho Chehab1-0/+5
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>
2016-02-10[media] v4l2-mc: add an ancillary routine for PCI-based MCMauro Carvalho Chehab1-1/+23
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 Chehab1-0/+25
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-01[media] v4l2-mc: add analog TV demodulator pad index macrosMauro Carvalho Chehab1-0/+15
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>
2016-02-01[media] v4l2-mc.h Add pads for audio and video IF-PLL decodersMauro Carvalho Chehab1-0/+32
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>
2016-02-01[media] v4l2-mc.h: Split audio from baseband outputMauro Carvalho Chehab1-11/+17
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>
2016-02-01[media] v4l2-mc.h: move tuner PAD definitions to this new headerMauro Carvalho Chehab1-0/+38
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>