The changes I make to the pinmux in the Device Tree Overlay are not reflected when I read the files in /sys/class/gpio or probe the physical pin itself. However, the change IS reflected when I read /sys/kernel/debug/pinctrl/44e10800.pinmux/pins. The OS is the Rev C Debian build.
Setting the Pin to an input w/ a pulldown:
-In my Device Tree Overlay file, I set GPIO pin P9_15(referred to as 48 by the kernel and having offset address 0x040) to be an input pin with a pulldown resistor(register value 0x27).
-I echo the appropriate overlay to ‘/sys/devices/bone_capemgr.9/slots’
-When when I do a 'cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pins | grep ‘840’ ’ , I get ‘pin 16 (44e10840) 00000027 pinctrl-single’. This indicates that the pin is correctly set as an input and with a pulldown resistor.
-When I do ‘cat value’ in the gpio48 directory, I get 1. I should get a 0 since the pulldown is enabled.
Setting the pin to an output:
-In my Device Tree Overlay file, I set GPIO pin P9_15(referred to as 48 by the kernel and having offset address 0x040) to be an output pin (register value 0x07).
-I echo the appropriate overlay to ‘/sys/devices/bone_capemgr.9/slots’
-When when I do a 'cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pins | grep ‘840’ ’ , I get ‘pin 16 (44e10840) 00000007 pinctrl-single’. This indicates that the pin is correctly set as an output.
-When I do ‘cat direction’ in the gpio48 directory, I get ‘in’. I should get ‘out’ since the pin is set as an output.
If I manually set the direction,value, etc… by echoing to the file interfaces, then everything works perfectly.
Should modifications in the DTO reflect in the file interfaces and on the physical pin itself, or is my understanding incorrect? Derek Molloy encounters this same issue in his GPIO video (https://www.youtube.com/watch?v=wui_wU1AeQc @31:00).
Thanks!
Michael
FYI, here is one of the DTOs:
/*
- Copyright © 2012 Texas Instruments Incorporated - http://www.ti.com/