linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpm_uart: Support uart_wait_until_sent()
@ 2008-06-26 11:55 Laurent Pinchart
  2008-07-02  7:46 ` Kumar Gala
  0 siblings, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2008-06-26 11:55 UTC (permalink / raw)
  To: linuxppc-dev, linux-serial, galak

[-- Attachment #1: Type: text/plain, Size: 1455 bytes --]

Set port->fifosize to the software FIFO size, and update the port timeout
when the baud rate is modified. SCC ports have an optional 32 byte hardware
FIFO which is currently not taken into account, as there is no documented way
to check when the FIFO becomes empty.

Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
---
 drivers/serial/cpm_uart/cpm_uart_core.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index a19dc7e..151cad2 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -547,6 +547,11 @@ static void cpm_uart_set_termios(struct uart_port *port,
 	}
 
 	/*
+	 * Update the timeout
+	 */
+	uart_update_timeout(port, termios->c_cflag, baud);
+
+	/*
 	 * Set up parity check flag
 	 */
 #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
@@ -1154,6 +1159,7 @@ int cpm_uart_drv_get_platform_data(struct platform_device *pdev, int is_con)
 	pinfo->port.uartclk = pdata->uart_clk;
 	pinfo->port.mapbase = (unsigned long)mem;
 	pinfo->port.irq = platform_get_irq(pdev, 0);
+	pinfo->port.fifosize = pinfo->tx_nrfifos * pinfo->tx_fifosize;
 
 	return 0;
 }
-- 
1.5.0

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussee de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] cpm_uart: Support uart_wait_until_sent()
  2008-06-26 11:55 [PATCH] cpm_uart: Support uart_wait_until_sent() Laurent Pinchart
@ 2008-07-02  7:46 ` Kumar Gala
  2008-07-02  8:58   ` [PATCHv2] " Laurent Pinchart
  0 siblings, 1 reply; 4+ messages in thread
From: Kumar Gala @ 2008-07-02  7:46 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linuxppc-dev, linux-serial


On Jun 26, 2008, at 6:55 AM, Laurent Pinchart wrote:

> Set port->fifosize to the software FIFO size, and update the port  
> timeout
> when the baud rate is modified. SCC ports have an optional 32 byte  
> hardware
> FIFO which is currently not taken into account, as there is no  
> documented way
> to check when the FIFO becomes empty.
>
> Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
> ---
> drivers/serial/cpm_uart/cpm_uart_core.c |    6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)

I spoke to soon about being able to apply this.  Can you respin this  
against my powerpc-next tree.  Also, I had troubles applying this due  
to mailer formatting issues.

- k

> diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/ 
> serial/cpm_uart/cpm_uart_core.c
> index a19dc7e..151cad2 100644
> --- a/drivers/serial/cpm_uart/cpm_uart_core.c
> +++ b/drivers/serial/cpm_uart/cpm_uart_core.c
> @@ -547,6 +547,11 @@ static void cpm_uart_set_termios(struct  
> uart_port *port,
> 	}
>
> 	/*
> +	 * Update the timeout
> +	 */
> +	uart_update_timeout(port, termios->c_cflag, baud);
> +
> +	/*
> 	 * Set up parity check flag
> 	 */
> #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK| 
> INPCK))
> @@ -1154,6 +1159,7 @@ int cpm_uart_drv_get_platform_data(struct  
> platform_device *pdev, int is_con)
> 	pinfo->port.uartclk = pdata->uart_clk;
> 	pinfo->port.mapbase = (unsigned long)mem;
> 	pinfo->port.irq = platform_get_irq(pdev, 0);
> +	pinfo->port.fifosize = pinfo->tx_nrfifos * pinfo->tx_fifosize;
>
> 	return 0;
> }
> -- 
> 1.5.0
>
> -- 
> Laurent Pinchart
> CSE Semaphore Belgium
>
> Chaussee de Bruxelles, 732A
> B-1410 Waterloo
> Belgium
>
> T +32 (2) 387 42 59
> F +32 (2) 387 42 75

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCHv2] cpm_uart: Support uart_wait_until_sent()
  2008-07-02  7:46 ` Kumar Gala
@ 2008-07-02  8:58   ` Laurent Pinchart
  2008-07-02 16:13     ` Kumar Gala
  0 siblings, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2008-07-02  8:58 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, linux-serial

Set port->fifosize to the software FIFO size, and update the port timeout
when the baud rate is modified. SCC ports have an optional 32 byte hardware
FIFO which is currently not taken into account, as there is no documented way
to check when the FIFO becomes empty.

Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
---
 drivers/serial/cpm_uart/cpm_uart_core.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index a19dc7e..151cad2 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -608,6 +608,11 @@ static void cpm_uart_set_termios(struct uart_port *port,
 	}
 
 	/*
+	 * Update the timeout
+	 */
+	uart_update_timeout(port, termios->c_cflag, baud);
+
+	/*
 	 * Set up parity check flag
 	 */
 #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
@@ -1068,6 +1073,7 @@ int cpm_uart_drv_get_platform_data(struct platform_device *pdev, int is_con)
 	pinfo->port.type = PORT_CPM;
 	pinfo->port.ops = &cpm_uart_pops,
 	pinfo->port.iotype = UPIO_MEM;
+	pinfo->port.fifosize = pinfo->tx_nrfifos * pinfo->tx_fifosize;
 	spin_lock_init(&pinfo->port.lock);
 
 	pinfo->port.irq = of_irq_to_resource(np, 0, NULL);
-- 
1.5.0

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussee de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCHv2] cpm_uart: Support uart_wait_until_sent()
  2008-07-02  8:58   ` [PATCHv2] " Laurent Pinchart
@ 2008-07-02 16:13     ` Kumar Gala
  0 siblings, 0 replies; 4+ messages in thread
From: Kumar Gala @ 2008-07-02 16:13 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linuxppc-dev, linux-serial


On Jul 2, 2008, at 3:58 AM, Laurent Pinchart wrote:

> Set port->fifosize to the software FIFO size, and update the port  
> timeout
> when the baud rate is modified. SCC ports have an optional 32 byte  
> hardware
> FIFO which is currently not taken into account, as there is no  
> documented way
> to check when the FIFO becomes empty.
>
> Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
> ---
> drivers/serial/cpm_uart/cpm_uart_core.c |    6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)

applied.

- k

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-07-02 16:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-26 11:55 [PATCH] cpm_uart: Support uart_wait_until_sent() Laurent Pinchart
2008-07-02  7:46 ` Kumar Gala
2008-07-02  8:58   ` [PATCHv2] " Laurent Pinchart
2008-07-02 16:13     ` Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).