I'm working on bringing up a mipi camera on the imx8mp board. Android 11 2.2.0 is using GKI kernel config, which means all the custom modules we use for our board are compiled as .ko objects. Even if I select to compile them as built in modules, the build process modifies the .config and creates kernel modules anyway. But I think whether it is built in or external isn't the most important issue.
The problem is, that the imx8_media_dev module is loading before my camera module. So when that module loads, it isn't finding any cameras. Here is the output:
[ 1.304994] mxc-isi 32e00000.isi: mxc_isi.0 registered successfully
[ 1.338977] mx8-img-md: Registered mxc_isi.0.capture as /dev/video2
[ 1.351040] unregister ISI channel: mxc_isi.0
After unregister, there is no longer a /dev/video2 device.
My camera kernel module loads slightly thereafter and never does anything because no video links are created.
The Basler kernel module loads before the imx8_media_dev module and if we're using that camera, video links are created and all works as expected. In addition, if I manually unload the imx8_media_dev module after boot, and manually load it again (having already loaded our camera driver), the video links are created properly and our camera can work.
So I seem to be missing something in the build process or setup of our system that ensures our camera driver loads before imx8_media_dev. Can someone suggest how this is accomplished? I've placed my kernel module in the vendor_ramdisk, same location as the Basler kernel module is located but that doesn't seem to do the trick.