0

I want to add a platform device file to my kernel (arch/arm/plat-mxc/devices/platform-spi_imx.c). Kernel 2.6.35, Freescale iMX53 processor. My device driver uses functions and structs defined in this platform file, however, I can't figure out how to get the file added to my kernel build. I tried adding the

CONFIG_ 

flag to my .config manually, but no luck.

  • Is this a third party module (or your own module) i.e. not part of the kernel that your distro provided? In that case, you don't add the module to the kernel tree, but you have to compile it using the Makefile provided, and then run depmod on the compiled module to add it to the kernel's list of modules. – Munir Jul 12 '17 at 19:11
  • The driver is my own and I've added it to the tree and it gets built as a module. This works okay. It's just that I need the platform device included as well as it defines some functions and structures I need. – dangeroushobo Jul 12 '17 at 19:29
  • I was talking about the platform device. I don't see it in the git tree on kernel.org at git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/… so it seems to be something that has been provided to you either by your distro or by the device vendor. They should have provided instructions to compile it as well. – Munir Jul 12 '17 at 20:00
  • Sounds like you are building "in tree" rather than as an external module ... and I presume you didn't mean CONFIG_ literally but the CONFIG_... option that enables your platform device ... so check that the Kconfig and Makefile files are correct for your platform device file (look at the way it's done for others) and then add a dependency on it's config option into your driver's Kconfig file entry – Murray Jensen Jul 13 '17 at 2:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.