Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What "compatible" key to use in device tree?

I'm trying to write a device tree overlay to recognize a SPI-based enc28j60 module to my BeagleBone Black. This module doesn't show up in /kernel-dev/Documentation/devicetree/bindings but there does exist a driver for it in the kernel.

Does the lack of documentation indicate that the device tree binding is missing? Without being able to say something like compatible = "microchip,enc28j60", I'm wondering how else I can use the device tree overlay to load the enc28j60.ko driver?

like image 473
sholsapp Avatar asked Jul 26 '13 06:07

sholsapp


1 Answers

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

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

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

like image 54
sholsapp Avatar answered Oct 27 '22 01:10

sholsapp