diff options
author | Andrei Emeltchenko <andrei.emeltchenko@nokia.com> | 2010-11-30 17:11:49 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-11-30 17:11:49 -0500 |
commit | 498cb95175c29ed96bf32f30df2d11ec1c7f3879 (patch) | |
tree | f46ffac45790929c8e7f1bf2838f537bc9e31e48 /arch/arm/mach-omap2/serial.c | |
parent | e8a7e48bb248a1196484d3f8afa53bded2b24e71 (diff) |
OMAP: Serial: Define OMAP uart MDR1 reg and remove magic numbers
Define MDR1 register serial definitions used in serial and
bluetooth drivers.
Change magic number to ones defined in serial_reg for omap1/2
serial driver.
Remove redefined MDR1 register definitions in omap-serial driver.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Acked-by: G, Manjunath Kondaiah <manjugk@ti.com>
Acked-by: Govindraj.R <govindraj.raja@ti.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/serial.c')
-rw-r--r-- | arch/arm/mach-omap2/serial.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index d17960a1be25..fa9806250b50 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c | |||
@@ -169,9 +169,9 @@ static inline void serial_write_reg(struct omap_uart_state *uart, int offset, | |||
169 | 169 | ||
170 | static inline void __init omap_uart_reset(struct omap_uart_state *uart) | 170 | static inline void __init omap_uart_reset(struct omap_uart_state *uart) |
171 | { | 171 | { |
172 | serial_write_reg(uart, UART_OMAP_MDR1, 0x07); | 172 | serial_write_reg(uart, UART_OMAP_MDR1, UART_OMAP_MDR1_DISABLE); |
173 | serial_write_reg(uart, UART_OMAP_SCR, 0x08); | 173 | serial_write_reg(uart, UART_OMAP_SCR, 0x08); |
174 | serial_write_reg(uart, UART_OMAP_MDR1, 0x00); | 174 | serial_write_reg(uart, UART_OMAP_MDR1, UART_OMAP_MDR1_16X_MODE); |
175 | } | 175 | } |
176 | 176 | ||
177 | #if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) | 177 | #if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) |
@@ -247,9 +247,10 @@ static void omap_uart_restore_context(struct omap_uart_state *uart) | |||
247 | uart->context_valid = 0; | 247 | uart->context_valid = 0; |
248 | 248 | ||
249 | if (uart->errata & UART_ERRATA_i202_MDR1_ACCESS) | 249 | if (uart->errata & UART_ERRATA_i202_MDR1_ACCESS) |
250 | omap_uart_mdr1_errataset(uart, 0x07, 0xA0); | 250 | omap_uart_mdr1_errataset(uart, UART_OMAP_MDR1_DISABLE, 0xA0); |
251 | else | 251 | else |
252 | serial_write_reg(uart, UART_OMAP_MDR1, 0x7); | 252 | serial_write_reg(uart, UART_OMAP_MDR1, UART_OMAP_MDR1_DISABLE); |
253 | |||
253 | serial_write_reg(uart, UART_LCR, 0xBF); /* Config B mode */ | 254 | serial_write_reg(uart, UART_LCR, 0xBF); /* Config B mode */ |
254 | efr = serial_read_reg(uart, UART_EFR); | 255 | efr = serial_read_reg(uart, UART_EFR); |
255 | serial_write_reg(uart, UART_EFR, UART_EFR_ECB); | 256 | serial_write_reg(uart, UART_EFR, UART_EFR_ECB); |
@@ -268,11 +269,13 @@ static void omap_uart_restore_context(struct omap_uart_state *uart) | |||
268 | serial_write_reg(uart, UART_OMAP_SCR, uart->scr); | 269 | serial_write_reg(uart, UART_OMAP_SCR, uart->scr); |
269 | serial_write_reg(uart, UART_OMAP_WER, uart->wer); | 270 | serial_write_reg(uart, UART_OMAP_WER, uart->wer); |
270 | serial_write_reg(uart, UART_OMAP_SYSC, uart->sysc); | 271 | serial_write_reg(uart, UART_OMAP_SYSC, uart->sysc); |
272 | |||
271 | if (uart->errata & UART_ERRATA_i202_MDR1_ACCESS) | 273 | if (uart->errata & UART_ERRATA_i202_MDR1_ACCESS) |
272 | omap_uart_mdr1_errataset(uart, 0x00, 0xA1); | 274 | omap_uart_mdr1_errataset(uart, UART_OMAP_MDR1_16X_MODE, 0xA1); |
273 | else | 275 | else |
274 | /* UART 16x mode */ | 276 | /* UART 16x mode */ |
275 | serial_write_reg(uart, UART_OMAP_MDR1, 0x00); | 277 | serial_write_reg(uart, UART_OMAP_MDR1, |
278 | UART_OMAP_MDR1_16X_MODE); | ||
276 | } | 279 | } |
277 | #else | 280 | #else |
278 | static inline void omap_uart_save_context(struct omap_uart_state *uart) {} | 281 | static inline void omap_uart_save_context(struct omap_uart_state *uart) {} |