3

I want to remove device node on overlay dts , but it doesn't work.
sample code as belows:

a.dtsi:
&soc {
    gpio_keys {
        compatible = "gpio-keys";
        label = "gpio-keys";
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&gpio_key_active>;
        pinctrl-1 = <&gpio_key_suspend>;

        vol_up {
            label = "volume_up";
            gpios = <&tlmm 85 GPIO_ACTIVE_LOW>;
            linux,input-type = <1>;
            linux,code = <115>;
            gpio-key,wakeup;
            debounce-interval = <15>;
            linux,can-disable;
            };
        };
};

b.dts
#include "a.dtsi"
&soc {
    /delete-node/ gpio_keys;
};

I want to remove gpio_keys node on b.dts. But it doesn't work.
Any fellows can explain the reason ?

sawdust
  • 16,103
  • 3
  • 40
  • 50
Andrew
  • 31
  • 1
  • 2
  • Did you get any error when compiling b.dts? Depending on how you have compiled, it may **not have recognized** '#include' c syntax. Can you try using /include/ "a.dtsi" instead of #include "a.dtsi" once? Refer: https://stackoverflow.com/questions/50658326/device-tree-compiler-not-recognizes-c-syntax-for-include-files – ymdatta Nov 07 '19 at 10:57

2 Answers2

2

I have just achieved it using the exact syntax you did, based on what is stated here: Device Tree Source Undocumented

So by simply adding my own dts (as below), I was able to swipe out the unwanted nodes, and achieve the configuration I wanted.

#include "am335x-nand-eeprom-rtc.dtsi"
#include "am335x-pcm-953.dtsi"

//Remove ecap node
/delete-node/ &ecap0_pins;
/delete-node/ &ecap0;

// Remove touchscreen related nodes
/delete-node/ &i2c_ts;
/delete-node/ &ts_irq_pin;
/delete-node/ &backlight;
/delete-node/ &lcd_pins;
/delete-node/ &lcdc;
/delete-node/ &lcd_3v3;
/delete-node/ &panel;

&sound {
    status = "disabled";
};
tronic
  • 220
  • 1
  • 10
1

according to the source below, it is not possible:

" The /delete-node/ and /delete-prop/ directives are only used by the dtc compiler within a single compilation.

There is nothing in the format of a devicetree blob to represent the notion of deleting a property or a node.

You can not delete a property or a node in an overlay dtb. "

https://lore.kernel.org/lkml/c342562e-f915-a853-c2a8-eecefd94b88d@gmail.com/T/

M. Israel
  • 11
  • 1