mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
To: Albin Tonnerre <albin.tonnerre@gmail.com>
Cc: avictor.za@gmail.com, linux-kernel@vger.kernel.org,
	Albin Tonnerre <albin.tonnerre@free-electrons.com>,
	Nicolas Ferre <nicolas.ferre@atmel.com>
Subject: Re: [PATCH] Add poll_get_char and poll_put_char uart_ops to atmel_serial.
Date: Mon, 27 Jul 2009 16:23:12 +0200	[thread overview]
Message-ID: <20090727162312.35c2f9d4@hskinnemoen-d830> (raw)
In-Reply-To: <1246352745-31323-1-git-send-email-albin.tonnerre@free-electrons.com>

[added AT91 maintainers to Cc]

Albin Tonnerre wrote:
> +#ifdef CONFIG_CONSOLE_POLL
> +static int atmel_poll_get_char(struct uart_port *port)
> +{
> +	struct atmel_uart_port *aup = to_atmel_uart_port(port);
> +
> +	while (!(readb(aup->uart.membase + ATMEL_US_CSR) & ATMEL_US_RXRDY))
> +		barrier();
> +
> +	return readb(aup->uart.membase + ATMEL_US_RHR);
> +}
> +
> +static void atmel_poll_put_char(struct uart_port *port, unsigned char ch)
> +{
> +	struct atmel_uart_port *aup = to_atmel_uart_port(port);
> +	unsigned int status;
> +
> +	while (!(readb(aup->uart.membase + ATMEL_US_CSR) & ATMEL_US_TXRDY))
> +		barrier();
> +
> +	writeb(ch, aup->uart.membase + ATMEL_US_THR);
> +}
> +#endif

All the registers are 32 bits wide, so you should use __raw_readl() and
__raw_writel() to avoid any endianness issues (AT91 is little endian
and AVR32 is big endian).

Haavard

  reply	other threads:[~2009-07-27 14:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-30  9:05 Albin Tonnerre
2009-07-27 14:23 ` Haavard Skinnemoen [this message]
2009-07-27 15:19   ` Albin Tonnerre
2009-07-28 16:09     ` Haavard Skinnemoen
2009-09-04 15:34       ` Albin Tonnerre
2009-09-07  6:22     ` Andrew Victor
2009-09-07  9:52       ` [PATCH v2] " Albin Tonnerre
2009-09-07 18:17         ` Andrew Victor
2009-09-08  8:30         ` Haavard Skinnemoen
2009-09-11 11:31           ` Albin Tonnerre
2009-10-10 18:57             ` Albin Tonnerre
2009-11-11 11:37         ` Albin Tonnerre
2009-11-12 22:24         ` Andrew Morton

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=20090727162312.35c2f9d4@hskinnemoen-d830 \
    --to=haavard.skinnemoen@atmel.com \
    --cc=albin.tonnerre@free-electrons.com \
    --cc=albin.tonnerre@gmail.com \
    --cc=avictor.za@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.ferre@atmel.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

all inboxes | Powered by JetHome®