Commit 1fbe966f authored by Ben Dooks's avatar Ben Dooks Committed by Russell King

[ARM PATCH] 2275/1: S3C2410 - serial rx fifo full check

Patch from Ben Dooks

Check for the serial rx fifo full before checking
for the fifo size.

Signed-off-by: Ben Dooks
Signed-off-by: Russell King
parent 97e4d229
...@@ -78,6 +78,7 @@ struct s3c24xx_uart_info { ...@@ -78,6 +78,7 @@ struct s3c24xx_uart_info {
unsigned int fifosize; unsigned int fifosize;
unsigned long rx_fifomask; unsigned long rx_fifomask;
unsigned long rx_fifoshift; unsigned long rx_fifoshift;
unsigned long rx_fifofull;
unsigned long tx_fifomask; unsigned long tx_fifomask;
unsigned long tx_fifoshift; unsigned long tx_fifoshift;
unsigned long tx_fifofull; unsigned long tx_fifofull;
...@@ -282,6 +283,10 @@ static int s3c24xx_serial_rx_fifocnt(struct s3c24xx_uart_port *ourport, ...@@ -282,6 +283,10 @@ static int s3c24xx_serial_rx_fifocnt(struct s3c24xx_uart_port *ourport,
unsigned long ufstat) unsigned long ufstat)
{ {
struct s3c24xx_uart_info *info = ourport->info; struct s3c24xx_uart_info *info = ourport->info;
if (ufstat & info->rx_fifofull)
return info->fifosize;
return (ufstat & info->rx_fifomask) >> info->rx_fifoshift; return (ufstat & info->rx_fifomask) >> info->rx_fifoshift;
} }
...@@ -1204,6 +1209,7 @@ static struct s3c24xx_uart_info s3c2410_uart_inf = { ...@@ -1204,6 +1209,7 @@ static struct s3c24xx_uart_info s3c2410_uart_inf = {
.fifosize = 16, .fifosize = 16,
.rx_fifomask = S3C2410_UFSTAT_RXMASK, .rx_fifomask = S3C2410_UFSTAT_RXMASK,
.rx_fifoshift = S3C2410_UFSTAT_RXSHIFT, .rx_fifoshift = S3C2410_UFSTAT_RXSHIFT,
.rx_fifofull = S3C2410_UFSTAT_RXFULL,
.tx_fifofull = S3C2410_UFSTAT_TXFULL, .tx_fifofull = S3C2410_UFSTAT_TXFULL,
.tx_fifomask = S3C2410_UFSTAT_TXMASK, .tx_fifomask = S3C2410_UFSTAT_TXMASK,
.tx_fifoshift = S3C2410_UFSTAT_TXSHIFT, .tx_fifoshift = S3C2410_UFSTAT_TXSHIFT,
...@@ -1313,6 +1319,7 @@ static struct s3c24xx_uart_info s3c2440_uart_inf = { ...@@ -1313,6 +1319,7 @@ static struct s3c24xx_uart_info s3c2440_uart_inf = {
.fifosize = 64, .fifosize = 64,
.rx_fifomask = S3C2440_UFSTAT_RXMASK, .rx_fifomask = S3C2440_UFSTAT_RXMASK,
.rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT,
.rx_fifofull = S3C2440_UFSTAT_RXFULL,
.tx_fifofull = S3C2440_UFSTAT_TXFULL, .tx_fifofull = S3C2440_UFSTAT_TXFULL,
.tx_fifomask = S3C2440_UFSTAT_TXMASK, .tx_fifomask = S3C2440_UFSTAT_TXMASK,
.tx_fifoshift = S3C2440_UFSTAT_TXSHIFT, .tx_fifoshift = S3C2440_UFSTAT_TXSHIFT,
......
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