The /sys/class/gpio_sw is still empty.

Started by Deulis, August 24, 2014, 10:52:14 PM

Previous topic - Next topic

Deulis

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???

MBR

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.

Deulis

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.

JohnS

Try google with things like:
linux export gpio

John