Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A13 => Topic started by: Deulis on August 24, 2014, 10:52:14 PM

Title: The /sys/class/gpio_sw is still empty.
Post by: Deulis on August 24, 2014, 10:52:14 PM
My second post here.

Board: A13-SOM with WIFI/Flash module
Image: A13_SOM_android_4.22_NAND_release_1.img

I'm trying to use some gpio, in the script.bin I added theses lines:

[gpio_para]
gpio_used = 1
gpio_num = 4
gpio_pin_1 = port:PE4<1><default><default><0>
gpio_pin_2 = port:PE5<0><default><default><default>
gpio_pin_3 = port:PE6<0><default><default><default>
gpio_pin_4 = port:PE7<0><default><default><default>

[gpio_init]
pin_1 = port:PE4<1><default><default><0>
pin_2 = port:PE5<0><default><default><default>
pin_3 = port:PE6<0><default><default><default>
pin_4 = port:PE7<0><default><default><default>

The init.sun5i.rc already has:
#gpio
insmod /system/vendor/modules/gpio_sw.ko


In any way the "/sys/class/gpio_sw" folder remains empty.  The only rare thing I have is in the dmesg log that has theses entries:
<6>[    3.152247] gpio_sw_init.
<3>[    3.152291] Error: Driver 'gpio_sw' is already registered, aborting...


I'm newbie  in Linux stuffs and for a long time I'm looking for a solution in this forum and others sites but without any success, that's why I'm posting this problem here.
What can I do to use gpio???
Title: Re: The /sys/class/gpio_sw is still empty.
Post by: MBR on August 25, 2014, 07:26:09 PM
The error message says that there is already another running GPIO driver. Are there entries in /sys/class/ containing gpio? BTW, on a normal (non-Android) Linux kernel, the directory is just /sys/class/gpio/ (without sw) and you must write to the export file to populate it.
Title: Re: The /sys/class/gpio_sw is still empty.
Post by: Deulis on August 26, 2014, 10:55:11 PM
In the "/sys/class/" there is no any other folder named just "gpio".
When you said: "...and you must write to the export file to populate it" what exactly do I need to do?
I'm sorry if I made an stupid question, these are my first steps in Linux.
Title: Re: The /sys/class/gpio_sw is still empty.
Post by: JohnS on August 26, 2014, 11:13:15 PM
Try google with things like:
linux export gpio

John