All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacopo Mondi <jacopo+renesas@jmondi.org>
To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl,
	sakari.ailus@linux.intel.com, laurent.pinchart@ideasonboard.com
Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>,
	niklas.soderlund+renesas@ragnatech.se,
	kieran.bingham@ideasonboard.com, dave.stevenson@raspberrypi.com,
	hyun.kwon@xilinx.com, jmkrzyszt@gmail.com,
	robert.jarzmik@free.fr, linux-media@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org
Subject: [PATCH v8 06/10] media: v4l2- mediabus: Add usage note for V4L2_MBUS_*
Date: Fri, 17 Jul 2020 16:53:20 +0200	[thread overview]
Message-ID: <20200717145324.292820-7-jacopo+renesas@jmondi.org> (raw)
In-Reply-To: <20200717145324.292820-1-jacopo+renesas@jmondi.org>

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>
---
 include/media/v4l2-mediabus.h | 33 +++++++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)

diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 45f88f0248c4..14818901e713 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -11,9 +11,34 @@
 #include <linux/v4l2-mediabus.h>
 #include <linux/bitops.h>

+/*
+ * How to use the V4L2_MBUS_* flags:
+ * Flags are defined for each of the possible states and values of a media
+ * bus configuration parameter. One and only one bit of each group of flags
+ * shall be set by the users of the v4l2_subdev_pad_ops.get_mbus_config and
+ * v4l2_subdev_pad_ops.set_mbus_config operations to ensure that no
+ * conflicting settings are specified when reporting and setting the media bus
+ * configuration with the two operations respectively. For example, it is
+ * invalid to set or clear both the V4L2_MBUS_HSYNC_ACTIVE_HIGH and the
+ * V4L2_MBUS_HSYNC_ACTIVE_LOW flag at the same time. Instead either flag
+ * V4L2_MBUS_HSYNC_ACTIVE_HIGH or flag V4L2_MBUS_HSYNC_ACTIVE_LOW shall be
+ * set. The same is true for the V4L2_MBUS_CSI2_1/2/3/4_LANE flags group: only
+ * one of these four bits shall be set.
+ *
+ * TODO: replace the existing V4L2_MBUS_* flags with structures of fields
+ * to avoid conflicting settings.
+ *
+ * In example:
+ *     #define V4L2_MBUS_HSYNC_ACTIVE_HIGH             BIT(2)
+ *     #define V4L2_MBUS_HSYNC_ACTIVE_LOW              BIT(3)
+ * will be replaced by a field whose value reports the intended active state of
+ * the signal:
+ *     unsigned int v4l2_mbus_hsync_active : 1;
+ */
+
 /* Parallel flags */
 /*
- * Can the client run in master or in slave mode. By "Master mode" an operation
+ * The client runs in master or in slave mode. By "Master mode" an operation
  * mode is meant, when the client (e.g., a camera sensor) is producing
  * horizontal and vertical synchronisation. In "Slave mode" the host is
  * providing these signals to the slave.
@@ -45,17 +70,17 @@
 #define V4L2_MBUS_DATA_ENABLE_LOW		BIT(15)

 /* Serial flags */
-/* How many lanes the client can use */
+/* CSI-2 D-PHY number of data lanes. */
 #define V4L2_MBUS_CSI2_1_LANE			BIT(0)
 #define V4L2_MBUS_CSI2_2_LANE			BIT(1)
 #define V4L2_MBUS_CSI2_3_LANE			BIT(2)
 #define V4L2_MBUS_CSI2_4_LANE			BIT(3)
-/* On which channels it can send video data */
+/* CSI-2 Virtual Channel identifiers. */
 #define V4L2_MBUS_CSI2_CHANNEL_0		BIT(4)
 #define V4L2_MBUS_CSI2_CHANNEL_1		BIT(5)
 #define V4L2_MBUS_CSI2_CHANNEL_2		BIT(6)
 #define V4L2_MBUS_CSI2_CHANNEL_3		BIT(7)
-/* Does it support only continuous or also non-continuous clock mode */
+/* Clock non-continuous mode support. */
 #define V4L2_MBUS_CSI2_CONTINUOUS_CLOCK		BIT(8)
 #define V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK	BIT(9)

--
2.27.0


  parent reply	other threads:[~2020-07-17 14:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 14:53 [PATCH v8 00/10] v4l2-subdev: Introduce [g|s]et_mbus_format pad op Jacopo Mondi
2020-07-17 14:53 ` [PATCH v8 01/10] media: v4l2-subdev: Introduce [get|set]_mbus_config pad ops Jacopo Mondi
2020-07-17 14:53 ` [PATCH v8 02/10] media: i2c: Use the new get_mbus_config pad op Jacopo Mondi
2020-07-17 14:53 ` [PATCH v8 03/10] media: i2c: ov6650: Use new [get|set]_mbus_config ops Jacopo Mondi
2020-07-21  7:53   ` [PATCH v8.1 " Jacopo Mondi
2020-07-21 15:50     ` Janusz Krzysztofik
2020-07-17 14:53 ` [PATCH v8 04/10] media: pxa_camera: Use the new set_mbus_config op Jacopo Mondi
2020-07-20  8:55   ` Hans Verkuil
2020-07-17 14:53 ` [PATCH v8 05/10] media: v4l2-subdev: Remove [s|g]_mbus_config video ops Jacopo Mondi
2020-07-17 14:53 ` Jacopo Mondi [this message]
2020-07-17 14:53 ` [PATCH v8 07/10] staging: media: imx: Update TODO entry Jacopo Mondi
2020-07-17 14:53 ` [PATCH v8 08/10] media: i2c: adv748x: Adjust TXA data lanes number Jacopo Mondi
2020-07-17 14:53 ` [PATCH v8 09/10] media: i2c: adv748x: Implement get_mbus_config Jacopo Mondi
2020-07-17 14:53 ` [PATCH v8 10/10] media: rcar-csi2: Negotiate data lanes number Jacopo Mondi
2020-07-17 14:59 ` [PATCH v8 00/10] v4l2-subdev: Introduce [g|s]et_mbus_format pad op Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200717145324.292820-7-jacopo+renesas@jmondi.org \
    --to=jacopo+renesas@jmondi.org \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=hyun.kwon@xilinx.com \
    --cc=jmkrzyszt@gmail.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=robert.jarzmik@free.fr \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.