All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: Barry Song <Barry.Song@csr.com>
Cc: Barry Song <Baohua.Song@csr.com>,
	linux-serial@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, workgroup.linux@csr.com,
	alan@linux.intel.com
Subject: Re: [PATCH] seria: sirf: only use lookup table to set baudrate when ioclk=150MHz
Date: Tue, 25 Dec 2012 21:53:32 +0300	[thread overview]
Message-ID: <50D9F62C.6010601@mvista.com> (raw)
In-Reply-To: <1356431162-8372-1-git-send-email-Barry.Song@csr.com>

Hello.

On 12/25/2012 01:26 PM, Barry Song wrote:

> From: Barry Song <Baohua.Song@csr.com>

> The fast lookup table to set baudrate is only right when ioclk
> is 150MHz. for most platforms, ioclk is 150MHz, but some boards
> might set ioclk to other frequency.

> so re-calc the clk_div_reg when ioclk is not 150MHz.

> Signed-off-by: Barry Song <Baohua.Song@csr.com>
> ---
>  drivers/tty/serial/sirfsoc_uart.c |   18 +++++++++++++-----
>  1 files changed, 13 insertions(+), 5 deletions(-)

> diff --git a/drivers/tty/serial/sirfsoc_uart.c b/drivers/tty/serial/sirfsoc_uart.c
> index 142217c..fe28b1f 100644
> --- a/drivers/tty/serial/sirfsoc_uart.c
> +++ b/drivers/tty/serial/sirfsoc_uart.c
> @@ -375,7 +375,12 @@ static void sirfsoc_uart_set_termios(struct uart_port *port,
>  	int		threshold_div;
>  	int		temp;
>  
> -	ioclk_rate = 150000000;
> +	struct clk *clk = clk_get_sys("io", NULL);

   Please keep the coding style and insert emoty line here; you can also remove
preceding empty line (not to break the declaration block).

> +	BUG_ON(IS_ERR(clk));
> +
> +	ioclk_rate = clk_get_rate(clk);
> +	clk_put(clk);
> +
>  	switch (termios->c_cflag & CSIZE) {
>  	default:
>  	case CS8:

WBR, Sergei

WARNING: multiple messages have this Message-ID (diff)
From: sshtylyov@mvista.com (Sergei Shtylyov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] seria: sirf: only use lookup table to set baudrate when ioclk=150MHz
Date: Tue, 25 Dec 2012 21:53:32 +0300	[thread overview]
Message-ID: <50D9F62C.6010601@mvista.com> (raw)
In-Reply-To: <1356431162-8372-1-git-send-email-Barry.Song@csr.com>

Hello.

On 12/25/2012 01:26 PM, Barry Song wrote:

> From: Barry Song <Baohua.Song@csr.com>

> The fast lookup table to set baudrate is only right when ioclk
> is 150MHz. for most platforms, ioclk is 150MHz, but some boards
> might set ioclk to other frequency.

> so re-calc the clk_div_reg when ioclk is not 150MHz.

> Signed-off-by: Barry Song <Baohua.Song@csr.com>
> ---
>  drivers/tty/serial/sirfsoc_uart.c |   18 +++++++++++++-----
>  1 files changed, 13 insertions(+), 5 deletions(-)

> diff --git a/drivers/tty/serial/sirfsoc_uart.c b/drivers/tty/serial/sirfsoc_uart.c
> index 142217c..fe28b1f 100644
> --- a/drivers/tty/serial/sirfsoc_uart.c
> +++ b/drivers/tty/serial/sirfsoc_uart.c
> @@ -375,7 +375,12 @@ static void sirfsoc_uart_set_termios(struct uart_port *port,
>  	int		threshold_div;
>  	int		temp;
>  
> -	ioclk_rate = 150000000;
> +	struct clk *clk = clk_get_sys("io", NULL);

   Please keep the coding style and insert emoty line here; you can also remove
preceding empty line (not to break the declaration block).

> +	BUG_ON(IS_ERR(clk));
> +
> +	ioclk_rate = clk_get_rate(clk);
> +	clk_put(clk);
> +
>  	switch (termios->c_cflag & CSIZE) {
>  	default:
>  	case CS8:

WBR, Sergei

  reply	other threads:[~2012-12-25 18:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-25 10:26 [PATCH] seria: sirf: only use lookup table to set baudrate when ioclk=150MHz Barry Song
2012-12-25 10:26 ` Barry Song
2012-12-25 18:53 ` Sergei Shtylyov [this message]
2012-12-25 18:53   ` Sergei Shtylyov
2012-12-26 15:04 ` Russell King - ARM Linux
2012-12-26 15:04   ` Russell King - ARM Linux
2012-12-31  2:02   ` Barry Song
2012-12-31  2:02     ` Barry Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50D9F62C.6010601@mvista.com \
    --to=sshtylyov@mvista.com \
    --cc=Baohua.Song@csr.com \
    --cc=Barry.Song@csr.com \
    --cc=alan@linux.intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=workgroup.linux@csr.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.