Commit 91efa75c authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

serial: mrst_max3110: Make the IRQ option runtime

And while we are at it allow it to fail to find one. Without this the IRQ
option will cause the 3110 driver to fail on 0.7 SFI firmware.
Acked-by: default avatarFeng Tang <feng.tang@intel.com>
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ee9b4500
...@@ -717,13 +717,6 @@ config SERIAL_MRST_MAX3110 ...@@ -717,13 +717,6 @@ config SERIAL_MRST_MAX3110
the Intel Moorestown platform. On other systems use the max3100 the Intel Moorestown platform. On other systems use the max3100
driver. driver.
config MRST_MAX3110_IRQ
boolean "Enable GPIO IRQ for Max3110 over Moorestown"
default n
depends on SERIAL_MRST_MAX3110 && GPIO_LANGWELL
help
This has to be enabled after Moorestown GPIO driver is loaded
config SERIAL_MFD_HSU config SERIAL_MFD_HSU
tristate "Medfield High Speed UART support" tristate "Medfield High Speed UART support"
depends on PCI depends on PCI
......
...@@ -447,7 +447,6 @@ static int max3110_main_thread(void *_max) ...@@ -447,7 +447,6 @@ static int max3110_main_thread(void *_max)
return ret; return ret;
} }
#ifdef CONFIG_MRST_MAX3110_IRQ
static irqreturn_t serial_m3110_irq(int irq, void *dev_id) static irqreturn_t serial_m3110_irq(int irq, void *dev_id)
{ {
struct uart_max3110 *max = dev_id; struct uart_max3110 *max = dev_id;
...@@ -459,7 +458,7 @@ static irqreturn_t serial_m3110_irq(int irq, void *dev_id) ...@@ -459,7 +458,7 @@ static irqreturn_t serial_m3110_irq(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
#else
/* if don't use RX IRQ, then need a thread to polling read */ /* if don't use RX IRQ, then need a thread to polling read */
static int max3110_read_thread(void *_max) static int max3110_read_thread(void *_max)
{ {
...@@ -482,7 +481,6 @@ static int max3110_read_thread(void *_max) ...@@ -482,7 +481,6 @@ static int max3110_read_thread(void *_max)
return 0; return 0;
} }
#endif
static int serial_m3110_startup(struct uart_port *port) static int serial_m3110_startup(struct uart_port *port)
{ {
...@@ -505,34 +503,38 @@ static int serial_m3110_startup(struct uart_port *port) ...@@ -505,34 +503,38 @@ static int serial_m3110_startup(struct uart_port *port)
/* as we use thread to handle tx/rx, need set low latency */ /* as we use thread to handle tx/rx, need set low latency */
port->state->port.tty->low_latency = 1; port->state->port.tty->low_latency = 1;
#ifdef CONFIG_MRST_MAX3110_IRQ if (max->irq) {
ret = request_irq(max->irq, serial_m3110_irq, max->read_thread = NULL;
ret = request_irq(max->irq, serial_m3110_irq,
IRQ_TYPE_EDGE_FALLING, "max3110", max); IRQ_TYPE_EDGE_FALLING, "max3110", max);
if (ret) if (ret) {
return ret; max->irq = 0;
pr_err(PR_FMT "unable to allocate IRQ, polling\n");
} else {
/* Enable RX IRQ only */
config |= WC_RXA_IRQ_ENABLE;
}
}
/* Enable RX IRQ only */ if (max->irq == 0) {
config |= WC_RXA_IRQ_ENABLE; /* If IRQ is disabled, start a read thread for input data */
#else max->read_thread =
/* If IRQ is disabled, start a read thread for input data */ kthread_run(max3110_read_thread, max, "max3110_read");
max->read_thread = if (IS_ERR(max->read_thread)) {
kthread_run(max3110_read_thread, max, "max3110_read"); ret = PTR_ERR(max->read_thread);
if (IS_ERR(max->read_thread)) { max->read_thread = NULL;
ret = PTR_ERR(max->read_thread); pr_err(PR_FMT "Can't create read thread!\n");
max->read_thread = NULL; return ret;
pr_err(PR_FMT "Can't create read thread!"); }
return ret;
} }
#endif
ret = max3110_out(max, config); ret = max3110_out(max, config);
if (ret) { if (ret) {
#ifdef CONFIG_MRST_MAX3110_IRQ if (max->irq)
free_irq(max->irq, max); free_irq(max->irq, max);
#else if (max->read_thread)
kthread_stop(max->read_thread); kthread_stop(max->read_thread);
max->read_thread = NULL; max->read_thread = NULL;
#endif
return ret; return ret;
} }
...@@ -551,9 +553,8 @@ static void serial_m3110_shutdown(struct uart_port *port) ...@@ -551,9 +553,8 @@ static void serial_m3110_shutdown(struct uart_port *port)
max->read_thread = NULL; max->read_thread = NULL;
} }
#ifdef CONFIG_MRST_MAX3110_IRQ if (max->irq)
free_irq(max->irq, max); free_irq(max->irq, max);
#endif
/* Disable interrupts from this port */ /* Disable interrupts from this port */
config = WC_TAG | WC_SW_SHDI; config = WC_TAG | WC_SW_SHDI;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment