cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
964 Views
Registered: ‎05-22-2017

gpio-key driver fails when AXI GPIO active-low

Hi everyone,

 

I'm not able to load driver gpio-key in my platform ( v2017.1) when the GPIO is active low.

 

My Dts is:

 

 

 

axi_gpio_PUSH_BUTTON: gpio@81240000 {
		#gpio-cells = <2>;
		#interrupt-cells = <2>;
		compatible = "xlnx,xps-gpio-1.00.a";
		gpio-controller ;
		interrupt-controller ;
		interrupt-parent = <&intc>;
		interrupts = <0 30 4>;
		reg = <0x81240000 0x10000>;
		xlnx,all-inputs = <0x1>;
		xlnx,all-inputs-2 = <0x0>;
		xlnx,all-outputs = <0x0>;
		xlnx,all-outputs-2 = <0x0>;
		xlnx,dout-default = <0x00000000>;
		xlnx,dout-default-2 = <0x00000000>;
		xlnx,gpio-width = <0x4>;
		xlnx,gpio2-width = <0x20>;
		xlnx,interrupt-present = <0x1>;
		xlnx,is-dual = <0x0>;
		xlnx,tri-default = <0xFFFFFFFF>;
		xlnx,tri-default-2 = <0xFFFFFFFF>;
};

gpio-keys {
	compatible = "gpio-keys";
	autorepeat;

	btn1 {
	        label = "sw16";
	        gpios = <&axi_gpio_PUSH_BUTTON 0 1>;
	        linux,code = <103>;  
	        interrupts = <0 30 4>;
	    };
	    
	    btn2 {
	        label = "sw15";
	        gpios = <&axi_gpio_PUSH_BUTTON 1 1>;
	        linux,code = <108>; 
	        interrupts = <0 30 4>;
	    };
	};

 

 

During the driver probe I get the error : EPROBE_DEFER (-517)

I get the same error if I use: gpio-keys-polled

 

  1. Does the Axi GPIO (http://www.wiki.xilinx.com/AXI+GPIO) support active low setting ?
  2. Do you have any advice ?

 

Thanks and regards 

Giulio

 

0 Kudos
3 Replies
Highlighted
951 Views
Registered: ‎04-20-2017

Could not get the driver working either... Following

In the end we circumvented the obstacle by using axi gpio, binding it it to uio driver and using interrupts that way. Might help you to if the gpio keys gives you grey hair
0 Kudos
Highlighted
935 Views
Registered: ‎05-22-2017

Hi juergen.kratochwill@grapho-metronic.com,

 

I don't understand how do you overcome the problem.

What do you mean with "binding it it to uio driver and using interrupts that way" ?

 

Do you think is it a driver issue ? 

 

Thanks,

Giulio

0 Kudos
Highlighted
915 Views
Registered: ‎04-20-2017

I assumed that you want to use the gpio-keys driver in order to use interrupts coming from the gpio? If it's a different reason why you want to use the gpio keys driver, then it might not work for you.

The same result (using interrupts from gpio in user's pace) you can get with the user space IO framework (uio driver). You find many examples if you google for that. For that you need to enable the driver in petalinux configuration and fiddle with the dtc

0 Kudos