Hello,
we would like to use gpios 9 14 15 36 40 41 42 43 52 53 82 90 91 113 117 118 121 122 127 165 175 on Colibri imx6 for input/output, but none of these work for output when tested.
# cd /sys/class/gpio
# echo 9 >export
# echo out >gpio9/direction
# echo 1 >gpio9/value
# cat gpio9/value
0
#
We are using the default kernel Linux colibri-imx6 3.10.17. We have also tried to remove PWM support from the kernel, but the result is the same - when trying to set gpio value to 1, none of these gpio ports change the actual value.
You need to disable any interfaces currently using these pins in the device tree. Since the bootloader may have initialized some pins as something besides GPIO, you’ll want to ensure that the pins are reconfigured for GPIO in the kernel by defining them as such in the device tree.
The values are grepped from imx6dl-pinfunc.h for the gpios we want - the first line is from macro MX6QDL_PAD_GPIO_9__GPIO1_IO09, which expands to 0x240 0x610 0x000 0x5 0x0. I have changed the 4th value to 0x15 to enable the SION bit, as is in [PATCH] ARM: dts: imx6: set SION bit for GPIO pinmux mode
but it doesn’t work. Any ideas someone?
Does the control of the output actually work? e.g. when you toggle the output with echo 1 >gpio9/value echo 0 >gpio9/value
do you see the change on the actual pin?
Note that the pinmux driver evaluates bit 30 of the CONFIG byte to set the SION bit.
So in the device tree you could write the above also like this: