Commit b18ee53a authored by Jacopo Mondi's avatar Jacopo Mondi Committed by Greg Kroah-Hartman

staging: bcm2835: Break MMAL support out from camera

The BCM2835 camera host is currently the only component that uses the
VCHIQ MMAL interface. This will soon change with the upporting of
BCM2835 ISP, which make use of the same interface.

Break VCHIQ MMAL interface support out from camera host directory to
make it possible for the ISP driver to use it as well.

The only modification to the existing mmal code is the introduction of
EXPORT_SYMBOL() for symbols required by bcm2835-camera and the addition
of the module author and licenses.
Signed-off-by: default avatarJacopo Mondi <jacopo@jmondi.org>
Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200623164235.29566-2-nsaenzjulienne@suse.deSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9666e8f8
...@@ -23,5 +23,7 @@ source "drivers/staging/vc04_services/bcm2835-audio/Kconfig" ...@@ -23,5 +23,7 @@ source "drivers/staging/vc04_services/bcm2835-audio/Kconfig"
source "drivers/staging/vc04_services/bcm2835-camera/Kconfig" source "drivers/staging/vc04_services/bcm2835-camera/Kconfig"
source "drivers/staging/vc04_services/vchiq-mmal/Kconfig"
endif endif
...@@ -10,8 +10,9 @@ vchiq-objs := \ ...@@ -10,8 +10,9 @@ vchiq-objs := \
interface/vchiq_arm/vchiq_util.o \ interface/vchiq_arm/vchiq_util.o \
interface/vchiq_arm/vchiq_connected.o \ interface/vchiq_arm/vchiq_connected.o \
obj-$(CONFIG_SND_BCM2835) += bcm2835-audio/ obj-$(CONFIG_SND_BCM2835) += bcm2835-audio/
obj-$(CONFIG_VIDEO_BCM2835) += bcm2835-camera/ obj-$(CONFIG_VIDEO_BCM2835) += bcm2835-camera/
obj-$(CONFIG_BCM2835_VCHIQ_MMAL) += vchiq-mmal/
ccflags-y += -D__VCCOREVER__=0x04000000 ccflags-y += -D__VCCOREVER__=0x04000000
...@@ -4,6 +4,7 @@ config VIDEO_BCM2835 ...@@ -4,6 +4,7 @@ config VIDEO_BCM2835
depends on MEDIA_SUPPORT depends on MEDIA_SUPPORT
depends on VIDEO_V4L2 && (ARCH_BCM2835 || COMPILE_TEST) depends on VIDEO_V4L2 && (ARCH_BCM2835 || COMPILE_TEST)
select BCM2835_VCHIQ select BCM2835_VCHIQ
select BCM2835_VCHIQ_MMAL
select VIDEOBUF2_VMALLOC select VIDEOBUF2_VMALLOC
select BTREE select BTREE
help help
......
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
bcm2835-v4l2-$(CONFIG_VIDEO_BCM2835) := \ bcm2835-v4l2-$(CONFIG_VIDEO_BCM2835) := \
bcm2835-camera.o \ bcm2835-camera.o \
controls.o \ controls.o
mmal-vchiq.o
obj-$(CONFIG_VIDEO_BCM2835) += bcm2835-v4l2.o obj-$(CONFIG_VIDEO_BCM2835) += bcm2835-v4l2.o
ccflags-y += \ ccflags-y += \
-I $(srctree)/$(src)/.. \ -I $(srctree)/$(src)/.. \
-I $(srctree)/$(src)/../vchiq-mmal/ \
-D__VCCOREVER__=0x04000000 -D__VCCOREVER__=0x04000000
config BCM2835_VCHIQ_MMAL
tristate "BCM2835 MMAL VCHIQ service"
depends on (ARCH_BCM2835 || COMPILE_TEST)
help
Enables the MMAL API over VCHIQ interface as used for the
majority of the multimedia services on VideoCore.
Defaults to Y when the Broadcomd BCM2835 camera host is selected.
# SPDX-License-Identifier: GPL-2.0
bcm2835-mmal-vchiq-objs := mmal-vchiq.o
obj-$(CONFIG_BCM2835_VCHIQ_MMAL) += bcm2835-mmal-vchiq.o
ccflags-y += \
-I$(srctree)/$(src)/.. \
-D__VCCOREVER__=0x04000000
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -1396,6 +1397,7 @@ int vchiq_mmal_port_set_format(struct vchiq_mmal_instance *instance, ...@@ -1396,6 +1397,7 @@ int vchiq_mmal_port_set_format(struct vchiq_mmal_instance *instance,
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(vchiq_mmal_port_set_format);
int vchiq_mmal_port_parameter_set(struct vchiq_mmal_instance *instance, int vchiq_mmal_port_parameter_set(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port, struct vchiq_mmal_port *port,
...@@ -1412,6 +1414,7 @@ int vchiq_mmal_port_parameter_set(struct vchiq_mmal_instance *instance, ...@@ -1412,6 +1414,7 @@ int vchiq_mmal_port_parameter_set(struct vchiq_mmal_instance *instance,
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(vchiq_mmal_port_parameter_set);
int vchiq_mmal_port_parameter_get(struct vchiq_mmal_instance *instance, int vchiq_mmal_port_parameter_get(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port, struct vchiq_mmal_port *port,
...@@ -1428,6 +1431,7 @@ int vchiq_mmal_port_parameter_get(struct vchiq_mmal_instance *instance, ...@@ -1428,6 +1431,7 @@ int vchiq_mmal_port_parameter_get(struct vchiq_mmal_instance *instance,
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(vchiq_mmal_port_parameter_get);
/* enable a port /* enable a port
* *
...@@ -1458,6 +1462,7 @@ int vchiq_mmal_port_enable(struct vchiq_mmal_instance *instance, ...@@ -1458,6 +1462,7 @@ int vchiq_mmal_port_enable(struct vchiq_mmal_instance *instance,
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(vchiq_mmal_port_enable);
int vchiq_mmal_port_disable(struct vchiq_mmal_instance *instance, int vchiq_mmal_port_disable(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port) struct vchiq_mmal_port *port)
...@@ -1478,6 +1483,7 @@ int vchiq_mmal_port_disable(struct vchiq_mmal_instance *instance, ...@@ -1478,6 +1483,7 @@ int vchiq_mmal_port_disable(struct vchiq_mmal_instance *instance,
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(vchiq_mmal_port_disable);
/* ports will be connected in a tunneled manner so data buffers /* ports will be connected in a tunneled manner so data buffers
* are not handled by client. * are not handled by client.
...@@ -1565,6 +1571,7 @@ int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance, ...@@ -1565,6 +1571,7 @@ int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance,
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(vchiq_mmal_port_connect_tunnel);
int vchiq_mmal_submit_buffer(struct vchiq_mmal_instance *instance, int vchiq_mmal_submit_buffer(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port, struct vchiq_mmal_port *port,
...@@ -1583,6 +1590,7 @@ int vchiq_mmal_submit_buffer(struct vchiq_mmal_instance *instance, ...@@ -1583,6 +1590,7 @@ int vchiq_mmal_submit_buffer(struct vchiq_mmal_instance *instance,
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(vchiq_mmal_submit_buffer);
int mmal_vchi_buffer_init(struct vchiq_mmal_instance *instance, int mmal_vchi_buffer_init(struct vchiq_mmal_instance *instance,
struct mmal_buffer *buf) struct mmal_buffer *buf)
...@@ -1595,6 +1603,7 @@ int mmal_vchi_buffer_init(struct vchiq_mmal_instance *instance, ...@@ -1595,6 +1603,7 @@ int mmal_vchi_buffer_init(struct vchiq_mmal_instance *instance,
buf->msg_context = msg_context; buf->msg_context = msg_context;
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(mmal_vchi_buffer_init);
int mmal_vchi_buffer_cleanup(struct mmal_buffer *buf) int mmal_vchi_buffer_cleanup(struct mmal_buffer *buf)
{ {
...@@ -1606,6 +1615,7 @@ int mmal_vchi_buffer_cleanup(struct mmal_buffer *buf) ...@@ -1606,6 +1615,7 @@ int mmal_vchi_buffer_cleanup(struct mmal_buffer *buf)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(mmal_vchi_buffer_cleanup);
/* Initialise a mmal component and its ports /* Initialise a mmal component and its ports
* *
...@@ -1693,6 +1703,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance, ...@@ -1693,6 +1703,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(vchiq_mmal_component_init);
/* /*
* cause a mmal component to be destroyed * cause a mmal component to be destroyed
...@@ -1714,6 +1725,7 @@ int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance, ...@@ -1714,6 +1725,7 @@ int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance,
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(vchiq_mmal_component_finalise);
/* /*
* cause a mmal component to be enabled * cause a mmal component to be enabled
...@@ -1739,6 +1751,7 @@ int vchiq_mmal_component_enable(struct vchiq_mmal_instance *instance, ...@@ -1739,6 +1751,7 @@ int vchiq_mmal_component_enable(struct vchiq_mmal_instance *instance,
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(vchiq_mmal_component_enable);
/* /*
* cause a mmal component to be enabled * cause a mmal component to be enabled
...@@ -1764,6 +1777,7 @@ int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance, ...@@ -1764,6 +1777,7 @@ int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance,
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(vchiq_mmal_component_disable);
int vchiq_mmal_version(struct vchiq_mmal_instance *instance, int vchiq_mmal_version(struct vchiq_mmal_instance *instance,
u32 *major_out, u32 *minor_out) u32 *major_out, u32 *minor_out)
...@@ -1779,6 +1793,7 @@ int vchiq_mmal_version(struct vchiq_mmal_instance *instance, ...@@ -1779,6 +1793,7 @@ int vchiq_mmal_version(struct vchiq_mmal_instance *instance,
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(vchiq_mmal_version);
int vchiq_mmal_finalise(struct vchiq_mmal_instance *instance) int vchiq_mmal_finalise(struct vchiq_mmal_instance *instance)
{ {
...@@ -1809,6 +1824,7 @@ int vchiq_mmal_finalise(struct vchiq_mmal_instance *instance) ...@@ -1809,6 +1824,7 @@ int vchiq_mmal_finalise(struct vchiq_mmal_instance *instance)
return status; return status;
} }
EXPORT_SYMBOL_GPL(vchiq_mmal_finalise);
int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance) int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance)
{ {
...@@ -1889,3 +1905,8 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance) ...@@ -1889,3 +1905,8 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance)
kfree(instance); kfree(instance);
return -ENODEV; return -ENODEV;
} }
EXPORT_SYMBOL_GPL(vchiq_mmal_init);
MODULE_DESCRIPTION("BCM2835 MMAL VCHIQ interface");
MODULE_AUTHOR("Dave Stevenson, <dave.stevenson@raspberrypi.org>");
MODULE_LICENSE("GPL");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment