which should be easy, but apparently is not?
So I have a LED attached to PJ05. I configure the pin in my DTS like this:
gpio@2200000 {
nice-led-pj5 {
gpio-hog;
gpios = <TEGRA_MAIN_GPIO(J, 5) GPIO_ACTIVE_HIGH>;
output-high;
line-name = "nice-led-pj5";
};
};
When I boot, the LED turns on. Life is good. If I open /sys/kernel/debug/pinctrl/2430000.pinmux/pinconf-groups
I get what I think is the correct configuration:
34 (gpio_aud0_pj5):
pull=0
tristate=0
enable-input=0
open-drain=0
io-reset=0
rcv-sel=0
io-hv=0
schmitt=0
pull-down-strength=0
pull-up-strength=0
drive-type=0
lpdr=0
rfu-in=0
special-function=0
func=rsvd0
If I do gpioinfo gpiochip0
all is good
line 77: unnamed "nice-led-pj5" output active-high [used]
Then I do this:
gpioset gpiochip0 77=1
(note the 1, it should stay on) and the gpio turns off (suffice to sat 77=0 still keeps it off). And I cannot turn it on anymore. Moreover, it disappears from gpioinfo:
line 77: unnamed unused output active-high
Now this happens for all my gpios, I can’t turn on any of them from the system. But since I’m clever, I figured out I can use the old gpio interface, right? Wrong:
echo 77 > /sys/class/gpio/export
bash: echo: write error: Invalid argument
And the console says:
port_store: invalid GPIO 77
Note that the actual internal number for pj5 is 77, by a coincidence it is the same as the gpiod one.
sudo cat /sys/kernel/debug/pinctrl/2430000.pinmux/pinconf-pins | grep PJ5
pin 77 (GPIO_AUD0_PJ5):
As you may guess, this happens for all gpios, not only 77.
What is the obvious thing I’m missing?
[I’m running 32.3.1 and kernel 4.9]