Skip to content

Commit 5666a87

Browse files
committed
gpiolib: acpi: Add acpi_gpio_need_run_edge_events_on_boot() getter
Add acpi_gpio_need_run_edge_events_on_boot() getter which moves towards isolating the GPIO ACPI and quirk APIs. It will helps splitting them completely in the next changes. No functional changes. Reviewed-by: Hans de Goede <[email protected]> Acked-by: Mika Westerberg <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent a594877 commit 5666a87

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

drivers/gpio/gpiolib-acpi.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ static void acpi_gpiochip_request_irq(struct acpi_gpio_chip *acpi_gpio,
268268
event->irq_requested = true;
269269

270270
/* Make sure we trigger the initial state of edge-triggered IRQs */
271-
if (run_edge_events_on_boot &&
271+
if (acpi_gpio_need_run_edge_events_on_boot() &&
272272
(event->irqflags & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING))) {
273273
value = gpiod_get_raw_value_cansleep(event->desc);
274274
if (((event->irqflags & IRQF_TRIGGER_RISING) && value == 1) ||
@@ -371,6 +371,11 @@ void acpi_gpio_remove_from_deferred_list(struct list_head *list)
371371
mutex_unlock(&acpi_gpio_deferred_req_irqs_lock);
372372
}
373373

374+
int acpi_gpio_need_run_edge_events_on_boot(void)
375+
{
376+
return run_edge_events_on_boot;
377+
}
378+
374379
bool acpi_gpio_in_ignore_list(enum acpi_gpio_ignore_list list, const char *controller_in,
375380
unsigned int pin_in)
376381
{

drivers/gpio/gpiolib-acpi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ void acpi_gpio_process_deferred_list(struct list_head *list);
6363
bool acpi_gpio_add_to_deferred_list(struct list_head *list);
6464
void acpi_gpio_remove_from_deferred_list(struct list_head *list);
6565

66+
int acpi_gpio_need_run_edge_events_on_boot(void);
67+
6668
enum acpi_gpio_ignore_list {
6769
ACPI_GPIO_IGNORE_WAKE,
6870
ACPI_GPIO_IGNORE_INTERRUPT,

0 commit comments

Comments
 (0)