Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1583

RG/G2L GPIO interrupt problems

$
0
0

Hello everyone,

unfortunately, we have a new problem with the RZ/G2L. This time it is with simple "gpio-key" and "rotary-encoder" devices. We are constantly getting the errors:

genirq: Setting trigger mode 3 for irq 191 failed (rzg2l_gpio_irq_set_type+0x0/0x37
rotary-encoder encoder: unable to request IRQ 191 (gpio#0)
rotary-encoder: probe of encoder failed with error -22

It is the same for the keys or the encoder. I have attached the userinput.dtsi file and the dmesg parts below.

From what I have seen online, also in here https://www.spinics.net/lists/kernel/msg4359392.html it should work.

Best regards
Christian

userinputs.dtsi

#include<dt-bindings/pinctrl/rzg2l-pinctrl.h>
#include<dt-bindings/gpio/gpio.h>
#include<dt-bindings/input/input.h>

/ {
    keyboard {
        compatible = "gpio-keys";
        status = "okay";

        key-1 {
                gpios = <&pinctrlRZG2L_GPIO(47, 3) GPIO_ACTIVE_HIGH>;
                linux,code = <KEY_1>;
                linux,input-type = <EV_KEY>;
                wakeup-source;
                label = "SW1";
        };

        key-2 {
                gpios = <&pinctrlRZG2L_GPIO(37, 2) GPIO_ACTIVE_HIGH>;
                linux,code = <KEY_2>;
                linux,input-type = <EV_KEY>;
                wakeup-source;
                label = "SW2";
        };

        key-3 {
                gpios = <&pinctrlRZG2L_GPIO(39, 0) GPIO_ACTIVE_HIGH>;
                linux,code = <KEY_3>;
                linux,input-type = <EV_KEY>;
                wakeup-source;
                label = "SW3";
        };
    };

    encoder {
        compatible = "rotary-encoder";
        status = "okay";

        #address-cells = <1>;
        #size-cells = <0>;

        gpios = <&pinctrlRZG2L_GPIO(40, 1) GPIO_ACTIVE_LOW>, <&pinctrlRZG2L_GPIO(41, 0) GPIO_ACTIVE_LOW>;
        linux,axis = <0>; /* REL_X */
        rotary-encoder,encoding = "gray";
        rotary-encoder,relative-axis;
        rotary-encoder,steps = <32>;
    };

    leds {
        compatible = "gpio-leds";
        status = "okay";

        module_led_1: module-led-1 {
            gpios = <&pinctrlRZG2L_GPIO(42, 2) GPIO_ACTIVE_HIGH>;
            label = "LED1";
            default-state = "off";
            linux,default-trigger = "heartbeat";
        };

        module_led_2: module-led-2 {
            gpios = <&pinctrlRZG2L_GPIO(42, 3) GPIO_ACTIVE_HIGH>;
            label = "LED2";
            default-state = "off";
            linux,default-trigger = "heartbeat";
        };

        module_led_3: module-led-3 {
            gpios = <&pinctrlRZG2L_GPIO(47, 2) GPIO_ACTIVE_HIGH>;
            label = "LED3";
            default-state = "off";
            linux,default-trigger = "heartbeat";
        };
    };
};



dmesg snippets
[    0.526067] rotary-encoder encoder: gray
[    0.526083] rotary-encoder encoder: GPIO lookup for consumer (null)
[    0.526088] rotary-encoder encoder: using device tree for GPIO lookup
[    0.526113] of_get_named_gpiod_flags: parsed 'gpios' property of node '/encoder[0]' - status (0)
[    0.526132] pinctrl-rzg2l 11030000.pin-controller: request pin 321 (P40_1) for 11030000.pin-controller:441
[    0.526149] rotary-encoder encoder: GPIO lookup for consumer (null)
[    0.526153] rotary-encoder encoder: using device tree for GPIO lookup
[    0.526170] of_get_named_gpiod_flags: parsed 'gpios' property of node '/encoder[1]' - status (0)
[    0.526179] pinctrl-rzg2l 11030000.pin-controller: request pin 328 (P41_0) for 11030000.pin-controller:448
[    0.526659] genirq: Setting trigger mode 3 for irq 191 failed (rzg2l_gpio_irq_set_type+0x0/0x37c)
[    0.535575] rotary-encoder encoder: unable to request IRQ 191 (gpio#0)
[    0.542133] rotary-encoder: probe of encoder failed with error -22

[    0.745674] of_get_named_gpiod_flags: parsed 'gpios' property of node '/keyboard/key-1[0]' - status (0)
[    0.745698] pinctrl-rzg2l 11030000.pin-controller: request pin 379 (P47_3) for 11030000.pin-controller:499
[    0.745837] genirq: Setting trigger mode 3 for irq 194 failed (rzg2l_gpio_irq_set_type+0x0/0x37c)
[    0.754880] gpio-keys keyboard: Unable to claim irq 194; error -22
[    0.761229] gpio-keys: probe of keyboard failed with error -22


Viewing all articles
Browse latest Browse all 1583