BBB DT based approach
05:12 18 Nov 2014

I have successfully implemented a GPIO based driver for my custom protocol using platform device model. I want to upgrade it using device tree approach. So for starters I have a beaglebone black, and I have cross compiled the kernel using the device tree config enabled and verified during uboot console messages showing

Verifying Checksum ... OK

Flattened Device Tree blob at 80f80000

Booting using the fdt blob at 0x80f80000

XIP Kernel Image ... OK

OK

Using Device Tree in place at 80f80000, end 80f899de

I added my entry into the board common file node name my_gpio {compatible = "my_gpio" }

Then I build the usual process make uImages dtbs LOADADDR....

Finally i get my uImage with dtb. In my driver i have used the same string "my_gpio" as .name property.

but my probe method is not getting called, which AFAIK is because it is not finding any compatible devices.

In my driver:

static struct platform_driver d_driver = {
        .driver = {
                        .name = "d_gpio",
                        .of_match_table = d_of_match,
        },
        .probe = D_probe,
        .remove = D_remove
};
linux-kernel linux-device-driver u-boot