Gpio_apalis_tk1_k20 GPIOs always high

Hi there,

I can load the driver for the K20 GPIO expansion:

modprobe gpio-apalis-tk1-k20

And dmesg confirms:

Firmware version 0.9.
gpiochip_add: registered GPIOs 856 to 1015 on device: generic

So let’s go on:

echo 952 > /sys/class/gpio/export
cat /sys/kernel/debug/gpio
[...]
GPIOs 856-1015, platform/apalis-tk1-k20-gpio, can sleep:
 gpio-952 (sysfs               ) in  hi
GPIOs 1016-1023, platform/as3722-pinctrl, as3722-gpio, can sleep:
 gpio-1018 (+V3.3               ) out hi

Looks good in principle, but it says “hi”, even if the Pin is indeed pulled low (yes, confirmed twice it’s that very pin, also tried with others). I can even do

echo low > /sys/class/gpio/gpio952/direction
cat /sys/kernel/debug/gpio
[...]
GPIOs 856-1015, platform/apalis-tk1-k20-gpio, can sleep:
 gpio-952 (sysfs               ) out hi

This is true for several GPIO ports I checked.
How to debug what’s going wrong here?

(I’m using a 3.10.40 kernel with some custom modifications. Devicetree untouched for spidev1.)
Only odd observation: When erasing K20 firmware and flashing it new, I get

apalis-tk1-k20 spi1.1: K20 FIFO Bug!
gpio wake34 for gpio=82
apalis-tk1-k20 spi1.1: Apalis TK1 K20 MFD driver.

But as I’m able to load the gpio driver afterwards, I suppose this FIFO bug is not critical.

Can you update BSP to version 2.7 and try again? You can disregard the “K20 FIFO Bug!”.

THank you for your answer. Yes, indeed it works with apalis-tk1 3.10.40-2.7.2. Strange, because out BSP is based on that, I think. How do I find out what’s wrong with our BSP? The gpio-apalis-tk1-k20 driver?

Good, that it is working. Can you check for the differences in the gpio-apalis-tk1-k20 between your bsp and the bsp 2.7.2?