At this point, we have all the information needed to define a new character device by using a device tree. In particular, this time, to register our chrdev device, we can use the new API that we skipped in Chapter 3, Working with Char Drivers.
Using a device tree to describe a character driver
Getting ready
As stated in the previous paragraph, we can use a device tree node to add a new device to our system. In particular, we can obtain a definition as reported in the following:
chrdev {
compatible = "ldddc,chrdev";
#address-cells = <1>;
#size-cells = <0>;
chrdev@2 {
label = "cdev-eeprom";
reg = <2>;
};
chrdev@4 {
label = "cdev-rom";
...