diff options
-rw-r--r-- | src/drivers/i2c/hid/hid.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/drivers/i2c/hid/hid.c b/src/drivers/i2c/hid/hid.c index 2d213eb74e..8705c1e34a 100644 --- a/src/drivers/i2c/hid/hid.c +++ b/src/drivers/i2c/hid/hid.c @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include <acpi/acpigen_dsm.h> +#include <acpi/acpi_device.h> +#include <assert.h> #include <device/device.h> #include <string.h> #include "chip.h" @@ -68,6 +70,18 @@ static void i2c_hid_enable(struct device *dev) } } + /* + * Ensure that I2C HID devices use level triggered interrupts as per ACPI + * I2C HID requirement. Check interrupt and GPIO interrupt. + */ + if ((!config->generic.irq_gpio.pin_count && + config->generic.irq.mode != ACPI_IRQ_LEVEL_TRIGGERED) || + (config->generic.irq_gpio.pin_count && + config->generic.irq_gpio.irq.mode != ACPI_IRQ_LEVEL_TRIGGERED)) { + printk(BIOS_ERR, "%s IRQ is not level triggered.\n", config->generic.hid); + BUG(); + } + dev->ops = &i2c_hid_ops; if (config && config->generic.desc) { |