linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Caesar Wang <caesar.upstream-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org
Cc: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>,
	Doug Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	jslaby-IBi9RG/b67k@public.gmane.org,
	Caesar Wang <wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Subject: Re: [PATCH v2] serial: core: remove baud_rates when serial console setup
Date: Sat, 5 Mar 2016 18:21:51 +0800	[thread overview]
Message-ID: <56DAB33F.50802@gmail.com> (raw)
In-Reply-To: <1451894086-20435-1-git-send-email-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>

Hi,

I don't see this patch in mainline.:-(
Sorry for noise if this patch has applied by Greg.

在 2016年01月04日 15:54, Jeffy Chen 写道:
> Currently, when tring to set up a serial console with a higher
> baud rate, it would fallback to 921600.
>
> Tested-by: Jianqun Xu <jay.xu@rock-chips.com>
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>

Verified on RK3228/RK3229 SoCs.
Tested-by: Caesar Wang <wxt@rock-chips.com>


>
> ---
>
> Changes in v2:
> remove baud_rates as Alan's suggestion.
>
>   drivers/tty/serial/serial_core.c | 33 ++-------------------------------
>   1 file changed, 2 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index def5199..150547c 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -1892,26 +1892,6 @@ uart_parse_options(char *options, int *baud, int *parity, int *bits, int *flow)
>   }
>   EXPORT_SYMBOL_GPL(uart_parse_options);
>   
> -struct baud_rates {
> -	unsigned int rate;
> -	unsigned int cflag;
> -};
> -
> -static const struct baud_rates baud_rates[] = {
> -	{ 921600, B921600 },
> -	{ 460800, B460800 },
> -	{ 230400, B230400 },
> -	{ 115200, B115200 },
> -	{  57600, B57600  },
> -	{  38400, B38400  },
> -	{  19200, B19200  },
> -	{   9600, B9600   },
> -	{   4800, B4800   },
> -	{   2400, B2400   },
> -	{   1200, B1200   },
> -	{      0, B38400  }
> -};
> -
>   /**
>    *	uart_set_options - setup the serial console parameters
>    *	@port: pointer to the serial ports uart_port structure
> @@ -1927,7 +1907,6 @@ uart_set_options(struct uart_port *port, struct console *co,
>   {
>   	struct ktermios termios;
>   	static struct ktermios dummy;
> -	int i;
>   
>   	/*
>   	 * Ensure that the serial console lock is initialised
> @@ -1942,16 +1921,8 @@ uart_set_options(struct uart_port *port, struct console *co,
>   
>   	memset(&termios, 0, sizeof(struct ktermios));
>   
> -	termios.c_cflag = CREAD | HUPCL | CLOCAL;
> -
> -	/*
> -	 * Construct a cflag setting.
> -	 */
> -	for (i = 0; baud_rates[i].rate; i++)
> -		if (baud_rates[i].rate <= baud)
> -			break;
> -
> -	termios.c_cflag |= baud_rates[i].cflag;
> +	termios.c_cflag |= CREAD | HUPCL | CLOCAL;
> +	tty_termios_encode_baud_rate(&termios, baud, baud);
>   
>   	if (bits == 7)
>   		termios.c_cflag |= CS7;


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

      parent reply	other threads:[~2016-03-05 10:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04  7:54 [PATCH v2] serial: core: remove baud_rates when serial console setup Jeffy Chen
     [not found] ` <1451894086-20435-1-git-send-email-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-01-16 15:49   ` Peter Hurley
2016-03-05 10:21   ` Caesar Wang [this message]

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=56DAB33F.50802@gmail.com \
    --to=caesar.upstream-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org \
    --cc=jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    --cc=jslaby-IBi9RG/b67k@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    /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 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).