Skip to content

Commit

Permalink
platform/x86: i2c-multi-instantiate: Introduce IOAPIC IRQ support
Browse files Browse the repository at this point in the history
If ACPI table provides an Interrupt() resource we may consider to use it
instead of GpioInt() one.

Here we leave an error condition, when getting IRQ resource, to the driver
to decide how to proceed, because some drivers may consider IRQ resource
optional.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
  • Loading branch information
Andy Shevchenko committed Dec 3, 2018
1 parent 870ab9a commit 799d337
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/platform/x86/i2c-multi-instantiate.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define IRQ_RESOURCE_TYPE GENMASK(1, 0)
#define IRQ_RESOURCE_NONE 0
#define IRQ_RESOURCE_GPIO 1
#define IRQ_RESOURCE_APIC 2

struct i2c_inst_data {
const char *type;
Expand Down Expand Up @@ -104,6 +105,14 @@ static int i2c_multi_inst_probe(struct platform_device *pdev)
}
board_info.irq = ret;
break;
case IRQ_RESOURCE_APIC:
ret = platform_get_irq(pdev, inst_data[i].irq_idx);
if (ret < 0) {
dev_dbg(dev, "Error requesting irq at index %d: %d\n",
inst_data[i].irq_idx, ret);
}
board_info.irq = ret;
break;
default:
board_info.irq = 0;
break;
Expand Down

0 comments on commit 799d337

Please sign in to comment.