Mediatek X20 irq setting?


#1

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.


#2

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.

Thanks


#3

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.


#4

Hi yuhsien-chen

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

Thanks.


How to set interrupt at X20?
How to set interrupt at X20?
#5

I’ll try it.

thanks!


#6

Hi Yuhsien-chen

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

Thanks