linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] staging: Destage VCHIQ interface and MMAL
@ 2025-08-27  6:24 Jai Luthra
  2025-08-27  6:24 ` [PATCH 1/5] include: linux: Destage VCHIQ interface headers Jai Luthra
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Jai Luthra @ 2025-08-27  6:24 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list,
	Greg Kroah-Hartman, Ray Jui, Scott Branden
  Cc: linux-rpi-kernel, linux-arm-kernel, linux-staging, linux-kernel,
	kernel-list, Stefan Wahren, Dave Stevenson, Laurent Pinchart,
	Jai Luthra, Umang Jain

Hi,

The goal of this series is to begin the destaging and upstreaming
process for various Raspberry Pi peripherals that currently interact
with the firmware using the VCHIQ interface present in the staging tree.

While destaging the interface to drivers/platform/broadcom, also move
the VCHIQ memory abstraction layer (MMAL) driver. Secondly, drop the
bcm2835-camera driver, as the bcm2835-unicam driver using V4L2 framework
is the recommended way to capture from CSI sensors on this platform.

The bcm2835-audio driver is left as-is in the staging tree, as I am not
an expert on ALSA. Volunteers are welcome :)

In (a) subsequent series, I will upstream the following components that
use VCHIQ interface:
- vc-sm-cma driver
- bcm2835-isp driver

Thanks,
	Jai

Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
---
Jai Luthra (4):
      staging: vc04_services: Cleanup formatting TODO entry
      platform/broadcom: Destage VCHIQ interface
      media: staging: Drop bcm2835-camera driver
      platform/broadcom: Destage VCHIQ MMAL driver

Umang Jain (1):
      include: linux: Destage VCHIQ interface headers

 MAINTAINERS                                        |    2 +
 drivers/platform/Kconfig                           |    2 +
 drivers/platform/Makefile                          |    1 +
 drivers/platform/broadcom/Kconfig                  |   39 +
 drivers/platform/broadcom/Makefile                 |   15 +
 .../broadcom/vchiq-interface}/TESTING              |    0
 .../broadcom/vchiq-interface}/TODO                 |    6 -
 .../broadcom/vchiq-interface}/vchiq_arm.c          |    9 +-
 .../broadcom/vchiq-interface}/vchiq_bus.c          |    4 +-
 .../broadcom/vchiq-interface}/vchiq_core.c         |    4 +-
 .../broadcom/vchiq-interface}/vchiq_debugfs.c      |    6 +-
 .../broadcom/vchiq-interface}/vchiq_dev.c          |    7 +-
 .../broadcom/vchiq-interface}/vchiq_ioctl.h        |    3 +-
 .../broadcom}/vchiq-mmal/Kconfig                   |    0
 .../broadcom}/vchiq-mmal/Makefile                  |    0
 .../broadcom}/vchiq-mmal/mmal-common.h             |    0
 .../broadcom}/vchiq-mmal/mmal-encodings.h          |    0
 .../broadcom}/vchiq-mmal/mmal-msg-common.h         |    0
 .../broadcom}/vchiq-mmal/mmal-msg-format.h         |    0
 .../broadcom}/vchiq-mmal/mmal-msg-port.h           |    0
 .../broadcom}/vchiq-mmal/mmal-msg.h                |    0
 .../broadcom}/vchiq-mmal/mmal-parameters.h         |    0
 .../broadcom}/vchiq-mmal/mmal-vchiq.c              |    5 +-
 .../broadcom}/vchiq-mmal/mmal-vchiq.h              |    0
 drivers/staging/vc04_services/Kconfig              |   39 -
 drivers/staging/vc04_services/Makefile             |   14 -
 .../vc04_services/bcm2835-audio/bcm2835-vchiq.c    |    5 +-
 .../staging/vc04_services/bcm2835-audio/bcm2835.c  |    3 +-
 .../staging/vc04_services/bcm2835-audio/bcm2835.h  |    3 +-
 .../staging/vc04_services/bcm2835-camera/Kconfig   |   13 -
 .../staging/vc04_services/bcm2835-camera/Makefile  |    6 -
 drivers/staging/vc04_services/bcm2835-camera/TODO  |   17 -
 .../vc04_services/bcm2835-camera/bcm2835-camera.c  | 2011 --------------------
 .../vc04_services/bcm2835-camera/bcm2835-camera.h  |  142 --
 .../vc04_services/bcm2835-camera/controls.c        | 1399 --------------
 .../raspberrypi => include/linux/vchiq}/vchiq.h    |    0
 .../vchiq_arm => include/linux/vchiq}/vchiq_arm.h  |    0
 .../vchiq_arm => include/linux/vchiq}/vchiq_bus.h  |    0
 .../vchiq_arm => include/linux/vchiq}/vchiq_cfg.h  |    0
 .../vchiq_arm => include/linux/vchiq}/vchiq_core.h |    2 +-
 .../linux/vchiq}/vchiq_debugfs.h                   |    0
 41 files changed, 86 insertions(+), 3671 deletions(-)
---
base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
change-id: 20250827-vchiq-destage-39de1e67557d

Best regards,
-- 
Jai Luthra <jai.luthra@ideasonboard.com>



^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/5] include: linux: Destage VCHIQ interface headers
  2025-08-27  6:24 [PATCH 0/5] staging: Destage VCHIQ interface and MMAL Jai Luthra
@ 2025-08-27  6:24 ` Jai Luthra
  2025-08-27 12:40   ` Laurent Pinchart
  2025-08-27  6:24 ` [PATCH 2/5] staging: vc04_services: Cleanup formatting TODO entry Jai Luthra
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Jai Luthra @ 2025-08-27  6:24 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list,
	Greg Kroah-Hartman, Ray Jui, Scott Branden
  Cc: linux-rpi-kernel, linux-arm-kernel, linux-staging, linux-kernel,
	kernel-list, Stefan Wahren, Dave Stevenson, Laurent Pinchart,
	Jai Luthra, Umang Jain

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

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

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/vchiq/ provides a central location to serve both
of these areas.

Signed-off-by: Umang Jain <umang.jain@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 +++--
 .../include/linux/raspberrypi => include/linux/vchiq}/vchiq.h    | 0
 .../interface/vchiq_arm => include/linux/vchiq}/vchiq_arm.h      | 0
 .../interface/vchiq_arm => include/linux/vchiq}/vchiq_bus.h      | 0
 .../interface/vchiq_arm => include/linux/vchiq}/vchiq_cfg.h      | 0
 .../interface/vchiq_arm => include/linux/vchiq}/vchiq_core.h     | 2 +-
 .../interface/vchiq_arm => include/linux/vchiq}/vchiq_debugfs.h  | 0
 18 files changed, 30 insertions(+), 25 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index fe168477caa45799dfe07de2f54de6d6a1ce0615..f17ebb1fa51bd7e4dcb2ae1b0fced6d41685dc84 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/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..c49f2f7409b84ed6ebdd71787566efb1bc230f55 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/vchiq/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..5011720940715c12a2d2fe58b40ed84dcb2e6824 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/vchiq/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..7e63ef251c37269032fc20ae1237855245e5e0a7 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/vchiq/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..fcbbe1aa60b768e5a7a08a131f595a0457f4473a 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/vchiq/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..10138c1454dd7fdcbab6b95ea41f8e1ac2defc4b 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/vchiq/vchiq_core.h>
+#include <linux/vchiq/vchiq_arm.h>
+#include <linux/vchiq/vchiq_bus.h>
+#include <linux/vchiq/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..5d55dbff82150a84b15483e71718c48f5cb8caea 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/vchiq/vchiq_arm.h>
+#include <linux/vchiq/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..ac0379f5f45dfa331dc2fec8d580d176f931cf2b 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/vchiq/vchiq_arm.h>
+#include <linux/vchiq/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..b1a8f1abafc2fa83132b1a02ba343d71315950de 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/vchiq/vchiq_core.h>
+#include <linux/vchiq/vchiq_arm.h>
+#include <linux/vchiq/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..781d6dd64ee33816b52b62f1f25bcd33363d8e02 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/vchiq/vchiq_core.h>
+#include <linux/vchiq/vchiq_arm.h>
+#include <linux/vchiq/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..638469f18f859a0c7e738ef5bed7bf3c3ebebe59 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/vchiq/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..f5e141908b0f91ca4172d48aee37f0329d239d7c 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/vchiq/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/vchiq/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/vchiq/vchiq.h
similarity index 100%
rename from drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h
rename to include/linux/vchiq/vchiq.h
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/include/linux/vchiq/vchiq_arm.h
similarity index 100%
rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
rename to include/linux/vchiq/vchiq_arm.h
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h b/include/linux/vchiq/vchiq_bus.h
similarity index 100%
rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h
rename to include/linux/vchiq/vchiq_bus.h
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_cfg.h b/include/linux/vchiq/vchiq_cfg.h
similarity index 100%
rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_cfg.h
rename to include/linux/vchiq/vchiq_cfg.h
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/include/linux/vchiq/vchiq_core.h
similarity index 99%
rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
rename to include/linux/vchiq/vchiq_core.h
index 9b4e766990a493d6e9d4e0604f2c84f4e7b77804..dbcb19e7a6d39b94967261c4ab23d6325e999249 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
+++ b/include/linux/vchiq/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/vchiq/vchiq_debugfs.h
similarity index 100%
rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.h
rename to include/linux/vchiq/vchiq_debugfs.h

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/5] staging: vc04_services: Cleanup formatting TODO entry
  2025-08-27  6:24 [PATCH 0/5] staging: Destage VCHIQ interface and MMAL Jai Luthra
  2025-08-27  6:24 ` [PATCH 1/5] include: linux: Destage VCHIQ interface headers Jai Luthra
@ 2025-08-27  6:24 ` Jai Luthra
  2025-08-27 12:45   ` Laurent Pinchart
  2025-08-27 18:55   ` Stefan Wahren
  2025-08-27  6:24 ` [PATCH 3/5] platform/broadcom: Destage VCHIQ interface Jai Luthra
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 15+ messages in thread
From: Jai Luthra @ 2025-08-27  6:24 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list,
	Greg Kroah-Hartman, Ray Jui, Scott Branden
  Cc: linux-rpi-kernel, linux-arm-kernel, linux-staging, linux-kernel,
	kernel-list, Stefan Wahren, Dave Stevenson, Laurent Pinchart,
	Jai Luthra

The code indentation for the vchiq interface driver is not so bad
anymore [1], so drop it from the TODO.

Link: https://lore.kernel.org/all/20241013112128.397249-1-umang.jain@ideasonboard.com/ [1]
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
---
 drivers/staging/vc04_services/interface/TODO | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/TODO b/drivers/staging/vc04_services/interface/TODO
index f6f24600aa86240fba77169f62f3e657e42727c3..6e5f27db88ba8e533ee1fabc3091771d8efe66a2 100644
--- a/drivers/staging/vc04_services/interface/TODO
+++ b/drivers/staging/vc04_services/interface/TODO
@@ -20,9 +20,3 @@ some of the ones we want:
 
 A short top-down description of this driver's architecture (function of
 kthreads, userspace, limitations) could be very helpful for reviewers.
-
-* Reformat core code with more sane indentations
-
-The code follows the 80 characters limitation yet tends to go 3 or 4 levels of
-indentation deep making it very unpleasant to read. This is specially relevant
-in the character driver ioctl code and in the core thread functions.

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/5] platform/broadcom: Destage VCHIQ interface
  2025-08-27  6:24 [PATCH 0/5] staging: Destage VCHIQ interface and MMAL Jai Luthra
  2025-08-27  6:24 ` [PATCH 1/5] include: linux: Destage VCHIQ interface headers Jai Luthra
  2025-08-27  6:24 ` [PATCH 2/5] staging: vc04_services: Cleanup formatting TODO entry Jai Luthra
@ 2025-08-27  6:24 ` Jai Luthra
  2025-08-27  6:24 ` [PATCH 5/5] platform/broadcom: Destage VCHIQ MMAL driver Jai Luthra
       [not found] ` <20250827-vchiq-destage-v1-4-5052a0d81c42@ideasonboard.com>
  4 siblings, 0 replies; 15+ messages in thread
From: Jai Luthra @ 2025-08-27  6:24 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list,
	Greg Kroah-Hartman, Ray Jui, Scott Branden
  Cc: linux-rpi-kernel, linux-arm-kernel, linux-staging, linux-kernel,
	kernel-list, Stefan Wahren, Dave Stevenson, Laurent Pinchart,
	Jai Luthra

Destage the VCHIQ interface driver to drivers/platform/broadcom.

The remaining TODO items are as follows:
1. Upstream the vc_mem char driver
2. Upstream the vc-sm-cma driver
3. Improve documentation

These can be handled separately, after destaging the main interface
here.

Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
---
 MAINTAINERS                                        |  1 +
 drivers/platform/Kconfig                           |  2 ++
 drivers/platform/Makefile                          |  1 +
 drivers/platform/broadcom/Kconfig                  | 37 ++++++++++++++++++++++
 drivers/platform/broadcom/Makefile                 | 14 ++++++++
 .../broadcom/vchiq-interface}/TESTING              |  0
 .../broadcom/vchiq-interface}/TODO                 |  0
 .../broadcom/vchiq-interface}/vchiq_arm.c          |  0
 .../broadcom/vchiq-interface}/vchiq_bus.c          |  0
 .../broadcom/vchiq-interface}/vchiq_core.c         |  0
 .../broadcom/vchiq-interface}/vchiq_debugfs.c      |  0
 .../broadcom/vchiq-interface}/vchiq_dev.c          |  0
 .../broadcom/vchiq-interface}/vchiq_ioctl.h        |  0
 drivers/staging/vc04_services/Kconfig              | 35 --------------------
 drivers/staging/vc04_services/Makefile             | 12 -------
 15 files changed, 55 insertions(+), 47 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index f17ebb1fa51bd7e4dcb2ae1b0fced6d41685dc84..f39f326a88d7332906ecdd1d9d90cc6848ba3205 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4753,6 +4753,7 @@ S:	Maintained
 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/platform/broadcom/vchiq-interface
 F:	drivers/staging/vc04_services
 F:	include/linux/vchiq
 N:	bcm2711
diff --git a/drivers/platform/Kconfig b/drivers/platform/Kconfig
index 960fd6a82450a4c7b97d51ea3bc29795ee74efd1..325ae46a723a2e6cb15373ea1f94810e0d250e06 100644
--- a/drivers/platform/Kconfig
+++ b/drivers/platform/Kconfig
@@ -18,3 +18,5 @@ source "drivers/platform/surface/Kconfig"
 source "drivers/platform/x86/Kconfig"
 
 source "drivers/platform/arm64/Kconfig"
+
+source "drivers/platform/broadcom/Kconfig"
diff --git a/drivers/platform/Makefile b/drivers/platform/Makefile
index 19ac54648586eb617af0f8a69e3205bd83e8c35b..2616a4585519acb45cd78adb1c2b67ee16ffb6a6 100644
--- a/drivers/platform/Makefile
+++ b/drivers/platform/Makefile
@@ -13,3 +13,4 @@ obj-$(CONFIG_CHROME_PLATFORMS)	+= chrome/
 obj-$(CONFIG_CZNIC_PLATFORMS)	+= cznic/
 obj-$(CONFIG_SURFACE_PLATFORMS)	+= surface/
 obj-$(CONFIG_ARM64_PLATFORM_DEVICES)	+= arm64/
