Hi everyone,
I'm currently working with the i.MX8MP platform and encountered an issue while configuring a GPIO pin in input/pull-up mode. Here's the scenario:
In one of my drivers, the pin is used in output mode during the probe phase and then switched back to input mode. However, after this process, I found that the pin loses its configuration and is no longer in pull-up mode.
here is the dtb:
gt928@5d {
[...]
pincrtl-0 = <&pinctrl_ts>;
gt928,irq-gpios = <&gpio1 6 GPIO_PULL_UP>;
};
pinctrl_ts: tsgrp {
fsl,pins = <
MX8MP_IOMUXC_GPIO1_IO06__GPIO1_IO06 0x146 /* 0x146 == pull up, drive strength = 6 */
MX8MP_IOMUXC_SD1_DATA4__GPIO2_IO06 0xd6
>;
};Here's the call stack for reference:
[ 14.630895] gpio_do_set_config+0x24/0x74
[ 14.630905] gpio_set_config_with_argument+0x38/0x44
[ 14.630911] gpio_set_bias+0x84/0xa4
[ 14.643448] gpiod_direction_input+0x198/0x1ac
[ 14.647892] goodix_irq_direction_input+0x40/0xa4 [goodix]
[ 14.653388] goodix_ts_probe+0x3fc/0x5c8 [goodix]
Upon further investigation, I noticed that the set_config function is not implemented (gpiolib.c do the following check):
gpio_do_set_config(struct gpio_chip *gc, unsigned int offset, unsigned long config) {
{
if (!gc->set_config)
return -ENOTSUPP;
[...]
}I'm curious as to why set_config hasn't been implemented.
I've seen that other have done it :
gc->set_config = pca953x_gpio_set_config;
or
gc->set_config = ep93xx_gpio_set_config;
Any insights or suggestions on how to address this issue would be greatly appreciated.
Thank you in advance for your help!
Best regards,
Alexandre