public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Vabhav Sharma <vabhav.sharma@oss.nxp.com>
Cc: jslaby@suse.com, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org, v.sethi@nxp.com,
	Vabhav Sharma <vabhav.sharma@nxp.com>
Subject: Re: [PATCH] tty: serial: fsl_lpuart: minimum baud rate support
Date: Thu, 25 Jun 2020 12:04:10 +0200	[thread overview]
Message-ID: <20200625100410.GA3327034@kroah.com> (raw)
In-Reply-To: <1593078545-11272-1-git-send-email-vabhav.sharma@oss.nxp.com>

On Thu, Jun 25, 2020 at 03:19:05PM +0530, Vabhav Sharma wrote:
> From: Vabhav Sharma <vabhav.sharma@nxp.com>
> 
> The formula for the baud rate is
> baud rate = "baud clock / ((OSR+1) × SBR)
> 
> Algorithm used in function lpuart32_serial_setbrg() only changes
> the SBR. Even with maxmum value put in, OSR stays at 0x7 and the
> lowest baud rate would be ~ 2600 bps
> 
> Update the algorithm to allow driver operation at 1200,2400 or
> 600 bps
> 
> Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
> ---
>  drivers/tty/serial/fsl_lpuart.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
> index 90298c4..0fd0fa5f 100644
> --- a/drivers/tty/serial/fsl_lpuart.c
> +++ b/drivers/tty/serial/fsl_lpuart.c
> @@ -1925,6 +1925,10 @@ static void __lpuart32_serial_setbrg(struct uart_port *port,
>  			tmp_sbr++;
>  		}
>  
> +		if (tmp_sbr > UARTBAUD_SBR_MASK) {
> +			continue;
> +		}

Always use scripts/checkpatch.pl on your patches so you do not get
grumpy emails from maintainers telling you to use scripts/checkpatch.pl
on your patches...


  reply	other threads:[~2020-06-25 10:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-25  9:49 [PATCH] tty: serial: fsl_lpuart: minimum baud rate support Vabhav Sharma
2020-06-25 10:04 ` Greg KH [this message]
2020-06-25 10:12   ` Vabhav Sharma (OSS)
2020-06-25 10:52     ` Greg KH
2020-06-26 11:18       ` Vabhav Sharma (OSS)

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=20200625100410.GA3327034@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=v.sethi@nxp.com \
    --cc=vabhav.sharma@nxp.com \
    --cc=vabhav.sharma@oss.nxp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox