1
votes

I am trying to access intel (cavecreek) gpio controller from user space. But I am getting: "NO such device " error when trying to echo to /sys/class/gpio/export :

echo 32 > /sys/class/gpio/export
bash: echo: write error: No such device

The error message seems to suggest that i need to have a device connected to the gpio. But documentation doesn't seem to mention that.

Nothing is being reserved as far as I can tell from dumping out /sys/kernel/debug/gpio. I have a i2c mux connected to the gpio pins.

Below is more info on my kernel and configuration

the kernel is is 3.14

here's the relevant config setting: CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y

CONFIG_GPIOLIB=y

CONFIG_GPIO_DEVRES=y

CONFIG_GPIO_ACPI=y

CONFIG_DEBUG_GPIO=y

CONFIG_GPIO_SYSFS=y

1

1 Answers

1
votes

in my case, the problem was with the kernel source 3.14. my system uses intel rangely. in the source lpc_ich.c, .gpio_version field is missing for LPC_DH89XXCC. i added that field, recompiled and kernel was able to enumerate gpiopin, although the display for the default gpio direction is not correct. direction always shows 'in' for all pins initially, but after using echo command to change the pin direction, the display will show up correctly.