https://bugzilla.kernel.org/show_bug.cgi?id=68291

--- Comment #26 from Mathias Nyman <[email protected]> ---
(In reply to Jin Yao from comment #25)
> 
> For IRQ16, my understanding it's different than interrupt 40. It has an
> individual interrupt handler thread which will execute the predefined ACPI
> handler.
> 
> For example, if pin6 on GPIO is triggered, interrupt 16 is fired. The
> interrupt handler thread of IRQ16 will execute the ACPI handler.
> 
> Correct me if my understanding is wrong.

Same still goes for the gpio triggered ACPI events as for the sd card. Early
when gpio driver calls gpiochip_add() we register interrupt handlers for gpio
triggered acpi events.

registration simplified:

gpiochip_add()   // pinctrl-baytraul.c
 acpi_gpiochip_add();   // gpiolib.c
  acpi_gpiochip_request_interrupts()  // gpiolib-acpi.c
  // search for gpio interrupts and acpi handlers from ACPI tables.
  // finds pin 6, pin 6 will get mapped to irq 16 in here: 
  irq = chip->to_irq(chip, pin);  // calls baytrail gpio_to_irq() which maps.
  devm_request_threaded_irq(..,irq,.., acpi_gpio_irq_handler); //set handler
for interrupt descriptor 16. (irq = 16, pin = 6))

When gpio line 6 is set high, interrupt (0x31) fires, gpio driver interrupt
handler is called -> finds line 6 was high -> line 6 maps to interrupt
descriptor 16, calls the interrupt handler set for interrupt 16 ->
acpi_gpio_irq_handler()

static irqreturn_t acpi_gpio_irq_handler(int irq, void *data)
{
    acpi_handle handle = data;

        acpi_evaluate_object(handle, NULL, NULL, NULL);

        return IRQ_HANDLED;
}

Ready.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
acpi-bugzilla mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/acpi-bugzilla

Reply via email to