Commit ee01d415 authored by Ben Dooks's avatar Ben Dooks Committed by Russell King

[ARM PATCH] 1961/1: S3C2410 - fix for UART FIFO size calculation

Patch from Ben Dooks

Fixes calculation of how many bytes in the RX/TX FIFOs.

Previous code failed to check wether the full flags 
where set before returning the byte counter. This
should ensure that the serial driver behaves correctly
when the FIFO fills, and not just ignore the input
data
parent 1baaf2ab
...@@ -106,8 +106,23 @@ ...@@ -106,8 +106,23 @@
/* fifo size information */ /* fifo size information */
#define S3C2410_UFCON_RXC(fcon) (((fcon) & S3C2410_UFSTAT_RXMASK) >> S3C2410_UFSTAT_RXSHIFT) #ifndef __ASSEMBLY__
#define S3C2410_UFCON_TXC(fcon) (((fcon) & S3C2410_UFSTAT_TXMASK) >> S3C2410_UFSTAT_TXSHIFT) static inline int S3C2410_UFCON_RXC(int fcon)
{
if (fcon & S3C2410_UFSTAT_RXFULL)
return 16;
return ((fcon) & S3C2410_UFSTAT_RXMASK) >> S3C2410_UFSTAT_RXSHIFT;
}
static inline int S3C2410_UFCON_TXC(int fcon)
{
if (fcon & S3C2410_UFSTAT_TXFULL)
return 16;
return ((fcon) & S3C2410_UFSTAT_TXMASK) >> S3C2410_UFSTAT_TXSHIFT;
}
#endif /* __ASSEMBLY__ */
#define S3C2410_UMSTAT_CTS (1<<0) #define S3C2410_UMSTAT_CTS (1<<0)
#define S3C2410_UMSTAT_DeltaCTS (1<<2) #define S3C2410_UMSTAT_DeltaCTS (1<<2)
......
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