zephyr: Getting GPIOs from DTS file without aliases


Hiremath, Vijay P <vijay.p.hiremath@...>
 

Hi All,

 

I have a dts file for GPIO configs. I would like to know if it is possible to get the GPIOs without aliases

 

DTS file:

        pow_seq_gpio_keys {

                compatible = "gpio-keys";

            

EC_VR_EN_PP3300_A: GPIOA3 {

                        label = "EN_PP3300_A";

                        gpios = <&gpioa 3 GPIO_ACTIVE_HIGH>;

                };

        };

 

        aliases {

                pp3300aout = &EC_VR_EN_PP3300_A;

        };

 

C file:

Compiles:

        const struct device *pin_pp3300_en = device_get_binding(DT_GPIO_LABEL(DT_ALIAS(pp3300aout), gpios));

 

fails to compile:

        const struct device *pin_pp3300_en = device_get_binding(DT_GPIO_LABEL(EC_VR_EN_PP3300_A, gpios));

 

Regards

Vijay

Join devel@lists.zephyrproject.org to automatically receive all group messages.