diff mbox series

[v8,32/38] media: uapi: Add media bus code for ov2740 embedded data

Message ID 20240313072516.241106-33-sakari.ailus@linux.intel.com
State New
Headers show
Series [v8,01/38] media: mc: Add INTERNAL pad flag | expand

Commit Message

Sakari Ailus March 13, 2024, 7:25 a.m. UTC
Add a media bus code for ov2740 camera sensor embedded data and document
it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 .../media/v4l/subdev-formats.rst              | 66 +++++++++++++++++++
 include/uapi/linux/media-bus-format.h         |  3 +-
 2 files changed, 68 insertions(+), 1 deletion(-)

Comments

Julien Massot March 15, 2024, 4:10 p.m. UTC | #1
On 3/13/24 08:25, Sakari Ailus wrote:
> Add a media bus code for ov2740 camera sensor embedded data and document
> it.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
> ---
>   .../media/v4l/subdev-formats.rst              | 66 +++++++++++++++++++
>   include/uapi/linux/media-bus-format.h         |  3 +-
>   2 files changed, 68 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/userspace-api/media/v4l/subdev-formats.rst b/Documentation/userspace-api/media/v4l/subdev-formats.rst
> index ca4da6a400ff..a875868ed951 100644
> --- a/Documentation/userspace-api/media/v4l/subdev-formats.rst
> +++ b/Documentation/userspace-api/media/v4l/subdev-formats.rst
> @@ -8594,3 +8594,69 @@ This mbus code are only used for "2-byte simplified tagged data format" (code
>   embedded data format codes.
>   
>   Also see :ref:`CCS driver documentation <media-ccs-routes>`.
> +
> +Omnivision OV2740 Embedded Data Format
> +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> +
> +The Omnivision OV2740 camera sensor produces the following embedded data format.
> +
> +.. flat-table:: Omnivision OV2740 Embedded Data Format. Octets at indices marked
> +                reserved or unused have been omitted from the table.
> +    :header-rows: 1
> +
> +    * - Byte
> +      - Concent description
> +    * - 0
> +      - Sensor info
> +    * - 4
> +      - Analogue gain (bits 10--8)
> +    * - 5
> +      - Analogue gain (bits 7--0)
> +    * - 6
> +      - Coarse integration time (bits 15--8)
> +    * - 7
> +      - Coarse integration time (bits 7--0)
> +    * - 10
> +      - Dpc correction threshold (bits 9--2)
> +    * - 15
> +      - Output image width (bits 15--8)
> +    * - 16
> +      - Output image width (bits 7--0)
> +    * - 17
> +      - Output image height (bits 15--8)
> +    * - 18
> +      - Output image height (bits 7--0)
> +    * - 23
> +      - MIPI header revision number
> +    * - 31
> +      - Vertical (bit 1) and horizontal flip (bit 0)
> +    * - 32
> +      - Frame duration A
> +    * - 33
> +      - Frame duration B
> +    * - 34
> +      - Context count
> +    * - 35
> +      - Context select
> +    * - 54
> +      - Data pedestal (bits 9--2)
> +    * - 63
> +      - Frame average (bits 9--2)
> +    * - 64
> +      - Digital gain red
> +    * - 65
> +      - Digital gain red
> +    * - 66
> +      - Digital gain greenr
> +    * - 67
> +      - Digital gain greenr
> +    * - 68
> +      - Digital gain blue
> +    * - 69
> +      - Digital gain blue
> +    * - 70
> +      - Digital gain greenb
> +    * - 71
> +      - Digital gain greenb
> +    * - 89
> +      - Frame counter
> diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h
> index 03f7e9ab517b..13e68c2ccb61 100644
> --- a/include/uapi/linux/media-bus-format.h
> +++ b/include/uapi/linux/media-bus-format.h
> @@ -183,7 +183,8 @@
>   #define MEDIA_BUS_FMT_META_20			0x8006
>   #define MEDIA_BUS_FMT_META_24			0x8007
>   
> -/* Specific metadata formats. Next is 0x9002. */
> +/* Specific metadata formats. Next is 0x9003. */
>   #define MEDIA_BUS_FMT_CCS_EMBEDDED		0x9001
> +#define MEDIA_BUS_FMT_OV2740_EMBEDDED		0x9002
>   
>   #endif /* __LINUX_MEDIA_BUS_FORMAT_H */
Laurent Pinchart March 21, 2024, 4:54 p.m. UTC | #2
Hi Sakari,

Thank you for the patch.

On Wed, Mar 13, 2024 at 09:25:10AM +0200, Sakari Ailus wrote:
> Add a media bus code for ov2740 camera sensor embedded data and document
> it.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  .../media/v4l/subdev-formats.rst              | 66 +++++++++++++++++++
>  include/uapi/linux/media-bus-format.h         |  3 +-
>  2 files changed, 68 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/userspace-api/media/v4l/subdev-formats.rst b/Documentation/userspace-api/media/v4l/subdev-formats.rst
> index ca4da6a400ff..a875868ed951 100644
> --- a/Documentation/userspace-api/media/v4l/subdev-formats.rst
> +++ b/Documentation/userspace-api/media/v4l/subdev-formats.rst
> @@ -8594,3 +8594,69 @@ This mbus code are only used for "2-byte simplified tagged data format" (code
>  embedded data format codes.
>  
>  Also see :ref:`CCS driver documentation <media-ccs-routes>`.
> +
> +Omnivision OV2740 Embedded Data Format
> +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> +
> +The Omnivision OV2740 camera sensor produces the following embedded data format.
> +
> +.. flat-table:: Omnivision OV2740 Embedded Data Format. Octets at indices marked
> +                reserved or unused have been omitted from the table.
> +    :header-rows: 1
> +
> +    * - Byte
> +      - Concent description

s/Concent/Content/

> +    * - 0
> +      - Sensor info

What does this contain ?

> +    * - 4
> +      - Analogue gain (bits 10--8)
> +    * - 5
> +      - Analogue gain (bits 7--0)

I wonder if you could simplify the table by writing

    * - 4
      - Analogue gain (bits 10--0)
    * - 6
      - Coarse integration time (bits 15--0)

...

and documenting that all fields are in big-endian format. A size columns
could then be useful I suppose.

> +    * - 6
> +      - Coarse integration time (bits 15--8)
> +    * - 7
> +      - Coarse integration time (bits 7--0)
> +    * - 10
> +      - Dpc correction threshold (bits 9--2)
> +    * - 15
> +      - Output image width (bits 15--8)
> +    * - 16
> +      - Output image width (bits 7--0)
> +    * - 17
> +      - Output image height (bits 15--8)
> +    * - 18
> +      - Output image height (bits 7--0)
> +    * - 23
> +      - MIPI header revision number

What does this contain ?

> +    * - 31
> +      - Vertical (bit 1) and horizontal flip (bit 0)
> +    * - 32
> +      - Frame duration A

What does this contain ? Same for frame duration B, context count,
context select.

> +    * - 33
> +      - Frame duration B
> +    * - 34
> +      - Context count
> +    * - 35
> +      - Context select
> +    * - 54
> +      - Data pedestal (bits 9--2)
> +    * - 63
> +      - Frame average (bits 9--2)
> +    * - 64
> +      - Digital gain red
> +    * - 65
> +      - Digital gain red

Bit numbers are missing.

> +    * - 66
> +      - Digital gain greenr
> +    * - 67
> +      - Digital gain greenr
> +    * - 68
> +      - Digital gain blue
> +    * - 69
> +      - Digital gain blue
> +    * - 70
> +      - Digital gain greenb
> +    * - 71
> +      - Digital gain greenb
> +    * - 89
> +      - Frame counter

Does this wrap at 255 ?

> diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h
> index 03f7e9ab517b..13e68c2ccb61 100644
> --- a/include/uapi/linux/media-bus-format.h
> +++ b/include/uapi/linux/media-bus-format.h
> @@ -183,7 +183,8 @@
>  #define MEDIA_BUS_FMT_META_20			0x8006
>  #define MEDIA_BUS_FMT_META_24			0x8007
>  
> -/* Specific metadata formats. Next is 0x9002. */
> +/* Specific metadata formats. Next is 0x9003. */
>  #define MEDIA_BUS_FMT_CCS_EMBEDDED		0x9001
> +#define MEDIA_BUS_FMT_OV2740_EMBEDDED		0x9002
>  
>  #endif /* __LINUX_MEDIA_BUS_FORMAT_H */
diff mbox series

Patch

diff --git a/Documentation/userspace-api/media/v4l/subdev-formats.rst b/Documentation/userspace-api/media/v4l/subdev-formats.rst
index ca4da6a400ff..a875868ed951 100644
--- a/Documentation/userspace-api/media/v4l/subdev-formats.rst
+++ b/Documentation/userspace-api/media/v4l/subdev-formats.rst
@@ -8594,3 +8594,69 @@  This mbus code are only used for "2-byte simplified tagged data format" (code
 embedded data format codes.
 
 Also see :ref:`CCS driver documentation <media-ccs-routes>`.
+
+Omnivision OV2740 Embedded Data Format
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The Omnivision OV2740 camera sensor produces the following embedded data format.
+
+.. flat-table:: Omnivision OV2740 Embedded Data Format. Octets at indices marked
+                reserved or unused have been omitted from the table.
+    :header-rows: 1
+
+    * - Byte
+      - Concent description
+    * - 0
+      - Sensor info
+    * - 4
+      - Analogue gain (bits 10--8)
+    * - 5
+      - Analogue gain (bits 7--0)
+    * - 6
+      - Coarse integration time (bits 15--8)
+    * - 7
+      - Coarse integration time (bits 7--0)
+    * - 10
+      - Dpc correction threshold (bits 9--2)
+    * - 15
+      - Output image width (bits 15--8)
+    * - 16
+      - Output image width (bits 7--0)
+    * - 17
+      - Output image height (bits 15--8)
+    * - 18
+      - Output image height (bits 7--0)
+    * - 23
+      - MIPI header revision number
+    * - 31
+      - Vertical (bit 1) and horizontal flip (bit 0)
+    * - 32
+      - Frame duration A
+    * - 33
+      - Frame duration B
+    * - 34
+      - Context count
+    * - 35
+      - Context select
+    * - 54
+      - Data pedestal (bits 9--2)
+    * - 63
+      - Frame average (bits 9--2)
+    * - 64
+      - Digital gain red
+    * - 65
+      - Digital gain red
+    * - 66
+      - Digital gain greenr
+    * - 67
+      - Digital gain greenr
+    * - 68
+      - Digital gain blue
+    * - 69
+      - Digital gain blue
+    * - 70
+      - Digital gain greenb
+    * - 71
+      - Digital gain greenb
+    * - 89
+      - Frame counter
diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h
index 03f7e9ab517b..13e68c2ccb61 100644
--- a/include/uapi/linux/media-bus-format.h
+++ b/include/uapi/linux/media-bus-format.h
@@ -183,7 +183,8 @@ 
 #define MEDIA_BUS_FMT_META_20			0x8006
 #define MEDIA_BUS_FMT_META_24			0x8007
 
-/* Specific metadata formats. Next is 0x9002. */
+/* Specific metadata formats. Next is 0x9003. */
 #define MEDIA_BUS_FMT_CCS_EMBEDDED		0x9001
+#define MEDIA_BUS_FMT_OV2740_EMBEDDED		0x9002
 
 #endif /* __LINUX_MEDIA_BUS_FORMAT_H */