[xburst] jz4740_fb: Do not disable lcd clock during blanking. Only during
[15.05/openwrt.git] / target / linux / pxa / patches-2.6.21 / 024-bugfix-serial-register-status.patch
1 --- a/drivers/serial/pxa.c
2 +++ b/drivers/serial/pxa.c
3 @@ -57,6 +57,8 @@ struct uart_pxa_port {
4         unsigned int            lsr_break_flag;
5         unsigned int            cken;
6         char                    *name;
7 +       unsigned int            msr;
8 +       unsigned int            lsr;
9  };
10  
11  static inline unsigned int serial_in(struct uart_pxa_port *up, int offset)
12 @@ -159,6 +161,7 @@ static inline void receive_chars(struct 
13  
14         ignore_char:
15                 *status = serial_in(up, UART_LSR);
16 +               up->lsr = *status;
17         } while ((*status & UART_LSR_DR) && (max_count-- > 0));
18         tty_flip_buffer_push(tty);
19  }
20 @@ -211,7 +214,7 @@ static inline void check_modem_status(st
21         int status;
22  
23         status = serial_in(up, UART_MSR);
24 -
25 +       up->msr = status;
26         if ((status & UART_MSR_ANY_DELTA) == 0)
27                 return;
28  
29 @@ -242,6 +245,7 @@ static inline irqreturn_t serial_pxa_irq
30                 //printk(KERN_WARNING "serial_pxa_irq: odd -- interrupt triggered, but no interrupt in IIR: %08x\n",iir);
31         }
32         lsr = serial_in(up, UART_LSR);
33 +       up->lsr = lsr;
34         if (lsr & UART_LSR_DR)
35                 receive_chars(up, &lsr);
36         check_modem_status(up);
37 @@ -258,7 +262,7 @@ static unsigned int serial_pxa_tx_empty(
38         unsigned int ret;
39  
40         spin_lock_irqsave(&up->port.lock, flags);
41 -       ret = serial_in(up, UART_LSR) & UART_LSR_TEMT ? TIOCSER_TEMT : 0;
42 +       ret = up->lsr & UART_LSR_TEMT ? TIOCSER_TEMT : 0;
43         spin_unlock_irqrestore(&up->port.lock, flags);
44  
45         return ret;
46 @@ -270,7 +274,7 @@ static unsigned int serial_pxa_get_mctrl
47         unsigned char status;
48         unsigned int ret;
49  
50 -       status = serial_in(up, UART_MSR);
51 +       status = up->msr;
52  
53         ret = 0;
54         if (status & UART_MSR_DCD)
55 @@ -400,10 +404,10 @@ static int serial_pxa_startup(struct uar
56         /*
57          * And clear the interrupt registers again for luck.
58          */
59 -       (void) serial_in(up, UART_LSR);
60 +       up->lsr = serial_in(up, UART_LSR);
61         (void) serial_in(up, UART_RX);
62         (void) serial_in(up, UART_IIR);
63 -       (void) serial_in(up, UART_MSR);
64 +       up->msr = serial_in(up, UART_MSR);
65  
66         return 0;
67  }