aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/mcfserial.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/mcfserial.c')
-rw-r--r--drivers/serial/mcfserial.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/drivers/serial/mcfserial.c b/drivers/serial/mcfserial.c
index 08430961a895..99af084c7cec 100644
--- a/drivers/serial/mcfserial.c
+++ b/drivers/serial/mcfserial.c
@@ -425,15 +425,13 @@ irqreturn_t mcfrs_interrupt(int irq, void *dev_id)
425 * ------------------------------------------------------------------- 425 * -------------------------------------------------------------------
426 */ 426 */
427 427
428static void mcfrs_offintr(void *private) 428static void mcfrs_offintr(struct work_struct *work)
429{ 429{
430 struct mcf_serial *info = (struct mcf_serial *) private; 430 struct mcf_serial *info = container_of(work, struct mcf_serial, tqueue);
431 struct tty_struct *tty; 431 struct tty_struct *tty = info->tty;
432 432
433 tty = info->tty; 433 if (tty)
434 if (!tty) 434 tty_wakeup(tty);
435 return;
436 tty_wakeup(tty);
437} 435}
438 436
439 437
@@ -497,16 +495,13 @@ static void mcfrs_timer(void)
497 * do_serial_hangup() -> tty->hangup() -> mcfrs_hangup() 495 * do_serial_hangup() -> tty->hangup() -> mcfrs_hangup()
498 * 496 *
499 */ 497 */
500static void do_serial_hangup(void *private) 498static void do_serial_hangup(struct work_struct *work)
501{ 499{
502 struct mcf_serial *info = (struct mcf_serial *) private; 500 struct mcf_serial *info = container_of(work, struct mcf_serial, tqueue_hangup);
503 struct tty_struct *tty; 501 struct tty_struct *tty = info->tty;
504 502
505 tty = info->tty; 503 if (tty)
506 if (!tty) 504 tty_hangup(tty);
507 return;
508
509 tty_hangup(tty);
510} 505}
511 506
512static int startup(struct mcf_serial * info) 507static int startup(struct mcf_serial * info)
@@ -857,7 +852,7 @@ static void mcfrs_throttle(struct tty_struct * tty)
857#ifdef SERIAL_DEBUG_THROTTLE 852#ifdef SERIAL_DEBUG_THROTTLE
858 char buf[64]; 853 char buf[64];
859 854
860 printk("throttle %s: %d....\n", _tty_name(tty, buf), 855 printk("throttle %s: %d....\n", tty_name(tty, buf),
861 tty->ldisc.chars_in_buffer(tty)); 856 tty->ldisc.chars_in_buffer(tty));
862#endif 857#endif
863 858
@@ -876,7 +871,7 @@ static void mcfrs_unthrottle(struct tty_struct * tty)
876#ifdef SERIAL_DEBUG_THROTTLE 871#ifdef SERIAL_DEBUG_THROTTLE
877 char buf[64]; 872 char buf[64];
878 873
879 printk("unthrottle %s: %d....\n", _tty_name(tty, buf), 874 printk("unthrottle %s: %d....\n", tty_name(tty, buf),
880 tty->ldisc.chars_in_buffer(tty)); 875 tty->ldisc.chars_in_buffer(tty));
881#endif 876#endif
882 877
@@ -1541,8 +1536,8 @@ static void mcfrs_irqinit(struct mcf_serial *info)
1541 * External Pin Mask Setting & Enable External Pin for Interface 1536 * External Pin Mask Setting & Enable External Pin for Interface
1542 * mrcbis@aliceposta.it 1537 * mrcbis@aliceposta.it
1543 */ 1538 */
1544 unsigned short *serpin_enable_mask; 1539 u16 *serpin_enable_mask;
1545 serpin_enable_mask = (MCF_IPSBAR + MCF_GPIO_PAR_UART); 1540 serpin_enable_mask = (u16 *) (MCF_IPSBAR + MCF_GPIO_PAR_UART);
1546 if (info->line == 0) 1541 if (info->line == 0)
1547 *serpin_enable_mask |= UART0_ENABLE_MASK; 1542 *serpin_enable_mask |= UART0_ENABLE_MASK;
1548 else if (info->line == 1) 1543 else if (info->line == 1)
@@ -1551,6 +1546,13 @@ static void mcfrs_irqinit(struct mcf_serial *info)
1551 *serpin_enable_mask |= UART2_ENABLE_MASK; 1546 *serpin_enable_mask |= UART2_ENABLE_MASK;
1552 } 1547 }
1553#endif 1548#endif
1549#if defined(CONFIG_M528x)
1550 /* make sure PUAPAR is set for UART0 and UART1 */
1551 if (info->line < 2) {
1552 volatile unsigned char *portp = (volatile unsigned char *) (MCF_MBAR + MCF5282_GPIO_PUAPAR);
1553 *portp |= (0x03 << (info->line * 2));
1554 }
1555#endif
1554#elif defined(CONFIG_M520x) 1556#elif defined(CONFIG_M520x)
1555 volatile unsigned char *icrp, *uartp; 1557 volatile unsigned char *icrp, *uartp;
1556 volatile unsigned long *imrp; 1558 volatile unsigned long *imrp;
@@ -1783,8 +1785,8 @@ mcfrs_init(void)
1783 info->event = 0; 1785 info->event = 0;
1784 info->count = 0; 1786 info->count = 0;
1785 info->blocked_open = 0; 1787 info->blocked_open = 0;
1786 INIT_WORK(&info->tqueue, mcfrs_offintr, info); 1788 INIT_WORK(&info->tqueue, mcfrs_offintr);
1787 INIT_WORK(&info->tqueue_hangup, do_serial_hangup, info); 1789 INIT_WORK(&info->tqueue_hangup, do_serial_hangup);
1788 init_waitqueue_head(&info->open_wait); 1790 init_waitqueue_head(&info->open_wait);
1789 init_waitqueue_head(&info->close_wait); 1791 init_waitqueue_head(&info->close_wait);
1790 1792