OpenWrt Forum Archive

Topic: Problem with GPIO on HLK-RM04

The content of this topic has been archived on 28 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,
Me and a friend have been working quite a lot lately to get my newly purchased HLK-RM04 chips to work as was intended when I got it. However, now when most is finally done, we cannot seem to use the GPIO ports at all.
The RM04 have quite few IO pins to actually play around with, and regardless of what we do, export just gives us Invalid Argument. We have tried getting gpio-1 (I2S D), gpio-2 (I2S C), gpio-7 (RTS) and gpio-9 (CTS) to work with no luck.
After checking the output of dmesg, we see it failed with status -22 (all of the tried ones).
(Full dmesg: http://pastebin.com/M2a6G6ZT )
Someone suggested enabling them as gpio-mux by changing the dts  file   (original: http://pastebin.com/rqcepPNy , include rt5350: http://pastebin.com/rqcepPNy ) by changing line 62 to

ralink,group = "jtag","i2c","spi","uart","uartlite","uartf";

But with equal absence of success.
Do anyone have any suggestions on how to get the previously stated gpio to work?

//Regards, me

How do we set the pinmux to GPIO instead of to the fixed function units?

root@OpenWrt:/sys/kernel/debug/pinctrl/pinctrl.1# cat pinmux-functions
function: gpio, groups = [ i2c spi uartf uartlite jtag led spi_cs1 ]
function: i2c, groups = [ i2c ]
function: spi, groups = [ spi ]
function: uartf, groups = [ uartf ]
function: pcm uartf, groups = [ uartf ]
function: pcm i2s, groups = [ uartf ]
function: i2s uartf, groups = [ uartf ]
function: pcm gpio, groups = [ uartf ]
function: gpio uartf, groups = [ uartf ]
function: gpio i2s, groups = [ uartf ]
function: uartlite, groups = [ uartlite ]
function: jtag, groups = [ jtag ]
function: led, groups = [ led ]
function: spi_cs1, groups = [ spi_cs1 ]
function: wdg_cs1, groups = [ spi_cs1 ]

The discussion might have continued from here.