I want to experiment with accessing Apalis GPIO pins from a kernel driver. To that end, I’m trying to use gpio_request_array() to request the gpio pins when I load the module. The call fails. The pins I want to access come pre-exported and I can’t seem to unexport any of them:
root@apalis-t30:~# cd /sys/class/gpio/
root@apalis-t30:/sys/class/gpio# ls
export gpio147 gpio150 gpio220 gpio223 gpiochip0
gpio129 gpio148 gpio216 gpio221 gpio225 gpiochip256
gpio146 gpio149 gpio219 gpio222 gpio226 unexport
root@apalis-t30:/sys/class/gpio# echo 146 > unexport
-sh: echo: write error: Invalid argument
So how do I get access to the pins in a kernel mode driver?