2019-08-21 05:09 AM
Hi I use GT9147 touch IC on my stm32mp157 board. I found the stm32mp157c-ev1.dts use same chip. But the ev1 use GPIO14 of stmfx GPIO expander chip as TP_INT signal. The GPIO14 of stmfx configure as below code.
486 hog_pins: hog {
487 pins = "gpio14";
488 drive-push-pull;
489 bias-pull-down;
490 };
Now, my board use PG7 as TP_INT signal. I also want to configure the pull-down property to PG7.Below is my touch panel code.
gt9147@5d {
compatible = "goodix,gt9147";
reg = <0x5d>;
irq-gpios = <&gpiog 7 GPIO_ACTIVE_HIGH>;
irq-flags = <IRQ_TYPE_EDGE_RISING>;
reset-gpios = <&gpiog 8 GPIO_ACTIVE_HIGH>;
status = "okay";
};
So, my question is how to configure pull-down property of irq-gpio. I try to add "pinctrl-names" and "pinctrl-0" property to gt9147 section, but kernel shows pinctrl errors. In my opinion, other SoC platform support "hog" to config each gpio pins. Does the gpiog or pinctrl suppor this function in stm32mp1 platform?
Solved! Go to Solution.
2019-08-22 07:42 AM
Sorry but I don't see for your use case other means. gt9147 node is expecting a gpio declaration and gpio framework is not able to manage (in this kernel release) the pull down setting. So both pinctrl and gpio framework will be needed to configure completely this pin and it is against strict mode behavior.
Change in "stm32/pinctrl-stm32.c" file is to delete this line:
.strict = true,
if I am not wrong. So should not be a big deal ...
2019-08-21 06:18 AM
Hi @Community member
I suspect this can come from "strict mode" of pinctrl controler.
In ST kernel the pintctrl controler is set in "strict mode" meaning you can not reassign some properties to a pin at different location of the device tree. This is to avoid using the same pin for 2 different use by mistake.
Then you have 2 solutions:
or
Hope it help
Olivier
2019-08-21 07:36 AM
Thanks for your quick reply. Could you support more detail about "remove the strict mode in kernel"?
And I check the stmfx driver code in file drivers/pinctrl/pinctrl-stmfx.c. It is support use "hog" to configure pin before as irq-line. Does the stm32mp157 support this way?
And I think another way, configure the gpio property in uboot, but I doesn't sure the kernel not to modity these register(property).
2019-08-22 05:30 AM
Hello Steve,
the hog feature will have the same effect if you don't remove the strict mode. In next kernel release, more possibilities will be offer to configure the pins in gpio framework.
Then the only solution I see is to remove the strict mode: see "stm32_pmx_ops" structure in "stm32/pinctrl-stm32.c".
2019-08-22 06:22 AM
Thank again. I checked the stm32_pmx_ops in "stm32/pinctrl-stm32.c" file. This way will cost our more time to understand it. Can we use the second way( declare all pinctrl properties in one step) to solve it?
2019-08-22 07:42 AM
Sorry but I don't see for your use case other means. gt9147 node is expecting a gpio declaration and gpio framework is not able to manage (in this kernel release) the pull down setting. So both pinctrl and gpio framework will be needed to configure completely this pin and it is against strict mode behavior.
Change in "stm32/pinctrl-stm32.c" file is to delete this line:
.strict = true,
if I am not wrong. So should not be a big deal ...
2019-08-22 08:20 AM
Hi Bernard,
Thanks for your advise. I delete the strict code and add pinctrl config with gt9147.Now it is work for me. Thanks again.