]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: vimc: sensor: Move vimc_sensor_device to common header
authorFaizel K B <faizel.kb@gmail.com>
Thu, 12 Mar 2026 23:16:14 +0000 (16:16 -0700)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 17 Mar 2026 09:50:18 +0000 (10:50 +0100)
Move the vimc_sensor_device structure from vimc-sensor.c to
vimc-common.h to make it accessible to the vimc-streamer component.

Signed-off-by: Faizel K B <faizel.kb@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/test-drivers/vimc/vimc-common.h
drivers/media/test-drivers/vimc/vimc-sensor.c

index 7a45a2117748ed9fa5842d3a7f096318d7fbb7ec..35789add6b4a3ae077f3c5ce9af0ddafb98d5665 100644 (file)
@@ -12,6 +12,8 @@
 #include <linux/slab.h>
 #include <media/media-device.h>
 #include <media/v4l2-device.h>
+#include <media/tpg/v4l2-tpg.h>
+#include <media/v4l2-ctrls.h>
 
 #define VIMC_PDEV_NAME "vimc"
 
@@ -159,6 +161,32 @@ struct vimc_ent_config {
        const struct vimc_ent_type *type;
 };
 
+enum vimc_sensor_osd_mode {
+       VIMC_SENSOR_OSD_SHOW_ALL = 0,
+       VIMC_SENSOR_OSD_SHOW_COUNTERS = 1,
+       VIMC_SENSOR_OSD_SHOW_NONE = 2
+};
+
+struct vimc_sensor_device {
+       struct vimc_ent_device ved;
+       struct v4l2_subdev sd;
+       struct tpg_data tpg;
+       struct v4l2_ctrl_handler hdl;
+       struct media_pad pad;
+
+       u8 *frame;
+
+       /*
+        * Virtual "hardware" configuration, filled when the stream starts or
+        * when controls are set.
+        */
+       struct {
+               struct v4l2_area size;
+               enum vimc_sensor_osd_mode osd_value;
+               u64 start_stream_ts;
+       } hw;
+};
+
 /**
  * vimc_is_source - returns true if the entity has only source pads
  *
index 69e714d4f22814a3fc3b1f97150b76b9f1bb4394..4c64cdab8cda8db3780258c8dbc43a19b6593834 100644 (file)
 
 #include "vimc-common.h"
 
-enum vimc_sensor_osd_mode {
-       VIMC_SENSOR_OSD_SHOW_ALL = 0,
-       VIMC_SENSOR_OSD_SHOW_COUNTERS = 1,
-       VIMC_SENSOR_OSD_SHOW_NONE = 2
-};
-
-struct vimc_sensor_device {
-       struct vimc_ent_device ved;
-       struct v4l2_subdev sd;
-       struct tpg_data tpg;
-       struct v4l2_ctrl_handler hdl;
-       struct media_pad pad;
-
-       u8 *frame;
-
-       /*
-        * Virtual "hardware" configuration, filled when the stream starts or
-        * when controls are set.
-        */
-       struct {
-               struct v4l2_area size;
-               enum vimc_sensor_osd_mode osd_value;
-               u64 start_stream_ts;
-       } hw;
-};
-
 static const struct v4l2_mbus_framefmt fmt_default = {
        .width = 640,
        .height = 480,