Devicetree overlay for simple GPIO

It seems like there are lots of questions regarding simple GPIOs and devicetree, but I can't quite find something that describes my problem:

I am using the nrf52840dk, and I successfully created an overlay file to read/write to an I2C device, but I am having trouble adding a simple GPIO pin to my overlay file.

First, I tried adding the following to my overlay file:

columnswitchint: column_switch_input
    {
             compatible = "gpio-keys";
            gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
            label = "Column Switch Input Signal";
    };

When I try to build, I get the error "Property not mentioned in "/" ".  

Next, I tried declaring the pin like the 'buttons' definition in the .dts file for the blinky example:

sample_gpio_signals
{

    compatible = "gpio-keys";
    columnswitchint: column_switch_input
    {
           
            gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
            label = "Column Switch Interrupt Signal";
    };
};

This results in the error "Node column_switch_input should have "compatible" property".

Finally, I tried moving the compatible property down into the node:

sample_gpio_signals
{

    columnswitchint: column_switch_input
    {
   
            compatible = "gpio-keys";
            gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
            label = "Column Switch Interrupt Signal";
    };
};

And this results in the error "Property not mentioned in "gpio-keys".  Obviously 'gpios' is one of the only two properties declared in gpio-keys, so I'm stuck.

What am I missing here?  

Parents Reply Children
No Data
Related