I’m having trouble with repurposing GPIO Pins (to Output Pins), which are mapped/used by the Colibri IMX8X to/for the LCD display. I’m working with Bitbake and therefore I built my own device tree extension.
It seems like that it is a common problem, but I’m not getting it to work.
To disable the LCD, I deactivated the device driver in ther kernel config (menuconfig). I also disabled all nodes, which are related to the LCD. Next, I created a new iomux-config (see similar topic ).
You can see the the code below:
But after booting the board with compiled DT and using for example gpioset gpiochip0 12=0 (libgpiod), I can see no change in the pin-status. Is there anything more to look at?
Could you provide the version of the Hardware (including Carrier Board) and Software of the module?
Regarding your issue, please share the dmesg log and the output of ‘cat /sys/kernel/debug/gpio’?
I’m using a custom board with the Colibri IMX8XQP 2GB WB IT SOM.
BSP: Torizon (Yocto), Bitbake Image: torizon-core-docker, Machine: colibri-imx8x, Kernel: 5.3.0
Since you are using TorizonCore on your module, to manipulate the device tree, you don’t need to compile all the operating system using Yocto. TorizonCore was developed to make development easier. To accomplish this, you could use the TorizonCore Builder tool and apply a Device Tree Overlay that you can create.
If you really need to customize TorizonCore at a level that TorizonCore Builder can’t help you, then you’ll really need to use Yocto. In this case, let’s go to your Device Tree changes.
a. There is no need to modify the lsio_gpio0 node.
b. vf610-colibri node shouldn’t be used since you are not using a Colibri VF61 module. This node should be colibri-imx8qxp. But, to be honest, this node is not needed, as you’ll see.
So, to specifically set the pin you want (IMX8QXP_SPDIF0_EXT_CLK) to GPIO function (IMX8QXP_SPDIF0_EXT_CLK_LSIO_GPIO0_IO12), you can apply the following patch.
I got it working with pinctrl_hog1 earlier this week, even though I’m not sure why I have to use this pinctrl-group.
Since I had to deactive other devices as well (device drivers in the kernel) and to build additional software packages, I used Bitbake.
I was working with your wiki to customize the device tree. Regarding pin multiplexing and repurposing the GPIOs it may could be a little bit more clear on how to get it working step by step, using the right pinctrl-groups.
About the groups: actually, you can use any pinctrl group you want. Indeed, you could also create your own pinctrl group with a name that makes sense to, so you can organize better your project.
Using the groups that already exist and are used under the pinctrl-0 that is useful for you is just a quick way to test and validate.