+obj-$(CONFIG_BCM2835_VCHIQ)	+= broadcom/
diff --git a/drivers/platform/broadcom/Kconfig b/drivers/platform/broadcom/Kconfig
new file mode 100644
index 0000000000000000000000000000000000000000..7dec1ca85d6c56bdb21a9cb170c1d0cdf7587e63
--- /dev/null
+++ b/drivers/platform/broadcom/Kconfig
@@ -0,0 +1,37 @@
+# SPDX-License-Identifier: GPL-2.0
+
+config BCM2835_VCHIQ
+	tristate "BCM2835 VCHIQ"
+	depends on BCM_VIDEOCORE && HAS_DMA
+	imply VCHIQ_CDEV
+	help
+		Broadcom BCM2835 and similar SoCs have a VPU called VideoCore.
+		This config enables the VCHIQ driver, which implements a
+		messaging interface between the kernel and the firmware running
+		on VideoCore. Other drivers use this interface to communicate to
+		the VPU. More specifically, the VCHIQ driver is used by
+		audio/video and camera drivers as well as for implementing MMAL
+		API, which is in turn used by several multimedia services on the
+		BCM2835 family of SoCs.
+
+		Defaults to Y when the Broadcom Videocore services are included
+		in the build, N otherwise.
+
+if BCM2835_VCHIQ
+
+config VCHIQ_CDEV
+	bool "VCHIQ Character Driver"
+	help
+		Enable the creation of VCHIQ character driver. The cdev exposes
+		ioctls used by userspace libraries and testing tools to interact
+		with VideoCore, via the VCHIQ core driver (Check BCM2835_VCHIQ
+		for more info).
+
+		This can be set to 'N' if the VideoCore communication is not
+		needed by userspace but only by other kernel modules
+		(like bcm2835-audio).
+
+		If not sure, set this to 'Y'.
+
+endif
+
diff --git a/drivers/platform/broadcom/Makefile b/drivers/platform/broadcom/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..a807571c59a47bb418cbb1dfcc389219d0d0ff22
--- /dev/null
+++ b/drivers/platform/broadcom/Makefile
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: GPL-2.0
+
+obj-$(CONFIG_BCM2835_VCHIQ)	+= vchiq.o
+
+vchiq-objs := \
+   vchiq-interface/vchiq_core.o  \
+   vchiq-interface/vchiq_arm.o \
+   vchiq-interface/vchiq_bus.o \
+   vchiq-interface/vchiq_debugfs.o \
+
+ifdef CONFIG_VCHIQ_CDEV
+vchiq-objs += vchiq-interface/vchiq_dev.o
+endif
+
diff --git a/drivers/staging/vc04_services/interface/TESTING b/drivers/platform/broadcom/vchiq-interface/TESTING
similarity index 100%
rename from drivers/staging/vc04_services/interface/TESTING
rename to drivers/platform/broadcom/vchiq-interface/TESTING
diff --git a/drivers/staging/vc04_services/interface/TODO b/drivers/platform/broadcom/vchiq-interface/TODO
similarity index 100%
rename from drivers/staging/vc04_services/interface/TODO
rename to drivers/platform/broadcom/vchiq-interface/TODO
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/platform/broadcom/vchiq-interface/vchiq_arm.c
similarity index 100%
rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
rename to drivers/platform/broadcom/vchiq-interface/vchiq_arm.c
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c b/drivers/platform/broadcom/vchiq-interface/vchiq_bus.c
similarity index 100%
rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
rename to drivers/platform/broadcom/vchiq-interface/vchiq_bus.c
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/platform/broadcom/vchiq-interface/vchiq_core.c
similarity index 100%
rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
rename to drivers/platform/broadcom/vchiq-interface/vchiq_core.c
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c b/drivers/platform/broadcom/vchiq-interface/vchiq_debugfs.c
similarity index 100%
rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c
rename to drivers/platform/broadcom/vchiq-interface/vchiq_debugfs.c
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c b/drivers/platform/broadcom/vchiq-interface/vchiq_dev.c
similarity index 100%
rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c
rename to drivers/platform/broadcom/vchiq-interface/vchiq_dev.c
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_ioctl.h b/drivers/platform/broadcom/vchiq-interface/vchiq_ioctl.h
similarity index 100%
rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_ioctl.h
rename to drivers/platform/broadcom/vchiq-interface/vchiq_ioctl.h
diff --git a/drivers/staging/vc04_services/Kconfig b/drivers/staging/vc04_services/Kconfig
index ccc8e15886482e8caa4aeb12440036183fc9b80c..3c01a1a304f1e6e6a03062b1a5f6af59643adf66 100644
--- a/drivers/staging/vc04_services/Kconfig
+++ b/drivers/staging/vc04_services/Kconfig
@@ -11,41 +11,6 @@ menuconfig BCM_VIDEOCORE
 
 if BCM_VIDEOCORE
 
-config BCM2835_VCHIQ
-	tristate "BCM2835 VCHIQ"
-	depends on HAS_DMA
-	imply VCHIQ_CDEV
-	help
-		Broadcom BCM2835 and similar SoCs have a VPU called VideoCore.
-		This config enables the VCHIQ driver, which implements a
-		messaging interface between the kernel and the firmware running
-		on VideoCore. Other drivers use this interface to communicate to
-		the VPU. More specifically, the VCHIQ driver is used by
-		audio/video and camera drivers as well as for implementing MMAL
-		API, which is in turn used by several multimedia services on the
-		BCM2835 family of SoCs.
-
-		Defaults to Y when the Broadcom Videocore services are included
-		in the build, N otherwise.
-
-if BCM2835_VCHIQ
-
-config VCHIQ_CDEV
-	bool "VCHIQ Character Driver"
-	help
-		Enable the creation of VCHIQ character driver. The cdev exposes
-		ioctls used by userspace libraries and testing tools to interact
-		with VideoCore, via the VCHIQ core driver (Check BCM2835_VCHIQ
-		for more info).
-
-		This can be set to 'N' if the VideoCore communication is not
-		needed by userspace but only by other kernel modules
-		(like bcm2835-audio).
-
-		If not sure, set this to 'Y'.
-
-endif
-
 source "drivers/staging/vc04_services/bcm2835-audio/Kconfig"
 
 source "drivers/staging/vc04_services/bcm2835-camera/Kconfig"
diff --git a/drivers/staging/vc04_services/Makefile b/drivers/staging/vc04_services/Makefile
index dad3789522b80420f1f72ca8f740c816fb3d9843..51c9466ec7a28141cf66508f602f43cd89ad408b 100644
--- a/drivers/staging/vc04_services/Makefile
+++ b/drivers/staging/vc04_services/Makefile
@@ -1,16 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_BCM2835_VCHIQ)	+= vchiq.o
-
-vchiq-objs := \
-   interface/vchiq_arm/vchiq_core.o  \
-   interface/vchiq_arm/vchiq_arm.o \
-   interface/vchiq_arm/vchiq_bus.o \
-   interface/vchiq_arm/vchiq_debugfs.o \
-
-ifdef CONFIG_VCHIQ_CDEV
-vchiq-objs += interface/vchiq_arm/vchiq_dev.o
-endif
-
 obj-$(CONFIG_SND_BCM2835)		+= bcm2835-audio/
 obj-$(CONFIG_VIDEO_BCM2835)		+= bcm2835-camera/
 obj-$(CONFIG_BCM2835_VCHIQ_MMAL)	+= vchiq-mmal/

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 5/5] platform/broadcom: Destage VCHIQ MMAL driver
  2025-08-27  6:24 [PATCH 0/5] staging: Destage VCHIQ interface and MMAL Jai Luthra
                   ` (2 preceding siblings ...)
  2025-08-27  6:24 ` [PATCH 3/5] platform/broadcom: Destage VCHIQ interface Jai Luthra
@ 2025-08-27  6:24 ` Jai Luthra
       [not found] ` <20250827-vchiq-destage-v1-4-5052a0d81c42@ideasonboard.com>
  4 siblings, 0 replies; 15+ messages in thread
From: Jai Luthra @ 2025-08-27  6:24 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list,
	Greg Kroah-Hartman, Ray Jui, Scott Branden
  Cc: linux-rpi-kernel, linux-arm-kernel, linux-staging, linux-kernel,
	kernel-list, Stefan Wahren, Dave Stevenson, Laurent Pinchart,
	Jai Luthra

