diff options
| -rw-r--r-- | drivers/platform/chrome/cros_ec_lpc.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c index 7ec8789bf161..e1b75775cd4a 100644 --- a/drivers/platform/chrome/cros_ec_lpc.c +++ b/drivers/platform/chrome/cros_ec_lpc.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/dmi.h> | 25 | #include <linux/dmi.h> |
| 26 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
| 27 | #include <linux/io.h> | 27 | #include <linux/io.h> |
| 28 | #include <linux/interrupt.h> | ||
| 28 | #include <linux/mfd/cros_ec.h> | 29 | #include <linux/mfd/cros_ec.h> |
| 29 | #include <linux/mfd/cros_ec_commands.h> | 30 | #include <linux/mfd/cros_ec_commands.h> |
| 30 | #include <linux/module.h> | 31 | #include <linux/module.h> |
| @@ -249,7 +250,7 @@ static int cros_ec_lpc_probe(struct platform_device *pdev) | |||
| 249 | acpi_status status; | 250 | acpi_status status; |
| 250 | struct cros_ec_device *ec_dev; | 251 | struct cros_ec_device *ec_dev; |
| 251 | u8 buf[2]; | 252 | u8 buf[2]; |
| 252 | int ret; | 253 | int irq, ret; |
| 253 | 254 | ||
| 254 | if (!devm_request_region(dev, EC_LPC_ADDR_MEMMAP, EC_MEMMAP_SIZE, | 255 | if (!devm_request_region(dev, EC_LPC_ADDR_MEMMAP, EC_MEMMAP_SIZE, |
| 255 | dev_name(dev))) { | 256 | dev_name(dev))) { |
| @@ -288,6 +289,18 @@ static int cros_ec_lpc_probe(struct platform_device *pdev) | |||
| 288 | sizeof(struct ec_response_get_protocol_info); | 289 | sizeof(struct ec_response_get_protocol_info); |
| 289 | ec_dev->dout_size = sizeof(struct ec_host_request); | 290 | ec_dev->dout_size = sizeof(struct ec_host_request); |
| 290 | 291 | ||
| 292 | /* | ||
| 293 | * Some boards do not have an IRQ allotted for cros_ec_lpc, | ||
| 294 | * which makes ENXIO an expected (and safe) scenario. | ||
| 295 | */ | ||
| 296 | irq = platform_get_irq(pdev, 0); | ||
| 297 | if (irq > 0) | ||
| 298 | ec_dev->irq = irq; | ||
| 299 | else if (irq != -ENXIO) { | ||
| 300 | dev_err(dev, "couldn't retrieve IRQ number (%d)\n", irq); | ||
| 301 | return irq; | ||
| 302 | } | ||
| 303 | |||
| 291 | ret = cros_ec_register(ec_dev); | 304 | ret = cros_ec_register(ec_dev); |
| 292 | if (ret) { | 305 | if (ret) { |
| 293 | dev_err(dev, "couldn't register ec_dev (%d)\n", ret); | 306 | dev_err(dev, "couldn't register ec_dev (%d)\n", ret); |
