[opensuse-arm] How to use gpio pins via sysfs
I try to control a few gpio pins via bash script. Board and OS version is: cat /proc/device-tree/compatible olimex,a13-olinuxinoallwinner,sun5i-a13 cat /etc/os-release NAME="openSUSE Leap" VERSION="42.3" ID=opensuse ID_LIKE="suse" VERSION_ID="42.3" PRETTY_NAME="openSUSE Leap 42.3" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:leap:42.3" BUG_REPORT_URL="https://bugs.opensuse.org" HOME_URL="https://www.opensuse.org/" In /sys/class/gpio I do: echo 3 > export ls export gpio3 gpiochip0 unexport ls gpio3/ active_low device/ direction power/ subsystem/ uevent value cat gpio3/direction in So when I want to change the pin direction: echo out > gpio3/direction bash: echo: write error: Unknown error 517 That is EPROBE_DEFER. The kernel signals that the requested device might be probed later, ...or never. I guess that there might be some device tree item missing, but from the kernel documentation I haven't found a solution for that. Does anybody have an idea how to get that working? Br, Frank -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Am 30.12.2017 um 23:26 schrieb Frank Kunz <mailinglists@kunz-im-inter.net>:
I try to control a few gpio pins via bash script. Board and OS version is:
cat /proc/device-tree/compatible olimex,a13-olinuxinoallwinner,sun5i-a13
cat /etc/os-release NAME="openSUSE Leap" VERSION="42.3" ID=opensuse ID_LIKE="suse" VERSION_ID="42.3" PRETTY_NAME="openSUSE Leap 42.3" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:leap:42.3" BUG_REPORT_URL="https://bugs.opensuse.org" HOME_URL="https://www.opensuse.org/"
In /sys/class/gpio I do: echo 3 > export ls export gpio3 gpiochip0 unexport ls gpio3/ active_low device/ direction power/ subsystem/ uevent value cat gpio3/direction in
So when I want to change the pin direction: echo out > gpio3/direction bash: echo: write error: Unknown error 517
That is EPROBE_DEFER. The kernel signals that the requested device might be probed later, ...or never. I guess that there might be some device tree item missing, but from the kernel documentation I haven't found a solution for that. Does anybody have an idea how to get that working?
Usually changing gpio direction is the responsibility of the pinmux driver. Can you check if you have one loaded? Alex -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Am 31.12.2017 um 12:17 schrieb Alexander Graf:
Am 30.12.2017 um 23:26 schrieb Frank Kunz <mailinglists@kunz-im-inter.net>:
I try to control a few gpio pins via bash script. Board and OS version is:
cat /proc/device-tree/compatible olimex,a13-olinuxinoallwinner,sun5i-a13
cat /etc/os-release NAME="openSUSE Leap" VERSION="42.3" ID=opensuse ID_LIKE="suse" VERSION_ID="42.3" PRETTY_NAME="openSUSE Leap 42.3" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:leap:42.3" BUG_REPORT_URL="https://bugs.opensuse.org" HOME_URL="https://www.opensuse.org/"
In /sys/class/gpio I do: echo 3 > export ls export gpio3 gpiochip0 unexport ls gpio3/ active_low device/ direction power/ subsystem/ uevent value cat gpio3/direction in
So when I want to change the pin direction: echo out > gpio3/direction bash: echo: write error: Unknown error 517
That is EPROBE_DEFER. The kernel signals that the requested device might be probed later, ...or never. I guess that there might be some device tree item missing, but from the kernel documentation I haven't found a solution for that. Does anybody have an idea how to get that working?
Usually changing gpio direction is the responsibility of the pinmux driver. Can you check if you have one loaded?
Thanks, that was the right hint. I analyzed it deeper and by using the correct pin (35 instead of 3) it works. This sysfs entry has the pin mapping: /sys/kernel/debug/pinctrl/1c20800.pinctrl/pinmux-pins Pinmux settings per pin Format: pin (name): mux_owner gpio_owner hog? pin 35 (PB3): (MUX UNCLAIMED) 1c20800.pinctrl:35 Br, Frank -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
participants (2)
-
Alexander Graf
-
Frank Kunz