11

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?

Charles
  • 50,943
  • 13
  • 104
  • 142
sholsapp
  • 15,542
  • 10
  • 50
  • 67

1 Answers1

9

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.

sholsapp
  • 15,542
  • 10
  • 50
  • 67