summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-11-28 13:45:32 +0200
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-12-03 21:40:02 +0200
commit799d3379a6728794de5ed2be8acc5b4a65d776b6 (patch)
tree236886b90b1db7e26b30a21a69d3199d835b7c41 /drivers/platform
parent870ab9a379b6753ed45736152b0237ccc726172c (diff)
downloadlinux-799d3379a6728794de5ed2be8acc5b4a65d776b6.tar.gz
platform/x86: i2c-multi-instantiate: Introduce IOAPIC IRQ support
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>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/i2c-multi-instantiate.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c
index 99db3e336718..365457f9c424 100644
--- a/drivers/platform/x86/i2c-multi-instantiate.c
+++ b/drivers/platform/x86/i2c-multi-instantiate.c
@@ -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;
@@ -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;