What "compatible" key is used in the device tree?

I am trying to write a device tree overlay to recognize an SPI-based enc28j60 module for my BeagleBone Black. This module does not appear in /kernel-dev/Documentation/devicetree/bindings , but a driver exists for it.

Is there no documentation that there is no device tree binding? Unable to say something like compatible = "microchip,enc28j60" , I wonder how else can I use the device tree overlay to load the enc28j60.ko driver?

+7
linux embedded-linux device-tree beagleboneblack
source share
1 answer

After some research and grep'ing, it seems that devicetree compatible drivers have a piece of code that looks like this:

 static struct of_device_id enc28j60_of_match[] __devinitdata = { { .compatible = "microchip,enc28j60", }, {} }; 

which is then included in the platform_driver structure. This tells the kernel how to react if it encounters compatible = "microchip,enc28j60" in a devicetree overlay.

+5
source share

All Articles