staging: vc04_services: Split vchiq-mmal into a module
authorDave Stevenson <dave.stevenson@raspberrypi.org>
Mon, 24 Sep 2018 15:30:37 +0000 (16:30 +0100)
committerpopcornmix <popcornmix@gmail.com>
Mon, 13 May 2019 23:08:13 +0000 (00:08 +0100)
In preparation for adding a video codec V4L2 module which also
wants to use vchiq-mmal functions, split it out into an
independent module.
The minimum number of changes have been made to achieve this
(eg straight moves where possible) so existing checkpatch
errors will still be present.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
15 files changed:
drivers/staging/vc04_services/Kconfig
drivers/staging/vc04_services/Makefile
drivers/staging/vc04_services/bcm2835-camera/Kconfig
drivers/staging/vc04_services/bcm2835-camera/Makefile
drivers/staging/vc04_services/vchiq-mmal/Kconfig [new file with mode: 0644]
drivers/staging/vc04_services/vchiq-mmal/Makefile [new file with mode: 0644]
drivers/staging/vc04_services/vchiq-mmal/mmal-common.h [moved from drivers/staging/vc04_services/bcm2835-camera/mmal-common.h with 100% similarity]
drivers/staging/vc04_services/vchiq-mmal/mmal-encodings.h [moved from drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h with 100% similarity]
drivers/staging/vc04_services/vchiq-mmal/mmal-msg-common.h [moved from drivers/staging/vc04_services/bcm2835-camera/mmal-msg-common.h with 100% similarity]
drivers/staging/vc04_services/vchiq-mmal/mmal-msg-format.h [moved from drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h with 100% similarity]
drivers/staging/vc04_services/vchiq-mmal/mmal-msg-port.h [moved from drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h with 100% similarity]
drivers/staging/vc04_services/vchiq-mmal/mmal-msg.h [moved from drivers/staging/vc04_services/bcm2835-camera/mmal-msg.h with 100% similarity]
drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h [moved from drivers/staging/vc04_services/bcm2835-camera/mmal-parameters.h with 100% similarity]
drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c [moved from drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c with 98% similarity]
drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h [moved from drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h with 100% similarity]

index 98064ce..9898764 100644 (file)
@@ -21,6 +21,7 @@ config BCM2835_VCHIQ
 source "drivers/staging/vc04_services/bcm2835-audio/Kconfig"
 
 source "drivers/staging/vc04_services/bcm2835-camera/Kconfig"
+source "drivers/staging/vc04_services/vchiq-mmal/Kconfig"
 
 endif
 
index afe43fa..91fa003 100644 (file)
@@ -12,6 +12,7 @@ vchiq-objs := \
 
 obj-$(CONFIG_SND_BCM2835)      += bcm2835-audio/
 obj-$(CONFIG_VIDEO_BCM2835)    += bcm2835-camera/
+obj-$(CONFIG_BCM2835_VCHIQ_MMAL) += vchiq-mmal/
 
 ccflags-y += -Idrivers/staging/vc04_services -D__VCCOREVER__=0x04000000
 
index b8b01aa..c2e422a 100644 (file)
@@ -2,7 +2,7 @@ config VIDEO_BCM2835
        tristate "BCM2835 Camera"
        depends on MEDIA_SUPPORT
        depends on VIDEO_V4L2 && (ARCH_BCM2835 || COMPILE_TEST)
-       select BCM2835_VCHIQ
+       select BCM2835_VCHIQ_MMAL
        select VIDEOBUF2_VMALLOC
        select BTREE
        help
index 2a4565e..35fe06b 100644 (file)
@@ -1,11 +1,11 @@
 # SPDX-License-Identifier: GPL-2.0
 bcm2835-v4l2-$(CONFIG_VIDEO_BCM2835) := \
        bcm2835-camera.o \
-       controls.o \
-       mmal-vchiq.o
+       controls.o
 
 obj-$(CONFIG_VIDEO_BCM2835) += bcm2835-v4l2.o
 
 ccflags-y += \
        -Idrivers/staging/vc04_services \
+       -Idrivers/staging/vc04_services/vchiq-mmal \
        -D__VCCOREVER__=0x04000000
diff --git a/drivers/staging/vc04_services/vchiq-mmal/Kconfig b/drivers/staging/vc04_services/vchiq-mmal/Kconfig
new file mode 100644 (file)
index 0000000..2288a95
--- /dev/null
@@ -0,0 +1,7 @@
+config BCM2835_VCHIQ_MMAL
+       tristate "BCM2835 MMAL VCHIQ service"
+       depends on (ARCH_BCM2835 || COMPILE_TEST)
+       select BCM2835_VCHIQ
+       help
+         Enables the MMAL API over VCHIQ as used for the
+         majority of the multimedia services on VideoCore.
diff --git a/drivers/staging/vc04_services/vchiq-mmal/Makefile b/drivers/staging/vc04_services/vchiq-mmal/Makefile
new file mode 100644 (file)
index 0000000..f1647fc
--- /dev/null
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: GPL-2.0
+bcm2835-mmal-vchiq-objs := mmal-vchiq.o
+
+obj-$(CONFIG_BCM2835_VCHIQ_MMAL) += bcm2835-mmal-vchiq.o
+
+ccflags-y += \
+       -Idrivers/staging/vc04_services \
+       -D__VCCOREVER__=0x04000000
@@ -17,6 +17,7 @@
 
 #include <linux/errno.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
 #define USE_VCHIQ_ARM
 #include "interface/vchi/vchi.h"
 
