Hi all. I am developing a control system which uses GPIO to perform IO operations and control peripherals.
So, right now, I have a DTS file which initializes all GPIOs that I am going to use, mostly outputs. It compiles and loads normally. Here it is: http://pastebin.com/HTB0v8dH
I previously thought that it would initialize the GPIO_OE registers, since it is being configured as output, but apparently it does not.
So, I was wondering how could I create a DTS file that would initialize both GPIO_OE register and set the initial value for it.
Any thoughts on that?
Thanks in advance!
Paulo Sherring.
Think of DTS as a simple database which does nothing unless you specify a driver that then uses the definitions in the dtbo to configure the I/O.
Regards,
John
Thanks, John! Would mind elucidate a little more, with a sample DTS of how do I achieve this? Or a link to somewhere that shows how to do it?
If you don’t have your own driver, then you should use gpio-of-helper driver which I believe should do what you want. I haven’t used it, but I believe that is the general idea. I always use my own driver.
&am33xx_pinmux {
gpio_pins: gpio_pins { // The GPIO pins
pinctrl-single,pins = <
0x070 0x07 // P9_11 MODE7 GPIO output pull‐down
0x074 0x27 // P9_13 MODE7 GPIO input pull‐down
;
};
&ocp {
helper {
compatible = “gpio-of-helper”;
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&gpio_pins>;
};
Regards,
John