Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213500
b: refs/heads/master
c: 91efa75
h: refs/heads/master
v: v3
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Oct 22, 2010
1 parent 7955638 commit 8c03743
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ee9b4500eb6433015f35762d390666fede48e574
refs/heads/master: 91efa75ce14db63d1eb47a2935bc7332de243f8d
7 changes: 0 additions & 7 deletions trunk/drivers/serial/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -717,13 +717,6 @@ config SERIAL_MRST_MAX3110
the Intel Moorestown platform. On other systems use the max3100
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
tristate "Medfield High Speed UART support"
depends on PCI
Expand Down
55 changes: 28 additions & 27 deletions trunk/drivers/serial/mrst_max3110.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ static int max3110_main_thread(void *_max)
return ret;
}

#ifdef CONFIG_MRST_MAX3110_IRQ
static irqreturn_t serial_m3110_irq(int irq, void *dev_id)
{
struct uart_max3110 *max = dev_id;
Expand All @@ -459,7 +458,7 @@ static irqreturn_t serial_m3110_irq(int irq, void *dev_id)

return IRQ_HANDLED;
}
#else

/* if don't use RX IRQ, then need a thread to polling read */
static int max3110_read_thread(void *_max)
{
Expand All @@ -482,7 +481,6 @@ static int max3110_read_thread(void *_max)

return 0;
}
#endif

static int serial_m3110_startup(struct uart_port *port)
{
Expand All @@ -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 */
port->state->port.tty->low_latency = 1;

#ifdef CONFIG_MRST_MAX3110_IRQ
ret = request_irq(max->irq, serial_m3110_irq,
if (max->irq) {
max->read_thread = NULL;
ret = request_irq(max->irq, serial_m3110_irq,
IRQ_TYPE_EDGE_FALLING, "max3110", max);
if (ret)
return ret;
if (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 */
config |= WC_RXA_IRQ_ENABLE;
#else
/* If IRQ is disabled, start a read thread for input data */
max->read_thread =
kthread_run(max3110_read_thread, max, "max3110_read");
if (IS_ERR(max->read_thread)) {
ret = PTR_ERR(max->read_thread);
max->read_thread = NULL;
pr_err(PR_FMT "Can't create read thread!");
return ret;
if (max->irq == 0) {
/* If IRQ is disabled, start a read thread for input data */
max->read_thread =
kthread_run(max3110_read_thread, max, "max3110_read");
if (IS_ERR(max->read_thread)) {
ret = PTR_ERR(max->read_thread);
max->read_thread = NULL;
pr_err(PR_FMT "Can't create read thread!\n");
return ret;
}
}
#endif

ret = max3110_out(max, config);
if (ret) {
#ifdef CONFIG_MRST_MAX3110_IRQ
free_irq(max->irq, max);
#else
kthread_stop(max->read_thread);
if (max->irq)
free_irq(max->irq, max);
if (max->read_thread)
kthread_stop(max->read_thread);
max->read_thread = NULL;
#endif
return ret;
}

Expand All @@ -551,9 +553,8 @@ static void serial_m3110_shutdown(struct uart_port *port)
max->read_thread = NULL;
}

#ifdef CONFIG_MRST_MAX3110_IRQ
free_irq(max->irq, max);
#endif
if (max->irq)
free_irq(max->irq, max);

/* Disable interrupts from this port */
config = WC_TAG | WC_SW_SHDI;
Expand Down

0 comments on commit 8c03743

Please sign in to comment.