A pin configuration at the device [..] is ignored, when the status
[..] is set to "disabled".
Correct, since status="disabled" means no device gets created for that
DT node, hence no pinmux ever gets requested for it.
0x40 (PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_a0.i2c4_scl */
0x44 (PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_a1.i2c4_sda */
Note btw that gpio is mode 14 on the am57xx, not mode 7.
The correct solution is to create a pinmux node for it (it's not
appropriate to mess with a random pinmux node you found) and find or
create some device to attach it to.
An obvious choice for gpios is to create a gpio-helper device, which
also lets you name and initialize your gpios (direction etc):
#include <dt-bindings/gpio/gpio.h>
/ {
gpio-demo {
compatible = "gpio-of-helper";
pinctrl-names = "default";
pinctrl-0 = <&gpio_demo_pins>;
P16.36 {
gpio = <&gpio7 3 GPIO_ACTIVE_HIGH>;
input;
dir-changeable;
};
P16.43 {
gpio = <&gpio7 4 GPIO_ACTIVE_HIGH>;
input;
dir-changeable;
};
};
};
&dra7_pmx_core {
gpio_demo_pins: gpio-demo {
pinctrl-single,pins = <
(4 * 16) (PIN_INPUT_PULLUP | MUX_MODE14) // P16.36 / gpio7.3
(4 * 17) (PIN_INPUT_PULLUP | MUX_MODE14) // P16.43 / gpio7.4
>;
};
};
You can give the nodes any name you want as long as they don't conflict
with a existing nodes. The gpio names show up in the 'label' attribute
in sysfs, hence you can use an udev rule to make nice symlinks:
SUBSYSTEM=="subsystem", KERNEL=="gpio", ACTION=="add", \
RUN+="/bin/mkdir -p /dev/gpio"
SUBSYSTEM=="gpio", ACTION=="add", TEST=="value", ATTR{label}!="sysfs", \
RUN+="/bin/chgrp -R gpio '/sys%p'", \
RUN+="/bin/chmod -R g=u '/sys%p'", \
RUN+="/bin/ln -sT '/sys/class/gpio/%k' /dev/gpio/%s{label}"
The combination of this dt snippet and this udev rule yields:
@bbx15:~$ ls -l /dev/gpio/*/value
-rw-rw-r-- 1 root gpio 4096 Oct 15 09:24 /dev/gpio/P16.36/value
-rw-rw-r-- 1 root gpio 4096 Oct 15 09:24 /dev/gpio/P16.43/value
Matthijs