Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

gpio_keys: failed to get gpio: -22

Featured Replies

Hi everyone,

 

I'm struggling to get gpio_keys working.

 

I'm trying to use the overlay, which I have attached below, but after reboot there is no event node listed in "/dev/input/". (There is only one node named mice.)

 

Inspecting dmesg, I found the following error messages:

[    1.529891] sun50i-h616-pinctrl 300b000.pinctrl: pin PC8 already requested by gpio-keys-user; cannot claim for 300b000.pinctrl:72
[    1.529917] gpio-keys gpio-keys-user: failed to get gpio: -22
[    1.529926] gpio-keys: probe of gpio-keys-user failed with error -22

 

Inspecting the dts file of my board (orange pi zero 2), I found that PC5,PC6 and PC8 are already listed as mmc2-pins, but mmc2 is disabled, so I don't think that this is the issue. However, I have no idea what else might be wrong.

 

Any help?

 

Attachements:

 

custom-keys.dts Overlay:

/dts-v1/;                                                                                                                                                                                                          
/plugin/;                                                                                                                                                                                                          
                                                                                                                                                                                                                   
/ {                                                                                                                                                                                                                
  compatible = "allwinner,sun50i-h616";                                                                                                                                                                            
                                                                                                                                                                                                                   
  fragment@0 {                                                                                                                                                                                                     
    target = <&pio>;                                                                                                                                                                                               
    __overlay__ {                                                                                                                                                                                                  
      custom-buttons: custom-buttons {                                                                                                                                                                           
        pins = "PC5","PC6","PC8";                                                                                                                                                                                  
        function = "gpio_in";                                                                                                                                                                                      
        bias-pull-up;                                                                                                                                                                                              
      };                                                                                                                                                                                                           
    };                                                                                                                                                                                                             
  };                                                                                                                                                                                                               
                                                                                                                                                                                                                   
  fragment@1 {                                                                                                                                                                                                     
    target-path = "/";                                                                                                                                                                                             
    __overlay__ {                                                                                                                                                                                                  
      gpio-keys-user {                                                                                                                                                                                             
        compatible = "gpio-keys";                                                                                                                                                                                  
        pinctrl-names = "default";                                                                                                                                                                                 
        pinctrl-0 = <&custom-buttons>;                                                                                                                                                                            
                                                                                                                                                                                                                   
        play_button {                                                                                                                                                                                              
          label = "GPIO Key 1";                                                                                                                                                                                 
          linux,code = <25>;                                                                                                                                                                                       
          gpios = <&pio 0 69 1>;                                                                                                                                                                                   
        };                                                                                                                                                                                                         
        vol_up_button {                                                                                                                                                                                            
          label = "GPIO Key 2";                                                                                                                                                                               
          linux,code = <22>;                                                                                                                                                                                       
          gpios = <&pio 0 70 1>;                                                                                                                                                                                   
        };                                                                                                                                                                                                         
        vol_down_button {                                                                                                                                                                                          
          label = "GPIO Key 3";                                                                                                                                                                             
          linux,code = <32>;                                                                                                                                                                                       
          gpios = <&pio 0 72 1>;                                                                                                                                                                                   
        };                                                                                                                                                                                                         
      };                                                                                                                                                                                                           
    };                                                                                                                                                                                                             
  };                                                                                                                                                                                                               
};                                                                                                                                                                                                                 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.