Hi,
I use an i.mx6 board and am configuring a device tree.
I changed a dts file and put the dtb file in a boot partition.
I set GPIO4_IO19 in dts file as follows.
&iomuxc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_hog_1>;
imx6ul-evk {
pinctrl_hog_1: hoggrp-1 {
fsl,pins = <
...
MX6UL_PAD_CSI_VSYNC__GPIO4_IO19 0x0000B0B0
...
>;
};...
At first MX6UL_PAD_CSI_VSYNC__GPIO4_IO19 was defined in other group (usdhcgrp) but I commented out them.
After booting, I checked if gpio is successfully determined as I set.
The result is
echo 115 > /sys/class/gpio/export
-sh: echo: write error: Device or resource busy
So I checked this.
cat /sys/kernel/debug/gpio
GPIOs 0-31, platform/209c000.gpio, 209c000.gpio:
gpio-10 (phy-reset ) out loGPIOs 32-63, platform/20a0000.gpio, 20a0000.gpio:
GPIOs 64-95, platform/20a4000.gpio, 20a4000.gpio:
gpio-68 (ft5x06_irq_gpio ) in hiGPIOs 96-127, platform/20a8000.gpio, 20a8000.gpio:
gpio-109 (? ) out lo
gpio-115 (cd ) in lo
gpio-116 (? ) out lo
gpio-117 (? ) out lo
gpio-118 (sysfs ) in hiGPIOs 128-159, platform/20ac000.gpio, 20ac000.gpio:
gpio-128 (phy-reset ) out lo
gpio-115 is used by cd. What is cd ?
I want to use it as sysfs to read the state. Any other way to read it ?
Furthermore, gpio-10, 68, 109, 116, 117 is used by other device.
How can I use them by sysfs?
Thank you for your cooperation.
Hi Hirotoshi
please look at
How do can I find out which Linux driver is hogging my GPIO? - Stack Overflow
Best regards
igor
Hi igor,
Thank you for your answer.
I am afraid that I have read the link and it would not help me.
(This time the using device is ?, so I cannot find.)
I think dts file is related to this issue 'cause I think only dts file includes pin control, but I couldn't find out.
Would you give me any other adivice?
Best regards,
Hiro
i.MX Development Miscellanea(i.MX 开发杂记)
https://community.nxp.com/docs/DOC-335198
Accessing GPIO From UserSpace
Hi Hiro
as these are general linux questions, it may be posted
on kernel mail lists.
Majordomo Lists at VGER.KERNEL.ORG
Best regards
igor
Hi igor,
Thank you for your replying.
I found my dts file has woding about the gpio.
At first I think gpio is only defined in &iomuxc {...} in dts, but there are other definition in the dts file.
Best regards