writel ((unsigned char)c, &uart->txdata);
}
-static void altera_serial_puts(const char *s)
-{
- while (*s != 0) {
- serial_putc (*s++);
- }
-}
-
static int altera_serial_tstc(void)
{
return (readl (&uart->status) & NIOS_UART_RRDY);
return (readl (&uart->rxdata) & 0x00ff );
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device altera_serial_drv = {
.name = "altera_serial",
.start = altera_serial_init,
.stop = NULL,
.setbrg = altera_serial_setbrg,
.putc = altera_serial_putc,
- .puts = altera_serial_puts,
+ .puts = default_serial_puts,
.getc = altera_serial_getc,
.tstc = altera_serial_tstc,
};
{
return &altera_serial_drv;
}
-#else
-int serial_init(void)
-{
- return altera_serial_init();
-}
-
-void serial_setbrg(void)
-{
- altera_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- altera_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- altera_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return altera_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return altera_serial_tstc();
-}
-#endif