summaryrefslogtreecommitdiff
path: root/include/media/v4l2-mediabus.h
AgeCommit message (Collapse)Author
2022-12-07media: v4l2-mediabus: add support for dual edge samplingMichael Riesch
Some devices support sampling of the parallel data at both edges of the interface pixel clock in order to reduce the pixel clock by two. Add a mediabus flag that represents this feature. Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2022-05-17media: media/v4l2-core: Add enum V4L2_FWNODE_BUS_TYPE_DPIXin Ji
As V4L2_FWNODE_BUS_TYPE_PARALLEL is not used for DPI interface, this patch add V4L2_FWNODE_BUS_TYPE_DPI for video DPI interface. Signed-off-by: Xin Ji <xji@analogixsemi.com> Reviewed-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-02-17media: v4l2-mediabus: Drop V4L2_MBUS_CSI2_CONTINUOUS_CLOCK flagLaurent Pinchart
MIPI CSI-2 continuous and non-continuous clock modes are mutually exclusive. Drop the V4L2_MBUS_CSI2_CONTINUOUS_CLOCK flag and use V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK only. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-02-17media: v4l2-mediabus: Drop legacy V4L2_MBUS_CSI2_CHANNEL_* flagsLaurent Pinchart
The V4L2_MBUS_CSI2_CHANNEL_* flags are a legacy API. Only V4L2_MBUS_CSI2_CHANNEL_0 is used, set in a single driver, and never read. Drop those flags. Virtual channel information should be conveyed through frame descriptors instead. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-02-17media: v4l2-mediabus: Drop legacy V4L2_MBUS_CSI2_*_LANE flagsLaurent Pinchart
The V4L2_MBUS_CSI2_*_LANE flags are a legacy API and are unused. Drop them. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-02-17media: v4l2-mediabus: Use structures to describe bus configurationLaurent Pinchart
The media bus configuration is specified through a set of flags, some of which being mutually exclusive. This doesn't scale to express more complex configurations. Improve the API by replacing the single flags field in v4l2_mbus_config by a union of v4l2_mbus_config_* structures. The flags themselves are still used in those structures, so they are kept here. Drivers are however updated to use structure fields instead of flags when already possible. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-01-28media: v4l2-fwnode: Move bus config structure to v4l2_mediabus.hLaurent Pinchart
To prepare for usage of the v4l2_fwnode_bus_* data structures to describe bus configuration in the subdev .get_mbus_config() operation, rename the structures with a v4l2_mbus_config_ prefix instead of v4l2_fwnode_bus_, and move them to v4l2_mediabus.h. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-01-28media: v4l2-subdev: Drop .set_mbus_config() operationLaurent Pinchart
The .set_mbus_config() operation is deprecated, and nothing in the kernel uses it. Drop it. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2020-11-16media: fix kernel-doc markupsMauro Carvalho Chehab
Some identifiers have different names between their prototypes and the kernel-doc markup. Seome seems to be due to cut-and-paste related issues. Others need to be fixed, as kernel-doc markups should use this format: identifier - description Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> # IPU3 and V4L2 Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: v4l2-fwnode: Return -EINVAL for invalid bus-typeLad Prabhakar
Return -EINVAL if invalid bus-type is detected while parsing endpoints. Fixes: 26c1126c9b56 ("media: v4l: fwnode: Use media bus type for bus parser selection") Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-08-18media: v4l2- mediabus: Add usage note for V4L2_MBUS_*Jacopo Mondi
With the removal of the legacy g_mbus_config and s_mbus_config video operations, the sole users of V4L2_MBUS_* flags are now the newly introduced get_mbus_config and set_mbus_config pad operations. As the semantic of the new operations differs from the semantic of the legacy ones, add a usage note in the v4l2-mediabus.h header to specify how to use the flags. Also add a TODO note to record that we intend to replace the existing flags with fields, to prevent users from mixing conflicting values in a single operation call. Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner
Based on 2 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 version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-05media: v4l2-core: cleanup coding style at V4L2 async/fwnodeMauro Carvalho Chehab
There are several coding style issues at those definitions, and the previous patchset added even more. Address the trivial ones by first calling: ./scripts/checkpatch.pl --strict --fix-inline include/media/v4l2-async.h include/media/v4l2-fwnode.h include/media/v4l2-mediabus.h drivers/media/v4l2-core/v4l2-async.c drivers/media/v4l2-core/v4l2-fwnode.c and then manually adjusting the style where needed. Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-10-04media: v4l: fwnode: Detect bus type correctlySakari Ailus
In case the device supports multiple video bus types on an endpoint, the V4L2 fwnode framework attempts to detect the type based on the available information. This wasn't working really well, and sometimes could lead to the V4L2 fwnode endpoint struct as being mishandled between the bus types. Default to Bt.656 if no properties suggesting a bus type are found. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Tested-by: Steve Longerbeam <steve_longerbeam@mentor.com> Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-10-04media: v4l: mediabus: Recognise CSI-2 D-PHY and C-PHYSakari Ailus
The CSI-2 bus may use either D-PHY or C-PHY. Make this visible in media bus enum. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Tested-by: Steve Longerbeam <steve_longerbeam@mentor.com> Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-24media: v4l2-fwnode: parse 'data-enable-active' propJacopo Mondi
Parse the newly defined 'data-enable-active' property in parallel endpoint parsing function. Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2017-12-18media: v4l2-dev: convert VFL_TYPE_* into an enumMauro Carvalho Chehab
Using enums makes easier to document, as it can use kernel-doc markups. It also allows cross-referencing, with increases the kAPI readability. Please notice that now cx88_querycap() has to have a default for the VFL type, as there are more types than supported by the driver. Acked-By: Mike Isely <isely@pobox.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-18media: v4l2-mediabus: use BIT() macro for flagsMauro Carvalho Chehab
Instead of using (1 << n) for bits, use the BIT() macro, as it makes a difference from documentation point of view. Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20media: v4l2-mediabus: Add helper functionsTodor Tomov
Add helper functions for mbus to/from mplane pixel format conversion. Signed-off-by: Todor Tomov <todor.tomov@linaro.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19media: v4l: Add support for CSI-1 and CCP2 bussesSakari Ailus
CCP2 and CSI-1, are older single data lane serial busses. [mchehab@s-opensource.com: don't use spaces for identation] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Pavel Machek <pavel@ucw.cz> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2015-08-22[media] v4l2-mediabus: Add to DocBookMauro Carvalho Chehab
Fix the format of the comments and add to DocBook. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Jonathan Corbet <corbet@lwn.net>
2015-06-05[media] videodev2.h: add support for transfer functionsHans Verkuil
In the past the transfer function was implied by the colorspace. However, it is an independent entity in its own right. Add support for explicitly choosing the transfer function. This change will allow us to represent linear RGB (as is used by openGL), and it will make it easier to work with decoded video material since most codecs store the transfer function as a separate property as well. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-01[media] v4l2-mediabus: improve colorspace supportHans Verkuil
Add and copy the new ycbcr_enc and quantization fields. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14[media] Make use of the new media_bus_format definitionsBoris BREZILLON
Replace references to the v4l2_mbus_pixelcode enum with the new media_bus_format enum in all common headers. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2013-08-24[media] media: OF: add "sync-on-green-active" propertyLad, Prabhakar
This patch adds 'sync-on-green-active' property as part of endpoint property. Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2011-09-24[media] v4l2: Add polarity flag definitions for the parallel bus FIELD signalSylwester Nawrocki
FIELD signal is used for indicating frame field type to the frame grabber in interlaced scan mode, as specified in ITU-R BT.601 standard. In normal operation mode FIELD = 0 selects Field1 (odd) and FIELD = 1 selects Field2 (even). When the FIELD signal is inverted it's the other way around. Add corresponding flags for configuring the FIELD signal polarity, V4L2_MBUS_FIELD_EVEN_HIGH for the standard (non-inverted) case and V4L2_MBUS_FIELD_EVEN_LOW for inverted case. Also add a comment about usage of V4L2_MBUS_[HV]SYNC* flags for the hardware that uses [HV]REF signals. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] V4L: add media bus configuration subdev operationsGuennadi Liakhovetski
Add media bus configuration types and two subdev operations to get supported mediabus configurations and to set a specific configuration. Subdevs can support several configurations, e.g., they can send video data on 1 or several lanes, can be configured to use a specific CSI-2 channel, in such cases subdevice drivers return bitmasks with all respective bits set. When a set-configuration operation is called, it has to specify a non-ambiguous configuration. Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22[media] v4l: Move the media/v4l2-mediabus.h header to include/linuxLaurent Pinchart
The header defines the v4l2_mbus_framefmt structure which will be used by the V4L2 subdevs userspace API. Change the type of the v4l2_mbus_framefmt::code field to __u32, as enum sizes can differ between different ABIs on the same architectures. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21[media] v4l2-mediabus: Add pixelcodes for BGR565 formatsSascha Hauer
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21V4L/DVB: v4l: add RGB444 mediabus formatsHans Verkuil
These are needed for the ov7670 driver. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21V4L/DVB: v4l: add new YUV mediabus formatsHans Verkuil
Needed for tvp7002 and tvp514x drivers. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02V4L/DVB: V4L2: mediabus: add 12-bit Bayer and YUV420 pixel formatsGuennadi Liakhovetski
These formats belong to the standard format set, defined by the MIPI CSI-2 specification. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02V4L/DVB: mediabus: fix ambiguous pixel code namesGuennadi Liakhovetski
Endianness notation is meaningless for 8 bit YUYV codes. Switch pixel code names to explicitly state the order of colour components in the data stream. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01V4L/DVB: v4l2-mediabus.h: added V4L2_MBUS_FMT_SGRBG8_1X8Hans Verkuil
Needed for mt9v011. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01V4L/DVB: v4l2-mediabus.h: add two helper functionsHans Verkuil
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16V4L/DVB (13658): v4l: add a media-bus API for configuring v4l2 subdev pixel ↵Guennadi Liakhovetski
and frame formats Video subdevices, like cameras, decoders, connect to video bridges over specialised busses. Data is being transferred over these busses in various formats, which only loosely correspond to fourcc codes, describing how video data is stored in RAM. This is not a one-to-one correspondence, therefore we cannot use fourcc codes to configure subdevice output data formats. This patch adds codes for several such on-the-bus formats and an API, similar to the familiar .s_fmt(), .g_fmt(), .try_fmt(), .enum_fmt() API for configuring those codes. After all users of the old API in struct v4l2_subdev_video_ops are converted, it will be removed. Also add helper routines to support generic pass-through mode for the soc-camera framework. create mode 100644 drivers/media/video/soc_mediabus.c create mode 100644 include/media/soc_mediabus.h create mode 100644 include/media/v4l2-mediabus.h Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>