Destage the VCHIQ MMAL driver to drivers/platform/broadcom.

Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
---
 MAINTAINERS                                                             | 2 +-
 drivers/platform/broadcom/Kconfig                                       | 2 ++
 drivers/platform/broadcom/Makefile                                      | 1 +
 drivers/{staging/vc04_services => platform/broadcom}/vchiq-mmal/Kconfig | 0
 .../{staging/vc04_services => platform/broadcom}/vchiq-mmal/Makefile    | 0
 .../vc04_services => platform/broadcom}/vchiq-mmal/mmal-common.h        | 0
 .../vc04_services => platform/broadcom}/vchiq-mmal/mmal-encodings.h     | 0
 .../vc04_services => platform/broadcom}/vchiq-mmal/mmal-msg-common.h    | 0
 .../vc04_services => platform/broadcom}/vchiq-mmal/mmal-msg-format.h    | 0
 .../vc04_services => platform/broadcom}/vchiq-mmal/mmal-msg-port.h      | 0
 .../{staging/vc04_services => platform/broadcom}/vchiq-mmal/mmal-msg.h  | 0
 .../vc04_services => platform/broadcom}/vchiq-mmal/mmal-parameters.h    | 0
 .../vc04_services => platform/broadcom}/vchiq-mmal/mmal-vchiq.c         | 0
 .../vc04_services => platform/broadcom}/vchiq-mmal/mmal-vchiq.h         | 0
 drivers/staging/vc04_services/Kconfig                                   | 2 --
 drivers/staging/vc04_services/Makefile                                  | 1 -
 16 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index f39f326a88d7332906ecdd1d9d90cc6848ba3205..5a554add28a65dd42c5d08e01ecbf14c771e9925 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4753,7 +4753,7 @@ S:	Maintained
 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/platform/broadcom/vchiq-interface
+F:	drivers/platform/broadcom/vchiq-*
 F:	drivers/staging/vc04_services
 F:	include/linux/vchiq
 N:	bcm2711
diff --git a/drivers/platform/broadcom/Kconfig b/drivers/platform/broadcom/Kconfig
index 7dec1ca85d6c56bdb21a9cb170c1d0cdf7587e63..606f3f19774989cbb41d2a207a10a32edd420622 100644
--- a/drivers/platform/broadcom/Kconfig
+++ b/drivers/platform/broadcom/Kconfig
@@ -33,5 +33,7 @@ config VCHIQ_CDEV
 
 		If not sure, set this to 'Y'.
 
+source "drivers/platform/broadcom/vchiq-mmal/Kconfig"
+
 endif
 
diff --git a/drivers/platform/broadcom/Makefile b/drivers/platform/broadcom/Makefile
index a807571c59a47bb418cbb1dfcc389219d0d0ff22..2a7c9511e5d8bbe11c05680eea016ef40796b648 100644
--- a/drivers/platform/broadcom/Makefile
+++ b/drivers/platform/broadcom/Makefile
@@ -12,3 +12,4 @@ ifdef CONFIG_VCHIQ_CDEV
 vchiq-objs += vchiq-interface/vchiq_dev.o
 endif
 
+obj-$(CONFIG_BCM2835_VCHIQ_MMAL)	+= vchiq-mmal/
diff --git a/drivers/staging/vc04_services/vchiq-mmal/Kconfig b/drivers/platform/broadcom/vchiq-mmal/Kconfig
similarity index 100%
rename from drivers/staging/vc04_services/vchiq-mmal/Kconfig
rename to drivers/platform/broadcom/vchiq-mmal/Kconfig
diff --git a/drivers/staging/vc04_services/vchiq-mmal/Makefile b/drivers/platform/broadcom/vchiq-mmal/Makefile
similarity index 100%
rename from drivers/staging/vc04_services/vchiq-mmal/Makefile
rename to drivers/platform/broadcom/vchiq-mmal/Makefile
diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-common.h b/drivers/platform/broadcom/vchiq-mmal/mmal-common.h
similarity index 100%
rename from drivers/staging/vc04_services/vchiq-mmal/mmal-common.h
rename to drivers/platform/broadcom/vchiq-mmal/mmal-common.h
diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-encodings.h b/drivers/platform/broadcom/vchiq-mmal/mmal-encodings.h
similarity index 100%
rename from drivers/staging/vc04_services/vchiq-mmal/mmal-encodings.h
rename to drivers/platform/broadcom/vchiq-mmal/mmal-encodings.h
diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-msg-common.h b/drivers/platform/broadcom/vchiq-mmal/mmal-msg-common.h
similarity index 100%
rename from drivers/staging/vc04_services/vchiq-mmal/mmal-msg-common.h
rename to drivers/platform/broadcom/vchiq-mmal/mmal-msg-common.h
diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-msg-format.h b/drivers/platform/broadcom/vchiq-mmal/mmal-msg-format.h
similarity index 100%
rename from drivers/staging/vc04_services/vchiq-mmal/mmal-msg-format.h
rename to drivers/platform/broadcom/vchiq-mmal/mmal-msg-format.h
diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-msg-port.h b/drivers/platform/broadcom/vchiq-mmal/mmal-msg-port.h
similarity index 100%
rename from drivers/staging/vc04_services/vchiq-mmal/mmal-msg-port.h
rename to drivers/platform/broadcom/vchiq-mmal/mmal-msg-port.h
diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-msg.h b/drivers/platform/broadcom/vchiq-mmal/mmal-msg.h
similarity index 100%
rename from drivers/staging/vc04_services/vchiq-mmal/mmal-msg.h
rename to drivers/platform/broadcom/vchiq-mmal/mmal-msg.h
diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h b/drivers/platform/broadcom/vchiq-mmal/mmal-parameters.h
similarity index 100%
rename from drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h
rename to drivers/platform/broadcom/vchiq-mmal/mmal-parameters.h
diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/platform/broadcom/vchiq-mmal/mmal-vchiq.c
similarity index 100%
rename from drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
rename to drivers/platform/broadcom/vchiq-mmal/mmal-vchiq.c
diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h b/drivers/platform/broadcom/vchiq-mmal/mmal-vchiq.h
similarity index 100%
rename from drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
rename to drivers/platform/broadcom/vchiq-mmal/mmal-vchiq.h
diff --git a/drivers/staging/vc04_services/Kconfig b/drivers/staging/vc04_services/Kconfig
index 23b5e3dde11447064d084ea5a6d36b8041dceb08..65116b171e88bec7b7f453b17b33478c967b66cf 100644
--- a/drivers/staging/vc04_services/Kconfig
+++ b/drivers/staging/vc04_services/Kconfig
@@ -13,7 +13,5 @@ if BCM_VIDEOCORE
 
 source "drivers/staging/vc04_services/bcm2835-audio/Kconfig"
 
-source "drivers/staging/vc04_services/vchiq-mmal/Kconfig"
-
 endif
 
