Joel Stanley | 2b0f7b4 | 2016-07-19 23:26:28 +0930 | [diff] [blame^] | 1 | From b2126431287488f416104f1b97926ec2e0d8fae6 Mon Sep 17 00:00:00 2001 |
| 2 | From: Samuel Mendoza-Jonas <sam@mendozajonas.com> |
| 3 | Date: Wed, 13 Jul 2016 11:15:42 +1000 |
| 4 | Subject: [PATCH 08/10] tty/hvc: Use opal irqchip interface if available |
| 5 | |
| 6 | Update the hvc driver to use the OPAL irqchip if made available by the |
| 7 | running firmware. If it is not present, the driver falls back to the |
| 8 | existing OPAL event number. |
| 9 | |
| 10 | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> |
| 11 | Cc: <stable@vger.kernel.org> # 4.1.x- |
| 12 | Signed-off-by: Joel Stanley <joel@jms.id.au> |
| 13 | --- |
| 14 | drivers/tty/hvc/hvc_opal.c | 8 +++++++- |
| 15 | 1 file changed, 7 insertions(+), 1 deletion(-) |
| 16 | |
| 17 | diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c |
| 18 | index 47b54c6aefd2..276b796b24e4 100644 |
| 19 | --- a/drivers/tty/hvc/hvc_opal.c |
| 20 | +++ b/drivers/tty/hvc/hvc_opal.c |
| 21 | @@ -214,7 +214,13 @@ static int hvc_opal_probe(struct platform_device *dev) |
| 22 | dev->dev.of_node->full_name, |
| 23 | boot ? " (boot console)" : ""); |
| 24 | |
| 25 | - irq = opal_event_request(ilog2(OPAL_EVENT_CONSOLE_INPUT)); |
| 26 | + irq = irq_of_parse_and_map(dev->dev.of_node, 0); |
| 27 | + if (!irq) { |
| 28 | + pr_info("hvc%d: No interrupts property, using OPAL event\n", |
| 29 | + termno); |
| 30 | + irq = opal_event_request(ilog2(OPAL_EVENT_CONSOLE_INPUT)); |
| 31 | + } |
| 32 | + |
| 33 | if (!irq) { |
| 34 | pr_err("hvc_opal: Unable to map interrupt for device %s\n", |
| 35 | dev->dev.of_node->full_name); |
| 36 | -- |
| 37 | 2.8.1 |
| 38 | |