diff options
author | Greg Ungerer <gerg@uclinux.org> | 2011-12-24 01:08:47 +1000 |
---|---|---|
committer | Greg Ungerer <gerg@uclinux.org> | 2012-03-05 09:43:07 +1000 |
commit | b9a0c3f88ef6163f56662d0121d4932b457568bb (patch) | |
tree | 1dbd3956ec1cc2d46ea9fcbe825ace87d5f1c51f | |
parent | b77fb7faa9c80021e885749f8e4cf84a4981c8ba (diff) | |
download | lwn-b9a0c3f88ef6163f56662d0121d4932b457568bb.tar.gz lwn-b9a0c3f88ef6163f56662d0121d4932b457568bb.zip |
m68knommu: simplify the 54xx UART setup code
Simplify the UART setup code so that it no longer loops for each UART
present. Just make it do all the work it needs in a single function.
This will make the code easier to share when we move to a single set
of platform data for ColdFire UARTs.
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
-rw-r--r-- | arch/m68k/platform/54xx/config.c | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/arch/m68k/platform/54xx/config.c b/arch/m68k/platform/54xx/config.c index fdf6dcf5da52..4083f50682c6 100644 --- a/arch/m68k/platform/54xx/config.c +++ b/arch/m68k/platform/54xx/config.c @@ -59,32 +59,17 @@ static struct platform_device *m54xx_devices[] __initdata = { /***************************************************************************/ -static void __init m54xx_uart_init_line(int line, int irq) -{ - int rts_cts; - - /* enable io pins */ - switch (line) { - case 0: - rts_cts = 0; break; - case 1: - rts_cts = MCF_PAR_PSC_RTS_RTS; break; - case 2: - rts_cts = MCF_PAR_PSC_RTS_RTS | MCF_PAR_PSC_CTS_CTS; break; - case 3: - rts_cts = 0; break; - } - __raw_writeb(MCF_PAR_PSC_TXD | rts_cts | MCF_PAR_PSC_RXD, - MCF_MBAR + MCF_PAR_PSC(line)); -} - static void __init m54xx_uarts_init(void) { - const int nrlines = ARRAY_SIZE(m54xx_uart_platform); - int line; - - for (line = 0; (line < nrlines); line++) - m54xx_uart_init_line(line, m54xx_uart_platform[line].irq); + /* enable io pins */ + __raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD, + MCF_MBAR + MCF_PAR_PSC(0)); + __raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD | MCF_PAR_PSC_RTS_RTS, + MCF_MBAR + MCF_PAR_PSC(1)); + __raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD | MCF_PAR_PSC_RTS_RTS | + MCF_PAR_PSC_CTS_CTS, MCF_MBAR + MCF_PAR_PSC(2)); + __raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD, + MCF_MBAR + MCF_PAR_PSC(3)); } /***************************************************************************/ |