drivers: serial: uart_pl011: remove shared irq support

The shared irq support isn't needed in this driver.  We just need to
deal with the fact that some SoCs have only a single interrupt line and
some have three interrupts.  We can just ifdef that based on
DT_NUM_IRQS.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-03-25 03:51:22 -05:00 committed by Kumar Gala
commit 9ede3c9a97
6 changed files with 14 additions and 68 deletions

View file

@ -11,10 +11,6 @@
#include <soc.h>
#include <drivers/uart.h>
#if defined(CONFIG_SHARED_IRQ)
#include <shared_irq.h>
#endif
/*
* UART PL011 register map structure
*/
@ -46,9 +42,6 @@ struct pl011_data {
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
uart_irq_callback_user_data_t irq_cb;
void *irq_cb_data;
#if defined(CONFIG_UART_PL011_SHARED_IRQ)
char *shared_irq_dev_name;
#endif
#endif
};
@ -429,9 +422,6 @@ static struct uart_device_config pl011_cfg_port_0 = {
static struct pl011_data pl011_data_port_0 = {
.baud_rate = DT_INST_0_ARM_PL011_CURRENT_SPEED,
#if defined(CONFIG_UART_PL011_SHARED_IRQ)
.shared_irq_dev_name = DT_INST_0_SHARED_IRQ_LABEL,
#endif
};
DEVICE_AND_API_INIT(pl011_port_0,
@ -445,13 +435,13 @@ DEVICE_AND_API_INIT(pl011_port_0,
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void pl011_irq_config_func_0(struct device *dev)
{
#if defined(CONFIG_UART_PL011_PORT0_SHARED_IRQ)
struct device *shared_irq_dev;
shared_irq_dev = device_get_binding(DEV_DATA(dev)->shared_irq_dev_name);
__ASSERT(shared_irq_dev != NULL, "Failed to get shared irq");
shared_irq_isr_register(shared_irq_dev, (isr_t)pl011_isr, dev);
shared_irq_enable(shared_irq_dev, dev);
#if DT_NUM_IRQS(DT_INST(0, arm_pl011)) == 1
IRQ_CONNECT(DT_INST_0_ARM_PL011_IRQ_0,
DT_INST_0_ARM_PL011_IRQ_0_PRIORITY,
pl011_isr,
DEVICE_GET(pl011_port_0),
0);
irq_enable(DT_INST_0_ARM_PL011_IRQ_0);
#else
IRQ_CONNECT(DT_INST_0_ARM_PL011_IRQ_TX,
DT_INST_0_ARM_PL011_IRQ_TX_PRIORITY,
@ -495,9 +485,6 @@ static struct uart_device_config pl011_cfg_port_1 = {
static struct pl011_data pl011_data_port_1 = {
.baud_rate = DT_INST_1_ARM_PL011_CURRENT_SPEED,
#if defined(CONFIG_UART_PL011_SHARED_IRQ)
.shared_irq_dev_name = DT_INST_1_SHARED_IRQ_LABEL,
#endif
};
DEVICE_AND_API_INIT(pl011_port_1,
@ -511,13 +498,13 @@ DEVICE_AND_API_INIT(pl011_port_1,
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void pl011_irq_config_func_1(struct device *dev)
{
#if defined(CONFIG_UART_PL011_PORT1_SHARED_IRQ)
struct device *shared_irq_dev;
shared_irq_dev = device_get_binding(DEV_DATA(dev)->shared_irq_dev_name);
__ASSERT(shared_irq_dev != NULL, "Failed to get shared irq");
shared_irq_isr_register(shared_irq_dev, (isr_t)pl011_isr, dev);
shared_irq_enable(shared_irq_dev, dev);
#if DT_NUM_IRQS(DT_INST(1, arm_pl011)) == 1
IRQ_CONNECT(DT_INST_1_ARM_PL011_IRQ_0,
DT_INST_1_ARM_PL011_IRQ_0_PRIORITY,
pl011_isr,
DEVICE_GET(pl011_port_1),
0);
irq_enable(DT_INST_1_ARM_PL011_IRQ_0);
#else
IRQ_CONNECT(DT_INST_1_ARM_PL011_IRQ_TX,
DT_INST_1_ARM_PL011_IRQ_TX_PRIORITY,