gpio-keys works on 3.8.13-bone79 but not jessie 4.1.16-ti-rt-r44

I’ve got a custom cape for BeagleBone Black which has several peripherals including a 5-switch joystick. I have device tree nodes for each peripheral which I add to a copy of am335x-boneblack.dts and use as a fixed device tree (no overlays) loaded by u-boot. The joystick pins are bound to gpio-keys using the gpios property, but I don’t specify the interrupts property.

All peripherals work fine on 3.8.13-bone79, including the joystick (using evtest).

On 4.1.16-ti-rt-r44 the joystick does not work. The input device is created, and evtest displays the keys it supports, but does not generate events when the joystick is manipulated.

I’ve reassigned the pins to gpio-of-helper and written an application using sysfs to detect edge transitions. This works fine on 3.8.13-bone79 and on 4.1.16-ti-rt-r44, so there’s nothing wrong with the hardware or the ability of these lines to get interrupts.

The only significant change I’ve found in updating to jessie is that under 3.8.13-bone79 the pins using gpio-of-helper were automatically exported to sysfs, while this is not done in 4.1.16-ti-rt-r44. From what I can tell this is intentional, but also not clearly related to the problem of gpio-keys not generating events.

The only candidate I have now is that I don’t specify interrupts in the gpio-keys binding, but that wasn’t necessary in 3.8.13-bone79 and I don’t see it generally done in any other example.

Can anybody suggest what might be going wrong?

Thanks.

Peter

The gpio#'s changed after 3.8, in your gpio-key property, for "gpio3
use &gpio3" not "$gpio4" like was used on 3.8.x

also make sure you are using the correct dtc compiler:

https://github.com/beagleboard/bb.org-overlays

Regards,

I knew that &uart2 from 3.8 needed to be &uart1 as of 3.12, and had fixed that. I hadn’t realized the same issue affected the &gpioX aliases, because the applications using gpio-of-helper + sysfs “just worked”.

Shifting all the &gpioX aliases down one level fixes the problem.

Many thanks for the solution, and all your work on BeagleBone.

Peter

The gpio#'s changed after 3.8, in your gpio-key property, for "gpio3
use &gpio3" not “$gpio4” like was used on 3.8.x

So this means that the gpio banks are now zero based( starting from 0 ) ? Anything else ?