diff --git a/drivers/staging/vc04_services/Makefile b/drivers/staging/vc04_services/Makefile
index 7a716a5c781530b673027b9f82ec94ebfd615f8a..ba15ec663af0fabaf0060456fc997deb5e5e0533 100644
--- a/drivers/staging/vc04_services/Makefile
+++ b/drivers/staging/vc04_services/Makefile
@@ -1,4 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_SND_BCM2835)		+= bcm2835-audio/
-obj-$(CONFIG_BCM2835_VCHIQ_MMAL)	+= vchiq-mmal/
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/5] include: linux: Destage VCHIQ interface headers
  2025-08-27  6:24 ` [PATCH 1/5] include: linux: Destage VCHIQ interface headers Jai Luthra
@ 2025-08-27 12:40   ` Laurent Pinchart
  2025-08-27 14:33     ` Umang Jain
  0 siblings, 1 reply; 15+ messages in thread
From: Laurent Pinchart @ 2025-08-27 12:40 UTC (permalink / raw)
  To: Jai Luthra
  Cc: Florian Fainelli, Broadcom internal kernel review list,
	Greg Kroah-Hartman, Ray Jui, Scott Branden, linux-rpi-kernel,
	linux-arm-kernel, linux-staging, linux-kernel, kernel-list,
	Stefan Wahren, Dave Stevenson, Umang Jain

Hi Jai,

Thank you for the patch.

On Wed, Aug 27, 2025 at 11:54:08AM +0530, Jai Luthra wrote:
> From: Umang Jain <umang.jain@ideasonboard.com>
> 
> Move the VCHIQ headers from drivers/staging/vc04_services/include to
> include/linux/vchiq
> 
> 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/vchiq/ provides a central location to serve both
> of these areas.

Lots of SoC-specific headers are stored in include/linux/soc/$vendor/.
This would be include/linux/soc/bcm/vchiq/ in this case. I'm also fine
with include/linux/vchiq/ but other people may have a preference.

> Signed-off-by: Umang Jain <umang.jain@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 +++--
>  .../include/linux/raspberrypi => include/linux/vchiq}/vchiq.h    | 0
>  .../interface/vchiq_arm => include/linux/vchiq}/vchiq_arm.h      | 0
>  .../interface/vchiq_arm => include/linux/vchiq}/vchiq_bus.h      | 0
>  .../interface/vchiq_arm => include/linux/vchiq}/vchiq_cfg.h      | 0
>  .../interface/vchiq_arm => include/linux/vchiq}/vchiq_core.h     | 2 +-
>  .../interface/vchiq_arm => include/linux/vchiq}/vchiq_debugfs.h  | 0
>  18 files changed, 30 insertions(+), 25 deletions(-)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index fe168477caa45799dfe07de2f54de6d6a1ce0615..f17ebb1fa51bd7e4dcb2ae1b0fced6d41685dc84 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/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..c49f2f7409b84ed6ebdd71787566efb1bc230f55 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/vchiq/vchiq_arm.h>

You can group this with the other headers above (ideally in alphabetical
order when #include statements are already sorted). Same comment where
applicable below.

With that,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +
>  #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..5011720940715c12a2d2fe58b40ed84dcb2e6824 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/vchiq/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..7e63ef251c37269032fc20ae1237855245e5e0a7 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/vchiq/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..fcbbe1aa60b768e5a7a08a131f595a0457f4473a 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/vchiq/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..10138c1454dd7fdcbab6b95ea41f8e1ac2defc4b 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/vchiq/vchiq_core.h>
> +#include <linux/vchiq/vchiq_arm.h>
> +#include <linux/vchiq/vchiq_bus.h>
> +#include <linux/vchiq/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..5d55dbff82150a84b15483e71718c48f5cb8caea 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/vchiq/vchiq_arm.h>
> +#include <linux/vchiq/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..ac0379f5f45dfa331dc2fec8d580d176f931cf2b 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/vchiq/vchiq_arm.h>
> +#include <linux/vchiq/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..b1a8f1abafc2fa83132b1a02ba343d71315950de 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/vchiq/vchiq_core.h>
> +#include <linux/vchiq/vchiq_arm.h>
> +#include <linux/vchiq/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..781d6dd64ee33816b52b62f1f25bcd33363d8e02 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/vchiq/vchiq_core.h>
> +#include <linux/vchiq/vchiq_arm.h>
> +#include <linux/vchiq/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..638469f18f859a0c7e738ef5bed7bf3c3ebebe59 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/vchiq/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..f5e141908b0f91ca4172d48aee37f0329d239d7c 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/vchiq/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/vchiq/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/vchiq/vchiq.h
> similarity index 100%
> rename from drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h
> rename to include/linux/vchiq/vchiq.h
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/include/linux/vchiq/vchiq_arm.h
> similarity index 100%
> rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
> rename to include/linux/vchiq/vchiq_arm.h
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h b/include/linux/vchiq/vchiq_bus.h
> similarity index 100%
> rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h
> rename to include/linux/vchiq/vchiq_bus.h
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_cfg.h b/include/linux/vchiq/vchiq_cfg.h
> similarity index 100%
> rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_cfg.h
> rename to include/linux/vchiq/vchiq_cfg.h
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/include/linux/vchiq/vchiq_core.h
> similarity index 99%
> rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
> rename to include/linux/vchiq/vchiq_core.h
> index 9b4e766990a493d6e9d4e0604f2c84f4e7b77804..dbcb19e7a6d39b94967261c4ab23d6325e999249 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
> +++ b/include/linux/vchiq/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/vchiq/vchiq_debugfs.h
> similarity index 100%
> rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.h
> rename to include/linux/vchiq/vchiq_debugfs.h
> 

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/5] staging: vc04_services: Cleanup formatting TODO entry
  2025-08-27  6:24 ` [PATCH 2/5] staging: vc04_services: Cleanup formatting TODO entry Jai Luthra
@ 2025-08-27 12:45   ` Laurent Pinchart
  2025-08-27 18:55   ` Stefan Wahren
  1 sibling, 0 replies; 15+ messages in thread
From: Laurent Pinchart @ 2025-08-27 12:45 UTC (permalink / raw)
  To: Jai Luthra
  Cc: Florian Fainelli, Broadcom internal kernel review list,
	Greg Kroah-Hartman, Ray Jui, Scott Branden, linux-rpi-kernel,
	linux-arm-kernel, linux-staging, linux-kernel, kernel-list,
	Stefan Wahren, Dave Stevenson

On Wed, Aug 27, 2025 at 11:54:09AM +0530, Jai Luthra wrote:
> The code indentation for the vchiq interface driver is not so bad
> anymore [1], so drop it from the TODO.
> 
> Link: https://lore.kernel.org/all/20241013112128.397249-1-umang.jain@ideasonboard.com/ [1]

Adding '[1]' at the end doesn't seem to be standard practice and may
break automatic parsing. I'd drop that and reword the commit message
accordingly.

> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/staging/vc04_services/interface/TODO | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/staging/vc04_services/interface/TODO b/drivers/staging/vc04_services/interface/TODO
> index f6f24600aa86240fba77169f62f3e657e42727c3..6e5f27db88ba8e533ee1fabc3091771d8efe66a2 100644
> --- a/drivers/staging/vc04_services/interface/TODO
> +++ b/drivers/staging/vc04_services/interface/TODO
> @@ -20,9 +20,3 @@ some of the ones we want:
>  
>  A short top-down description of this driver's architecture (function of
>  kthreads, userspace, limitations) could be very helpful for reviewers.
> -
> -* Reformat core code with more sane indentations
> -
> -The code follows the 80 characters limitation yet tends to go 3 or 4 levels of
> -indentation deep making it very unpleasant to read. This is specially relevant
> -in the character driver ioctl code and in the core thread functions.

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] media: staging: Drop bcm2835-camera driver
       [not found] ` <20250827-vchiq-destage-v1-4-5052a0d81c42@ideasonboard.com>
@ 2025-08-27 12:48   ` Laurent Pinchart
  2025-08-27 19:18   ` Stefan Wahren
  1 sibling, 0 replies; 15+ messages in thread
From: Laurent Pinchart @ 2025-08-27 12:48 UTC (permalink / raw)
  To: Jai Luthra
  Cc: Florian Fainelli, Broadcom internal kernel review list,
	Greg Kroah-Hartman, Ray Jui, Scott Branden, linux-rpi-kernel,
	linux-arm-kernel, linux-staging, linux-kernel, kernel-list,
	Stefan Wahren, Dave Stevenson

Hi Jai,

Thank you for the patch.

On Wed, Aug 27, 2025 at 11:54:11AM +0530, Jai Luthra wrote:
> The bcm2835-camera driver is replaced by the V4L2 bcm2835-unicam driver
> that is already upstream. So drop it from staging.
> 
> This also simplifies destaging of VCHIQ MMAL, by reducing the users of
> the MMAL API (this driver is one of them).
> 
> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/staging/vc04_services/Kconfig              |    2 -
>  drivers/staging/vc04_services/Makefile             |    1 -
>  .../staging/vc04_services/bcm2835-camera/Kconfig   |   13 -
>  .../staging/vc04_services/bcm2835-camera/Makefile  |    6 -
>  drivers/staging/vc04_services/bcm2835-camera/TODO  |   17 -
>  .../vc04_services/bcm2835-camera/bcm2835-camera.c  | 2012 --------------------
>  .../vc04_services/bcm2835-camera/bcm2835-camera.h  |  142 --
>  .../vc04_services/bcm2835-camera/controls.c        | 1399 --------------
>  8 files changed, 3592 deletions(-)

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/5] include: linux: Destage VCHIQ interface headers
  2025-08-27 12:40   ` Laurent Pinchart
@ 2025-08-27 14:33     ` Umang Jain
  2025-08-27 19:05       ` Stefan Wahren
  0 siblings, 1 reply; 15+ messages in thread
From: Umang Jain @ 2025-08-27 14:33 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Jai Luthra, Florian Fainelli,
	Broadcom internal kernel review list, Greg Kroah-Hartman, Ray Jui,
	Scott Branden, linux-rpi-kernel, linux-arm-kernel, linux-staging,
	linux-kernel, kernel-list, Stefan Wahren, Dave Stevenson

On Wed, Aug 27, 2025 at 02:40:16PM +0200, Laurent Pinchart wrote:
> Hi Jai,
> 
> Thank you for the patch.
> 
> On Wed, Aug 27, 2025 at 11:54:08AM +0530, Jai Luthra wrote:
> > From: Umang Jain <umang.jain@ideasonboard.com>
> > 
> > Move the VCHIQ headers from drivers/staging/vc04_services/include to
> > include/linux/vchiq
> > 
> > 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/vchiq/ provides a central location to serve both
> > of these areas.
> 
> Lots of SoC-specific headers are stored in include/linux/soc/$vendor/.
> This would be include/linux/soc/bcm/vchiq/ in this case. I'm also fine
> with include/linux/vchiq/ but other people may have a preference.

I agree with this point and I might have missed to notice the
include/linux/soc earlier. That's seems a better location to me since
it's actually broadcom-specific.

> 
> > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> > Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>

And thanks for taking this over!

> > ---
> >  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 +++--
> >  .../include/linux/raspberrypi => include/linux/vchiq}/vchiq.h    | 0
> >  .../interface/vchiq_arm => include/linux/vchiq}/vchiq_arm.h      | 0
> >  .../interface/vchiq_arm => include/linux/vchiq}/vchiq_bus.h      | 0
> >  .../interface/vchiq_arm => include/linux/vchiq}/vchiq_cfg.h      | 0
> >  .../interface/vchiq_arm => include/linux/vchiq}/vchiq_core.h     | 2 +-
> >  .../interface/vchiq_arm => include/linux/vchiq}/vchiq_debugfs.h  | 0
> >  18 files changed, 30 insertions(+), 25 deletions(-)
> > 
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index fe168477caa45799dfe07de2f54de6d6a1ce0615..f17ebb1fa51bd7e4dcb2ae1b0fced6d41685dc84 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/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..c49f2f7409b84ed6ebdd71787566efb1bc230f55 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/vchiq/vchiq_arm.h>
> 
> You can group this with the other headers above (ideally in alphabetical
> order when #include statements are already sorted). Same comment where
> applicable below.
> 
> With that,
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> > +
> >  #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..5011720940715c12a2d2fe58b40ed84dcb2e6824 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/vchiq/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..7e63ef251c37269032fc20ae1237855245e5e0a7 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/vchiq/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..fcbbe1aa60b768e5a7a08a131f595a0457f4473a 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/vchiq/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..10138c1454dd7fdcbab6b95ea41f8e1ac2defc4b 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/vchiq/vchiq_core.h>
> > +#include <linux/vchiq/vchiq_arm.h>
> > +#include <linux/vchiq/vchiq_bus.h>
> > +#include <linux/vchiq/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..5d55dbff82150a84b15483e71718c48f5cb8caea 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/vchiq/vchiq_arm.h>
> > +#include <linux/vchiq/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..ac0379f5f45dfa331dc2fec8d580d176f931cf2b 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/vchiq/vchiq_arm.h>
> > +#include <linux/vchiq/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..b1a8f1abafc2fa83132b1a02ba343d71315950de 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/vchiq/vchiq_core.h>
> > +#include <linux/vchiq/vchiq_arm.h>
> > +#include <linux/vchiq/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..781d6dd64ee33816b52b62f1f25bcd33363d8e02 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/vchiq/vchiq_core.h>
> > +#include <linux/vchiq/vchiq_arm.h>
> > +#include <linux/vchiq/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..638469f18f859a0c7e738ef5bed7bf3c3ebebe59 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/vchiq/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..f5e141908b0f91ca4172d48aee37f0329d239d7c 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/vchiq/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/vchiq/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/vchiq/vchiq.h
> > similarity index 100%
> > rename from drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h
> > rename to include/linux/vchiq/vchiq.h
> > diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/include/linux/vchiq/vchiq_arm.h
> > similarity index 100%
> > rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
> > rename to include/linux/vchiq/vchiq_arm.h
> > diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h b/include/linux/vchiq/vchiq_bus.h
> > similarity index 100%
> > rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h
> > rename to include/linux/vchiq/vchiq_bus.h
> > diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_cfg.h b/include/linux/vchiq/vchiq_cfg.h
> > similarity index 100%
> > rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_cfg.h
> > rename to include/linux/vchiq/vchiq_cfg.h
> > diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/include/linux/vchiq/vchiq_core.h
> > similarity index 99%
> > rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
> > rename to include/linux/vchiq/vchiq_core.h
> > index 9b4e766990a493d6e9d4e0604f2c84f4e7b77804..dbcb19e7a6d39b94967261c4ab23d6325e999249 100644
> > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
> > +++ b/include/linux/vchiq/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/vchiq/vchiq_debugfs.h
> > similarity index 100%
> > rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.h
> > rename to include/linux/vchiq/vchiq_debugfs.h
> > 
> 
> -- 
> Regards,
> 
> Laurent Pinchart


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/5] staging: vc04_services: Cleanup formatting TODO entry
  2025-08-27  6:24 ` [PATCH 2/5] staging: vc04_services: Cleanup formatting TODO entry Jai Luthra
  2025-08-27 12:45   ` Laurent Pinchart
@ 2025-08-27 18:55   ` Stefan Wahren
  1 sibling, 0 replies; 15+ messages in thread
From: Stefan Wahren @ 2025-08-27 18:55 UTC (permalink / raw)
  To: Jai Luthra, Florian Fainelli,
	Broadcom internal kernel review list, Greg Kroah-Hartman, Ray Jui,
	Scott Branden
  Cc: linux-rpi-kernel, linux-arm-kernel, linux-staging, linux-kernel,
	kernel-list, Dave Stevenson, Laurent Pinchart

Hi Jai,

Am 27.08.25 um 08:24 schrieb Jai Luthra:
> The code indentation for the vchiq interface driver is not so bad
> anymore [1], so drop it from the TODO.
please also drop the point "Import drivers using VCHI." because this is 
very old (Linux 4.4) and I don't see a reason why this is related to 
destaging.

Best regards
>
> Link: https://lore.kernel.org/all/20241013112128.397249-1-umang.jain@ideasonboard.com/ [1]
> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
> ---
>   drivers/staging/vc04_services/interface/TODO | 6 ------
>   1 file changed, 6 deletions(-)
>
> diff --git a/drivers/staging/vc04_services/interface/TODO b/drivers/staging/vc04_services/interface/TODO
> index f6f24600aa86240fba77169f62f3e657e42727c3..6e5f27db88ba8e533ee1fabc3091771d8efe66a2 100644
> --- a/drivers/staging/vc04_services/interface/TODO
> +++ b/drivers/staging/vc04_services/interface/TODO
> @@ -20,9 +20,3 @@ some of the ones we want:
>   
>   A short top-down description of this driver's architecture (function of
>   kthreads, userspace, limitations) could be very helpful for reviewers.
> -
> -* Reformat core code with more sane indentations
> -
> -The code follows the 80 characters limitation yet tends to go 3 or 4 levels of
> -indentation deep making it very unpleasant to read. This is specially relevant
> -in the character driver ioctl code and in the core thread functions.
>



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/5] include: linux: Destage VCHIQ interface headers
  2025-08-27 14:33     ` Umang Jain
