mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: David Dgien <dgienda125@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] serial: Add flush function to NS16550 driver
Date: Wed, 20 May 2020 13:20:56 +0200	[thread overview]
Message-ID: <20200520112056.GC11869@pengutronix.de> (raw)
In-Reply-To: <20200520035536.84368-1-dgienda125@gmail.com>

On Tue, May 19, 2020 at 11:55:36PM -0400, David Dgien wrote:
> Add flush function to NS16550 to remove bad characters being printed
> during reset
> 
> Signed-off-by: David Dgien <dgienda125@gmail.com>
> ---
>  drivers/serial/serial_ns16550.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)

Applied, thanks

Sascha

> 
> diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c
> index 5d6cec82a..f117ab9dc 100644
> --- a/drivers/serial/serial_ns16550.c
> +++ b/drivers/serial/serial_ns16550.c
> @@ -308,6 +308,17 @@ static int ns16550_tstc(struct console_device *cdev)
>  	return ((ns16550_read(cdev, lsr) & LSR_DR) != 0);
>  }
>  
> +/**
> + * @brief Flush remaining characters in serial device
> + *
> + * @param[in] cdev pointer to console device
> + */
> +static void ns16550_flush(struct console_device *cdev)
> +{
> +	/* Loop Doing Nothing */
> +	while ((ns16550_read(cdev, lsr) & LSR_TEMT) == 0) ;
> +}
> +
>  static void ns16550_probe_dt(struct device_d *dev, struct ns16550_priv *priv)
>  {
>  	struct device_node *np = dev->device_node;
> @@ -501,6 +512,7 @@ static int ns16550_probe(struct device_d *dev)
>  	cdev->putc = ns16550_putc;
>  	cdev->getc = ns16550_getc;
>  	cdev->setbrg = ns16550_setbaudrate;
> +	cdev->flush = ns16550_flush;
>  	cdev->linux_console_name = devtype->linux_console_name;
>  
>  	priv->fcrval = FCRVAL;
> -- 
> 2.26.2
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2020-05-20 11:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20  3:55 David Dgien
2020-05-20 11:20 ` Sascha Hauer [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=20200520112056.GC11869@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=dgienda125@gmail.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