+MODULE_DESCRIPTION("BCM2835 MMAL VCHIQ interface");
+MODULE_AUTHOR("Dave Stevenson, <dave.stevenson@raspberrypi.org>");
+MODULE_LICENSE("GPL");
+MODULE_VERSION("0.0.1");
+
 /* maximum number of components supported */
 #define VCHIQ_MMAL_MAX_COMPONENTS 4
 
@@ -1396,6 +1402,7 @@ release_unlock:
 
        return ret;
 }
+EXPORT_SYMBOL_GPL(vchiq_mmal_port_set_format);
 
 int vchiq_mmal_port_parameter_set(struct vchiq_mmal_instance *instance,
                                  struct vchiq_mmal_port *port,
@@ -1412,6 +1419,7 @@ int vchiq_mmal_port_parameter_set(struct vchiq_mmal_instance *instance,
 
        return ret;
 }
+EXPORT_SYMBOL_GPL(vchiq_mmal_port_parameter_set);
 
 int vchiq_mmal_port_parameter_get(struct vchiq_mmal_instance *instance,
                                  struct vchiq_mmal_port *port,
@@ -1428,6 +1436,7 @@ int vchiq_mmal_port_parameter_get(struct vchiq_mmal_instance *instance,
 
        return ret;
 }
+EXPORT_SYMBOL_GPL(vchiq_mmal_port_parameter_get);
 
 /* enable a port
  *
@@ -1458,6 +1467,7 @@ unlock:
 
        return ret;
 }
+EXPORT_SYMBOL_GPL(vchiq_mmal_port_enable);
 
 int vchiq_mmal_port_disable(struct vchiq_mmal_instance *instance,
                            struct vchiq_mmal_port *port)
@@ -1478,6 +1488,7 @@ int vchiq_mmal_port_disable(struct vchiq_mmal_instance *instance,
 
        return ret;
 }
+EXPORT_SYMBOL_GPL(vchiq_mmal_port_disable);
 
 /* ports will be connected in a tunneled manner so data buffers
  * are not handled by client.
@@ -1565,6 +1576,7 @@ release_unlock:
 
        return ret;
 }
+EXPORT_SYMBOL_GPL(vchiq_mmal_port_connect_tunnel);
 
 int vchiq_mmal_submit_buffer(struct vchiq_mmal_instance *instance,
                             struct vchiq_mmal_port *port,
@@ -1583,6 +1595,7 @@ int vchiq_mmal_submit_buffer(struct vchiq_mmal_instance *instance,
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(vchiq_mmal_submit_buffer);
 
 int mmal_vchi_buffer_init(struct vchiq_mmal_instance *instance,
                          struct mmal_buffer *buf)
@@ -1595,6 +1608,7 @@ int mmal_vchi_buffer_init(struct vchiq_mmal_instance *instance,
        buf->msg_context = msg_context;
        return 0;
 }
+EXPORT_SYMBOL_GPL(mmal_vchi_buffer_init);
 
 int mmal_vchi_buffer_cleanup(struct mmal_buffer *buf)
 {
@@ -1606,6 +1620,7 @@ int mmal_vchi_buffer_cleanup(struct mmal_buffer *buf)
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(mmal_vchi_buffer_cleanup);
 
 /* Initialise a mmal component and its ports
  *
@@ -1693,6 +1708,7 @@ unlock:
 
        return ret;
 }
+EXPORT_SYMBOL_GPL(vchiq_mmal_component_init);
 
 /*
  * cause a mmal component to be destroyed
@@ -1714,6 +1730,7 @@ int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance,
 
        return ret;
 }
+EXPORT_SYMBOL_GPL(vchiq_mmal_component_finalise);
 
 /*
  * cause a mmal component to be enabled
@@ -1739,6 +1756,7 @@ int vchiq_mmal_component_enable(struct vchiq_mmal_instance *instance,
 
        return ret;
 }
+EXPORT_SYMBOL_GPL(vchiq_mmal_component_enable);
 
 /*
  * cause a mmal component to be enabled
@@ -1764,6 +1782,7 @@ int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance,
 
        return ret;
 }
+EXPORT_SYMBOL_GPL(vchiq_mmal_component_disable);
 
 int vchiq_mmal_version(struct vchiq_mmal_instance *instance,
                       u32 *major_out, u32 *minor_out)
@@ -1779,6 +1798,7 @@ int vchiq_mmal_version(struct vchiq_mmal_instance *instance,
 
        return ret;
 }
+EXPORT_SYMBOL_GPL(vchiq_mmal_version);
 
 int vchiq_mmal_finalise(struct vchiq_mmal_instance *instance)
 {
@@ -1809,6 +1829,7 @@ int vchiq_mmal_finalise(struct vchiq_mmal_instance *instance)
 
        return status;
 }
+EXPORT_SYMBOL_GPL(vchiq_mmal_finalise);
 
 int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance)
 {
@@ -1896,3 +1917,4 @@ err_free:
        kfree(instance);
        return -ENODEV;
 }
+EXPORT_SYMBOL_GPL(vchiq_mmal_init);