@ 2025-08-27 19:05       ` Stefan Wahren
  2025-08-28  2:17         ` Florian Fainelli
  0 siblings, 1 reply; 15+ messages in thread
From: Stefan Wahren @ 2025-08-27 19:05 UTC (permalink / raw)
  To: Umang Jain, Jai Luthra, Laurent Pinchart
  Cc: Florian Fainelli, Broadcom internal kernel review list,
	Greg Kroah-Hartman, Ray Jui, Scott Branden, linux-rpi-kernel,
	linux-arm-kernel, linux-staging, linux-kernel, kernel-list,
	Dave Stevenson

Hi,

Am 27.08.25 um 16:33 schrieb Umang Jain:
> On Wed, Aug 27, 2025 at 02:40:16PM +0200, Laurent Pinchart wrote:
>> Hi Jai,
>>
>> Thank you for the patch.
>>
>> On Wed, Aug 27, 2025 at 11:54:08AM +0530, Jai Luthra wrote:
>>> From: Umang Jain <umang.jain@ideasonboard.com>
>>>
>>> Move the VCHIQ headers from drivers/staging/vc04_services/include to
>>> include/linux/vchiq
>>>
>>> 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/vchiq/ provides a central location to serve both
>>> of these areas.
>> Lots of SoC-specific headers are stored in include/linux/soc/$vendor/.
>> This would be include/linux/soc/bcm/vchiq/ in this case. I'm also fine
>> with include/linux/vchiq/ but other people may have a preference.
> I agree with this point and I might have missed to notice the
> include/linux/soc earlier. That's seems a better location to me since
> it's actually broadcom-specific.
I would expect that headers and source would be more related.

For example:

include/linux/soc/bcm

drivers/soc/bcm/

Just my 2 cents
>>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
>>> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
> And thanks for taking this over!
>
>>> ---
>>>   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 +++--
>>>   .../include/linux/raspberrypi => include/linux/vchiq}/vchiq.h    | 0
>>>   .../interface/vchiq_arm => include/linux/vchiq}/vchiq_arm.h      | 0
>>>   .../interface/vchiq_arm => include/linux/vchiq}/vchiq_bus.h      | 0
>>>   .../interface/vchiq_arm => include/linux/vchiq}/vchiq_cfg.h      | 0
>>>   .../interface/vchiq_arm => include/linux/vchiq}/vchiq_core.h     | 2 +-
>>>   .../interface/vchiq_arm => include/linux/vchiq}/vchiq_debugfs.h  | 0
>>>   18 files changed, 30 insertions(+), 25 deletions(-)
>>>
>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>> index fe168477caa45799dfe07de2f54de6d6a1ce0615..f17ebb1fa51bd7e4dcb2ae1b0fced6d41685dc84 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/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..c49f2f7409b84ed6ebdd71787566efb1bc230f55 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/vchiq/vchiq_arm.h>
>> You can group this with the other headers above (ideally in alphabetical
>> order when #include statements are already sorted). Same comment where
>> applicable below.
>>
>> With that,
>>
>> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>>
>>> +
>>>   #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..5011720940715c12a2d2fe58b40ed84dcb2e6824 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/vchiq/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..7e63ef251c37269032fc20ae1237855245e5e0a7 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/vchiq/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..fcbbe1aa60b768e5a7a08a131f595a0457f4473a 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/vchiq/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..10138c1454dd7fdcbab6b95ea41f8e1ac2defc4b 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/vchiq/vchiq_core.h>
>>> +#include <linux/vchiq/vchiq_arm.h>
>>> +#include <linux/vchiq/vchiq_bus.h>
>>> +#include <linux/vchiq/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..5d55dbff82150a84b15483e71718c48f5cb8caea 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/vchiq/vchiq_arm.h>
>>> +#include <linux/vchiq/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..ac0379f5f45dfa331dc2fec8d580d176f931cf2b 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/vchiq/vchiq_arm.h>
>>> +#include <linux/vchiq/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..b1a8f1abafc2fa83132b1a02ba343d71315950de 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/vchiq/vchiq_core.h>
>>> +#include <linux/vchiq/vchiq_arm.h>
>>> +#include <linux/vchiq/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..781d6dd64ee33816b52b62f1f25bcd33363d8e02 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/vchiq/vchiq_core.h>
>>> +#include <linux/vchiq/vchiq_arm.h>
>>> +#include <linux/vchiq/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..638469f18f859a0c7e738ef5bed7bf3c3ebebe59 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/vchiq/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..f5e141908b0f91ca4172d48aee37f0329d239d7c 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/vchiq/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/vchiq/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/vchiq/vchiq.h
>>> similarity index 100%
>>> rename from drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h
>>> rename to include/linux/vchiq/vchiq.h
>>> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/include/linux/vchiq/vchiq_arm.h
>>> similarity index 100%
>>> rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
>>> rename to include/linux/vchiq/vchiq_arm.h
>>> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h b/include/linux/vchiq/vchiq_bus.h
>>> similarity index 100%
>>> rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h
>>> rename to include/linux/vchiq/vchiq_bus.h
>>> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_cfg.h b/include/linux/vchiq/vchiq_cfg.h
>>> similarity index 100%
>>> rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_cfg.h
>>> rename to include/linux/vchiq/vchiq_cfg.h
>>> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/include/linux/vchiq/vchiq_core.h
>>> similarity index 99%
>>> rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
>>> rename to include/linux/vchiq/vchiq_core.h
>>> index 9b4e766990a493d6e9d4e0604f2c84f4e7b77804..dbcb19e7a6d39b94967261c4ab23d6325e999249 100644
>>> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
>>> +++ b/include/linux/vchiq/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/vchiq/vchiq_debugfs.h
>>> similarity index 100%
>>> rename from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.h
>>> rename to include/linux/vchiq/vchiq_debugfs.h
>>>
>> -- 
>> Regards,
>>
>> Laurent Pinchart



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] media: staging: Drop bcm2835-camera driver
       [not found] ` <20250827-vchiq-destage-v1-4-5052a0d81c42@ideasonboard.com>
  2025-08-27 12:48   ` [PATCH 4/5] media: staging: Drop bcm2835-camera driver Laurent Pinchart
@ 2025-08-27 19:18   ` Stefan Wahren
  2025-09-01 10:59     ` Dave Stevenson
  1 sibling, 1 reply; 15+ messages in thread
From: Stefan Wahren @ 2025-08-27 19:18 UTC (permalink / raw)
  To: Jai Luthra, Florian Fainelli,
	Broadcom internal kernel review list, Greg Kroah-Hartman, Ray Jui,
	Scott Branden
  Cc: linux-rpi-kernel, linux-arm-kernel, linux-staging, linux-kernel,
	kernel-list, Dave Stevenson, Laurent Pinchart

Hi Jai,

Am 27.08.25 um 08:24 schrieb Jai Luthra:
> The bcm2835-camera driver is replaced by the V4L2 bcm2835-unicam driver
> that is already upstream. So drop it from staging.
AFAIK the old Raspberry Pi Camera V1 isn't supported by V4L2 
bcm2835-unicam. Personally i'm fine with this, but this must be clear in 
the commit message.Did you already talked to distributions like Redhat & 
OpenSuSE about this step?
> This also simplifies destaging of VCHIQ MMAL, by reducing the users of
> the MMAL API (this driver is one of them).
AFAIU this drops the only one user of VCHIQ MMAL. So please explain, why 
we still need this API and how this should be tested?

Best regards


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/5] include: linux: Destage VCHIQ interface headers
  2025-08-27 19:05       ` Stefan Wahren
@ 2025-08-28  2:17         ` Florian Fainelli
  2025-08-28  6:19           ` Stefan Wahren
  0 siblings, 1 reply; 15+ messages in thread
From: Florian Fainelli @ 2025-08-28  2:17 UTC (permalink / raw)
  To: Stefan Wahren, Umang Jain, Jai Luthra, Laurent Pinchart
  Cc: Broadcom internal kernel review list, Greg Kroah-Hartman, Ray Jui,
	Scott Branden, linux-rpi-kernel, linux-arm-kernel, linux-staging,
	linux-kernel, kernel-list, Dave Stevenson



On 8/27/2025 12:05 PM, Stefan Wahren wrote:
> Hi,
> 
> Am 27.08.25 um 16:33 schrieb Umang Jain:
>> On Wed, Aug 27, 2025 at 02:40:16PM +0200, Laurent Pinchart wrote:
>>> Hi Jai,
>>>
>>> Thank you for the patch.
>>>
>>> On Wed, Aug 27, 2025 at 11:54:08AM +0530, Jai Luthra wrote:
>>>> From: Umang Jain <umang.jain@ideasonboard.com>
>>>>
>>>> Move the VCHIQ headers from drivers/staging/vc04_services/include to
>>>> include/linux/vchiq
>>>>
>>>> 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/vchiq/ provides a central location to serve both
>>>> of these areas.
>>> Lots of SoC-specific headers are stored in include/linux/soc/$vendor/.
>>> This would be include/linux/soc/bcm/vchiq/ in this case. I'm also fine
>>> with include/linux/vchiq/ but other people may have a preference.
>> I agree with this point and I might have missed to notice the
>> include/linux/soc earlier. That's seems a better location to me since
>> it's actually broadcom-specific.
> I would expect that headers and source would be more related.
> 
> For example:
> 
> include/linux/soc/bcm
> 
> drivers/soc/bcm/

This is not Broadcom code, it is Raspberry Pi AFAICT, therefore, just 
like drivers/firmware/raspberrypi.c, we would need some namespacing here 
that reflects that, ideally.
-- 
Florian



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/5] include: linux: Destage VCHIQ interface headers
  2025-08-28  2:17         ` Florian Fainelli
@ 2025-08-28  6:19           ` Stefan Wahren
  0 siblings, 0 replies; 15+ messages in thread
From: Stefan Wahren @ 2025-08-28  6:19 UTC (permalink / raw)
  To: Florian Fainelli, Umang Jain, Jai Luthra, Laurent Pinchart
  Cc: Broadcom internal kernel review list, Greg Kroah-Hartman, Ray Jui,
	Scott Branden, linux-rpi-kernel, linux-arm-kernel, linux-staging,
	linux-kernel, kernel-list, Dave Stevenson

Hi Florian,

Am 28.08.25 um 04:17 schrieb Florian Fainelli:
>
>
> On 8/27/2025 12:05 PM, Stefan Wahren wrote:
>> Hi,
>>
>> Am 27.08.25 um 16:33 schrieb Umang Jain:
>>> On Wed, Aug 27, 2025 at 02:40:16PM +0200, Laurent Pinchart wrote:
>>>> Hi Jai,
>>>>
>>>> Thank you for the patch.
>>>>
>>>> On Wed, Aug 27, 2025 at 11:54:08AM +0530, Jai Luthra wrote:
>>>>> From: Umang Jain <umang.jain@ideasonboard.com>
>>>>>
>>>>> Move the VCHIQ headers from drivers/staging/vc04_services/include to
>>>>> include/linux/vchiq
>>>>>
>>>>> 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/vchiq/ provides a central location to serve both
>>>>> of these areas.
>>>> Lots of SoC-specific headers are stored in include/linux/soc/$vendor/.
>>>> This would be include/linux/soc/bcm/vchiq/ in this case. I'm also fine
>>>> with include/linux/vchiq/ but other people may have a preference.
>>> I agree with this point and I might have missed to notice the
>>> include/linux/soc earlier. That's seems a better location to me since
>>> it's actually broadcom-specific.
>> I would expect that headers and source would be more related.
>>
>> For example:
>>
>> include/linux/soc/bcm
>>
>> drivers/soc/bcm/
>
> This is not Broadcom code, it is Raspberry Pi AFAICT, therefore, just 
> like drivers/firmware/raspberrypi.c, we would need some namespacing 
> here that reflects that, ideally.
The VCHIQ code originally comes from Broadcom, but the current 
implementation has been adapted and tested for Raspberry Pi. I'm not 
against a Raspberry Pi specific namespace.

Should this also apply to the DT bindings?

Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-vchiq.yaml

Best regards



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] media: staging: Drop bcm2835-camera driver
  2025-08-27 19:18   ` Stefan Wahren
@ 2025-09-01 10:59     ` Dave Stevenson
  0 siblings, 0 replies; 15+ messages in thread
From: Dave Stevenson @ 2025-09-01 10:59 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Jai Luthra, Florian Fainelli,
	Broadcom internal kernel review list, Greg Kroah-Hartman, Ray Jui,
	Scott Branden, linux-rpi-kernel, linux-arm-kernel, linux-staging,
	linux-kernel, kernel-list, Laurent Pinchart

Hi Stefan

On Wed, 27 Aug 2025 at 20:18, Stefan Wahren <wahrenst@gmx.net> wrote:
>
> Hi Jai,
>
> Am 27.08.25 um 08:24 schrieb Jai Luthra:
> > The bcm2835-camera driver is replaced by the V4L2 bcm2835-unicam driver
> > that is already upstream. So drop it from staging.
> AFAIK the old Raspberry Pi Camera V1 isn't supported by V4L2
> bcm2835-unicam.

The Pi v1 camera is Omnivision's OV5647.
There is a driver in drivers/media/i2c/ov5647.c, and that is supported
on the Pi via libcamera.

It does look like we have a number of downstream patches to that
driver that I ought to upstream - always something to do.

  Dave

> Personally i'm fine with this, but this must be clear in
> the commit message.Did you already talked to distributions like Redhat &
> OpenSuSE about this step?
> > This also simplifies destaging of VCHIQ MMAL, by reducing the users of
> > the MMAL API (this driver is one of them).
> AFAIU this drops the only one user of VCHIQ MMAL. So please explain, why
> we still need this API and how this should be tested?
>
> Best regards


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-09-01 12:59 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-27  6:24 [PATCH 0/5] staging: Destage VCHIQ interface and MMAL Jai Luthra
2025-08-27  6:24 ` [PATCH 1/5] include: linux: Destage VCHIQ interface headers Jai Luthra
2025-08-27 12:40   ` Laurent Pinchart
2025-08-27 14:33     ` Umang Jain
2025-08-27 19:05       ` Stefan Wahren
2025-08-28  2:17         ` Florian Fainelli
2025-08-28  6:19           ` Stefan Wahren
2025-08-27  6:24 ` [PATCH 2/5] staging: vc04_services: Cleanup formatting TODO entry Jai Luthra
2025-08-27 12:45   ` Laurent Pinchart
2025-08-27 18:55   ` Stefan Wahren
2025-08-27  6:24 ` [PATCH 3/5] platform/broadcom: Destage VCHIQ interface Jai Luthra
2025-08-27  6:24 ` [PATCH 5/5] platform/broadcom: Destage VCHIQ MMAL driver Jai Luthra
     [not found] ` <20250827-vchiq-destage-v1-4-5052a0d81c42@ideasonboard.com>
2025-08-27 12:48   ` [PATCH 4/5] media: staging: Drop bcm2835-camera driver Laurent Pinchart
2025-08-27 19:18   ` Stefan Wahren
2025-09-01 10:59     ` Dave Stevenson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).