Mediatek X20 irq setting?

Hi, I’m new to X20 board.

I want to implement irq to do touch wake up function.

I configure GPIO63 as EINT mode, and set EINT2 with Polarity: High, Sensitive Level: Edge, and Debounce En: Disabled.

mt6797.dtsi with setting as:

gh_irq: gh_irq@ {
    compatible = "mediatek, vendorinfo";
    status = "okay";

the irq request clip as follows:

const void *irq_prop=NULL;
int irq_gpio = -1, irq_num = -1;
int retval;

irq_prop = of_get_property(dev->of_node, "vendorinfo", NULL);
irq_gpio = be32_to_cpup(irq_prop);
if (gpio_is_valid(irq_gpio)) {
    irq_num = gpio_to_irq(irq_gpio);   // my problem is here, it return zero, as it is not eint...
    retval = request_irq(irq_num, irq_handler,  IRQF_TRIGGER_RISING, "vendorinfo", NULL);

Any advice will be appreciate.

Hi Yuhsien-chen

Please set irq_gpio to 2, because the code don’t support the gpio_to_irq.And you should set the gpio mode by using pinctrl.


Hi @ekko

Thanks, I will try it soon!

You mentioned that I should set the gpio mode by using pinctrl.
Does it means I should set the GPIO63 as EINT2 by pinctrl?

Thanks a lot.

Hi yuhsien-chen

Yes, you should set the GPIO63 to the EINT mode by using pinctrl.


I’ll try it.


Hi Yuhsien-chen

Please refer to How to request IRQ, it is my summary for the irq request.