diff options
Diffstat (limited to 'drivers/serial/atmel_usart.c')
-rw-r--r-- | drivers/serial/atmel_usart.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/serial/atmel_usart.c b/drivers/serial/atmel_usart.c index 90ccdf6b294..9853f49c94f 100644 --- a/drivers/serial/atmel_usart.c +++ b/drivers/serial/atmel_usart.c @@ -18,7 +18,7 @@ #include <linux/delay.h> #include <asm/io.h> -#ifdef CONFIG_DM_SERIAL +#if CONFIG_IS_ENABLED(DM_SERIAL) #include <asm/arch/atmel_serial.h> #endif #include <asm/arch/clk.h> @@ -28,7 +28,7 @@ DECLARE_GLOBAL_DATA_PTR; -#ifndef CONFIG_DM_SERIAL +#if !CONFIG_IS_ENABLED(DM_SERIAL) static void atmel_serial_setbrg_internal(atmel_usart3_t *usart, int id, int baudrate) { @@ -72,13 +72,13 @@ static void atmel_serial_activate(atmel_usart3_t *usart) static void atmel_serial_setbrg(void) { - atmel_serial_setbrg_internal((atmel_usart3_t *)CONFIG_USART_BASE, - CONFIG_USART_ID, gd->baudrate); + atmel_serial_setbrg_internal((atmel_usart3_t *)CFG_USART_BASE, + CFG_USART_ID, gd->baudrate); } static int atmel_serial_init(void) { - atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE; + atmel_usart3_t *usart = (atmel_usart3_t *)CFG_USART_BASE; atmel_serial_init_internal(usart); serial_setbrg(); @@ -89,7 +89,7 @@ static int atmel_serial_init(void) static void atmel_serial_putc(char c) { - atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE; + atmel_usart3_t *usart = (atmel_usart3_t *)CFG_USART_BASE; if (c == '\n') serial_putc('\r'); @@ -100,7 +100,7 @@ static void atmel_serial_putc(char c) static int atmel_serial_getc(void) { - atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE; + atmel_usart3_t *usart = (atmel_usart3_t *)CFG_USART_BASE; while (!(readl(&usart->csr) & USART3_BIT(RXRDY))) schedule(); @@ -109,7 +109,7 @@ static int atmel_serial_getc(void) static int atmel_serial_tstc(void) { - atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE; + atmel_usart3_t *usart = (atmel_usart3_t *)CFG_USART_BASE; return (readl(&usart->csr) & USART3_BIT(RXRDY)) != 0; } @@ -133,9 +133,7 @@ __weak struct serial_device *default_serial_console(void) { return &atmel_serial_drv; } -#endif - -#ifdef CONFIG_DM_SERIAL +#else enum serial_clk_type { CLK_TYPE_NORMAL = 0, CLK_TYPE_DBGU, |