Add Driver to yocto



Is there any guidelines on how to build a driver out of the tree for the mangoh project. Otherwise I have seen under the mangoh directory a Linux_kernel_modules can I integrate the driver under that directory ? Thank you.


There are two ways to do it. You either get the Yocto Linux source tarball from and build a new Linux image with the kernel options you want enabled or you create .mdef files that you reference from your .sdef in the kernelModules section. There are certain things that can’t be achieved with the latter approach. Sometimes there are kernel options that can’t be built as modules so you must rebuild the kernel.


Hello dfrey,

Thank you for your quick response, I will go with the firest solution that you have proposed, however since I am newer with the yocto project I need to define a driver that uses the SPI1 interface. So am I in need to define a new interface in the Device tree or I can simplu use the existing one. One more thing please what are the device tree used for the WP7607 chip in the yocto project. Thank you


I don’t have much experience with device tree, but what I can tell you is that if your device has a kernel driver and it requires SPI, then you will want to make sure that the spidev driver isn’t bound to spi1.0


How could I know if the spidev is bounded to the spi1.0 or not knowing that I am using mangOH Red whcih contain only one spi interface ?


By running the following commands I got the following response :
root@swi-mdm9x15:~# modprobe spidev
root@swi-mdm9x15:~# ls /dev/spidev0.0

Is that confirms that spidev is not bounded to spi1.0 ?


I think I was a bit unclear. If you have a wp85/wp75 and you have /dev/spidev0.0 or a wp76/wp77 and have /dev/spidev1.0, then that means that the spidev driver is loaded for the SPI device provided by the WP module. Check if you system is registering the spisvc module which creates the spidev device. You will need to make sure that doesn’t load so that you can create a device of the appropriate type.