[PATCH v2 1/5] include: linux: Destage VCHIQ interface headers

Jai Luthra
2025-09-07T09:03:45Z

From: Umang Jain <umang.jain@ideasonboard.com>

Move the VCHIQ headers from drivers/staging/vc04_services/include to
include/linux/raspberrypi

This is done so that they can be shared between the VCHIQ interface
(which is going to be de-staged in a subsequent commit from staging) and
the VCHIQ drivers left in the staging/vc04_services (namely
bcm2835-audio, bcm2835-camera).

The include/linux/raspberrypi/ provides a central location to serve both of
these areas.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
---
MAINTAINERS | 1 +
drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 5 +++--
drivers/staging/vc04_services/bcm2835-audio/bcm2835.c | 3 ++-
drivers/staging/vc04_services/bcm2835-audio/bcm2835.h | 3 +--
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 3 ++-
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 9 +++++----
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c | 4 ++--
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 4 ++--
.../staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c | 6 +++---
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c | 7 ++++---
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_ioctl.h | 3 +--
drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 5 +++--
.../vc04_services/include => include}/linux/raspberrypi/vchiq.h | 0
.../vchiq_arm => include/linux/raspberrypi}/vchiq_arm.h | 0
.../vchiq_arm => include/linux/raspberrypi}/vchiq_bus.h | 0
.../vchiq_arm => include/linux/raspberrypi}/vchiq_cfg.h | 0
.../vchiq_arm => include/linux/raspberrypi}/vchiq_core.h | 2 +-
.../vchiq_arm => include/linux/raspberrypi}/vchiq_debugfs.h | 0
18 files changed, 30 insertions(+), 25 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index fe168477caa45799dfe07de2f54de6d6a1ce0615..5f79e377ad707ca65fe01f9882c95f8ab1aaa755 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4754,6 +4754,7 @@ T: git https://github.com/broadcom/stblinux.git
F: Documentation/devicetree/bindings/pci/brcm,stb-pcie.yaml
F: drivers/pci/controller/pcie-brcmstb.c
F: drivers/staging/vc04_services
+F: include/linux/raspberrypi/vchiq*
N: bcm2711
N: bcm2712
N: bcm283*
diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
index 0dbe76ee557032d7861acfc002cc203ff2e6971d..7368b384497f7b1439252a857f5845d3c4108c75 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
@@ -4,11 +4,12 @@
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/completion.h>
+
+#include <linux/raspberrypi/vchiq_arm.h>
+
#include "bcm2835.h"
#include "vc_vchi_audioserv_defs.h"

-#include "../interface/vchiq_arm/vchiq_arm.h"
-
struct bcm2835_audio_instance {
struct device *dev;
unsigned int service_handle;
diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
index b74cb104e9de00e7688a320949111a419cca084a..f292a6618166fe2581dffce873873c67af3d3b54 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
@@ -6,7 +6,8 @@
#include <linux/slab.h>
#include <linux/module.h>

-#include "../interface/vchiq_arm/vchiq_bus.h"
+#include <linux/raspberrypi/vchiq_bus.h>
+
#include "bcm2835.h"

static bool enable_hdmi;
diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
index 49ec5b496edb4ba8634171b1390c4e15181e4048..5a1348747ff4e0b63b244156a2252bb276863514 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
@@ -5,13 +5,12 @@
#define __SOUND_ARM_BCM2835_H

#include <linux/device.h>
+#include <linux/raspberrypi/vchiq.h>
#include <linux/wait.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm-indirect.h>

-#include "../include/linux/raspberrypi/vchiq.h"
-
#define MAX_SUBSTREAMS (8)
#define AVAIL_SUBSTREAMS_MASK (0xff)

diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
index fa7ea4ca4c36f4ec7f76f6ffbea9f45205116bb8..d5e7b2d78eb478372e249ef0029874dffbc7e84f 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -26,7 +26,8 @@
#include <media/v4l2-common.h>
#include <linux/delay.h>

-#include "../interface/vchiq_arm/vchiq_bus.h"
+#include <linux/raspberrypi/vchiq_bus.h>
+
#include "../vchiq-mmal/mmal-common.h"
#include "../vchiq-mmal/mmal-encodings.h"
#include "../vchiq-mmal/mmal-vchiq.h"
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index 721b15b7e13b9f25cee7619575bbfa1a4734cce8..53e162278b478d4eea8dec6dd31f9a0ec15224c6 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -30,11 +30,12 @@
#include <linux/uaccess.h>
#include <soc/bcm2835/raspberrypi-firmware.h>

-#include "vchiq_core.h"
+#include <linux/raspberrypi/vchiq_core.h>
+#include <linux/raspberrypi/vchiq_arm.h>
+#include <linux/raspberrypi/vchiq_bus.h>
+#include <linux/raspberrypi/vchiq_debugfs.h>
+
#include "vchiq_ioctl.h"
-#include "vchiq_arm.h"
-#include "vchiq_bus.h"
-#include "vchiq_debugfs.h"

#define DEVICE_NAME "vchiq"

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
index 41ece91ab88aa647a348910a0b913d0b28a8c761..f50e637d505cc58e86351de4e22ac57152570075 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
@@ -11,8 +11,8 @@
#include <linux/slab.h>
#include <linux/string.h>

-#include "vchiq_arm.h"
-#include "vchiq_bus.h"
+#include <linux/raspberrypi/vchiq_arm.h>
+#include <linux/raspberrypi/vchiq_bus.h>

static int vchiq_bus_type_match(struct device *dev, const struct device_driver *drv)
{
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
index e2cac0898b8faa3c255de6b8562c7096a9683c49..dc2c304c886edf59115fdd66c8842cb8eeeacff8 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -15,8 +15,8 @@
#include <linux/rcupdate.h>
#include <linux/sched/signal.h>

-#include "vchiq_arm.h"
-#include "vchiq_core.h"
+#include <linux/raspberrypi/vchiq_arm.h>
+#include <linux/raspberrypi/vchiq_core.h>

#define VCHIQ_SLOT_HANDLER_STACK 8192

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c
index d5f7f61c5626934b819e8ff322e22ae3d6158b31..c82326a9b6d9cfba7d4233a48530f85443eb2f5a 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c
@@ -5,9 +5,9 @@
*/

#include <linux/debugfs.h>
-#include "vchiq_core.h"
-#include "vchiq_arm.h"
-#include "vchiq_debugfs.h"
+#include <linux/raspberrypi/vchiq_core.h>
+#include <linux/raspberrypi/vchiq_arm.h>
+#include <linux/raspberrypi/vchiq_debugfs.h>

#ifdef CONFIG_DEBUG_FS

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c
index 3b20ba5c736221ce1cacfc9ce86eca623382a30b..0f3dde2657d6b81fab64daa17d26592712fe8473 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c
@@ -11,10 +11,11 @@
#include <linux/compat.h>
#include <linux/miscdevice.h>

-#include "vchiq_core.h"
+#include <linux/raspberrypi/vchiq_core.h>
+#include <linux/raspberrypi/vchiq_arm.h>
+#include <linux/raspberrypi/vchiq_debugfs.h>
+
#include "vchiq_ioctl.h"
-#include "vchiq_arm.h"
-#include "vchiq_debugfs.h"

static const char *const ioctl_names[] = {
"CONNECT",
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_ioctl.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_ioctl.h
index afb71a83cfe7035e5dd61003fa99fd514ca18047..d0c759f6d8ea79e43247048f8b3903df67dd84c8 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_ioctl.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_ioctl.h
@@ -5,8 +5,7 @@
#define VCHIQ_IOCTLS_H

#include <linux/ioctl.h>
-
-#include "../../include/linux/raspberrypi/vchiq.h"
+#include <linux/raspberrypi/vchiq.h>

#define VCHIQ_IOC_MAGIC 0xc4
#define VCHIQ_INVALID_HANDLE (~0)
diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
index 3fe482bd279390a7586c49bde00f38c61558ca8e..5caf9ae56ee48290401f86eadea9f1ca0149b11e 100644
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
@@ -22,11 +22,12 @@
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/completion.h>
+#include <linux/raspberrypi/vchiq.h>
#include <linux/vmalloc.h>
#include <media/videobuf2-vmalloc.h>

-#include "../include/linux/raspberrypi/vchiq.h"
-#include "../interface/vchiq_arm/vchiq_arm.h"
+#include <linux/raspberrypi/vchiq_arm.h>
+
#include "mmal-common.h"
#include "mmal-vchiq.h"
#include "mmal-msg.h"
diff --git a/drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h b/include/linux/raspberrypi/vchiq.h
similarity index 100%
rename from drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h
rename to include/linux/raspberrypi/vchiq.h
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/include/linux/raspberrypi/vchiq_arm.h
similarity index 100%
rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
rename to include/linux/raspberrypi/vchiq_arm.h
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h b/include/linux/raspberrypi/vchiq_bus.h
similarity index 100%
rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h
rename to include/linux/raspberrypi/vchiq_bus.h
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_cfg.h b/include/linux/raspberrypi/vchiq_cfg.h
similarity index 100%
rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_cfg.h
rename to include/linux/raspberrypi/vchiq_cfg.h
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/include/linux/raspberrypi/vchiq_core.h
similarity index 99%
rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
rename to include/linux/raspberrypi/vchiq_core.h
index 9b4e766990a493d6e9d4e0604f2c84f4e7b77804..dbcb19e7a6d39b94967261c4ab23d6325e999249 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
+++ b/include/linux/raspberrypi/vchiq_core.h
@@ -15,7 +15,7 @@
#include <linux/spinlock_types.h>
#include <linux/wait.h>

-#include "../../include/linux/raspberrypi/vchiq.h"
+#include "vchiq.h"
#include "vchiq_cfg.h"

/* Do this so that we can test-build the code on non-rpi systems */
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.h b/include/linux/raspberrypi/vchiq_debugfs.h
similarity index 100%
rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.h
rename to include/linux/raspberrypi/vchiq_debugfs.h

--
2.50.1