I'm trying to configure a 4.18 Linux Kernel so that the mxc_hdmi driver is a kernel module instead of a built-in, like so: CONFIG_FB_MXC_HDMI=m instead of CONFIG_FB_MXC_HDMI=y.
When I did that I got these errors:
In file included from drivers/video/fbdev/mxc/mxcfb_hx8369_wvga.c:34:
drivers/video/fbdev/mxc/mipi_dsi.h:138:2: error: #error "Please configure MIPI LCD panel, we cannot find one!"
#error "Please configure MIPI LCD panel, we cannot find one!"
^~~~~
make[4]: *** [scripts/Makefile.build:321: drivers/video/fbdev/mxc/mxcfb_hx8369_wvga.o] Error 1
make[4]: *** Waiting for unfinished jobs....
In file included from drivers/video/fbdev/mxc/mipi_dsi.c:35:
drivers/video/fbdev/mxc/mipi_dsi.h:138:2: error: #error "Please configure MIPI LCD panel, we cannot find one!"
#error "Please configure MIPI LCD panel, we cannot find one!"
^~~~~
make[4]: *** [scripts/Makefile.build:321: drivers/video/fbdev/mxc/mipi_dsi.o] Error 1
In file included from drivers/video/fbdev/mxc/mxc_hdmi.c:21:
./include/linux/module.h:130:42: error: redefinition of ‘__inittest’
static inline initcall_t __maybe_unused __inittest(void) \
^~~~~~~~~~
drivers/video/fbdev/mxc/mxc_hdmi.c:2986:1: note: in expansion of macro ‘module_init’
module_init(mxc_hdmi_i2c_init);
^~~~~~~~~~~
./include/linux/module.h:130:42: note: previous definition of ‘__inittest’ was here
static inline initcall_t __maybe_unused __inittest(void) \
^~~~~~~~~~
drivers/video/fbdev/mxc/mxc_hdmi.c:2922:1: note: in expansion of macro ‘module_init’
module_init(mxc_hdmi_init);
^~~~~~~~~~~
./include/linux/module.h:132:6: error: redefinition of ‘init_module’
int init_module(void) __attribute__((alias(#initfn)));
^~~~~~~~~~~
drivers/video/fbdev/mxc/mxc_hdmi.c:2986:1: note: in expansion of macro ‘module_init’
module_init(mxc_hdmi_i2c_init);
^~~~~~~~~~~
./include/linux/module.h:132:6: note: previous definition of ‘init_module’ was here
int init_module(void) __attribute__((alias(#initfn)));
^~~~~~~~~~~
drivers/video/fbdev/mxc/mxc_hdmi.c:2922:1: note: in expansion of macro ‘module_init’
module_init(mxc_hdmi_init);
^~~~~~~~~~~
./include/linux/module.h:136:42: error: redefinition of ‘__exittest’
static inline exitcall_t __maybe_unused __exittest(void) \
^~~~~~~~~~
drivers/video/fbdev/mxc/mxc_hdmi.c:2987:1: note: in expansion of macro ‘module_exit’
module_exit(mxc_hdmi_i2c_exit);
^~~~~~~~~~~
./include/linux/module.h:136:42: note: previous definition of ‘__exittest’ was here
static inline exitcall_t __maybe_unused __exittest(void) \
^~~~~~~~~~
drivers/video/fbdev/mxc/mxc_hdmi.c:2935:1: note: in expansion of macro ‘module_exit’
module_exit(mxc_hdmi_exit);
^~~~~~~~~~~
./include/linux/module.h:138:7: error: redefinition of ‘cleanup_module’
void cleanup_module(void) __attribute__((alias(#exitfn)));
^~~~~~~~~~~~~~
drivers/video/fbdev/mxc/mxc_hdmi.c:2987:1: note: in expansion of macro ‘module_exit’
module_exit(mxc_hdmi_i2c_exit);
^~~~~~~~~~~
./include/linux/module.h:138:7: note: previous definition of ‘cleanup_module’ was here
void cleanup_module(void) __attribute__((alias(#exitfn)));
^~~~~~~~~~~~~~
drivers/video/fbdev/mxc/mxc_hdmi.c:2935:1: note: in expansion of macro ‘module_exit’
module_exit(mxc_hdmi_exit);
^~~~~~~~~~~
The "redefinition" of "module_init" and "module_exit" pointed me at the file drivers/video/fbdev/mxc/mxc_hdmi.c which contains 2 driver modules in the source file. Those 2 drivers are "mxc_hdmi " and "mxc_hdmi_i2c".
From what I read of the module.h include file, I think there can only be one call to "module_init" and "module_exit" per source code file.
That brings me to my question...
Were the mxc_hdmi and mxc_hdmi_i2c drivers never intended to be built as kernel modules, or am I just the first one to ever try doing this?
If there is no larger problem with building these drivers as kernel modules, I was planning to either pull the "mxc_hdmi_i2c" driver functions into a separate source file and add that to the build, or combine the 2 drivers into the mxc_hdmi driver since the i2c driver doesn't seem to be doing much.