[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090727162312.35c2f9d4@hskinnemoen-d830>
Date: Mon, 27 Jul 2009 16:23:12 +0200
From: Haavard Skinnemoen <haavard.skinnemoen@...el.com>
To: Albin Tonnerre <albin.tonnerre@...il.com>
Cc: avictor.za@...il.com, linux-kernel@...r.kernel.org,
Albin Tonnerre <albin.tonnerre@...e-electrons.com>,
Nicolas Ferre <nicolas.ferre@...el.com>
Subject: Re: [PATCH] Add poll_get_char and poll_put_char uart_ops to
atmel_serial.
[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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists