diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 22:59:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 22:59:04 -0400 |
commit | 73ecf3a6e3f0206bf56a0fefe3b3eda042fb7034 (patch) | |
tree | 866f0ebb2b148479e93b5ac955097b1cc94ceb4e /arch/mips | |
parent | b9da0571050c09863e59f94d0b8594a290d61b88 (diff) | |
parent | cd3ecad19aea8debae9a48b53de2ec7a571f24e9 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (49 commits)
serial8250: ratelimit "too much work" error
serial: bfin_sport_uart: speed up sport RX sample rate to be 3% faster
serial: abstraction for 8250 legacy ports
serial/imx: check that the buffer is non-empty before sending it out
serial: mfd: add more baud rates support
jsm: Remove the uart port on errors
Alchemy: Add UART PM methods.
8250: allow platforms to override PM hook.
altera_uart: Don't use plain integer as NULL pointer
altera_uart: Fix missing prototype for registering an early console
altera_uart: Fixup type usage of port flags
altera_uart: Make it possible to use Altera UART and 8250 ports together
altera_uart: Add support for different address strides
altera_uart: Add support for getting mapbase and IRQ from resources
altera_uart: Add support for polling mode (IRQ-less)
serial: Factor out uart_poll_timeout() from 8250 driver
serial: mark the 8250 driver as maintained
serial: 8250: Don't delay after transmitter is ready.
tty: MAINTAINERS: add drivers/serial/jsm/ as maintained driver
vcs: invoke the vt update callback when /dev/vcs* is written to
...
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/alchemy/common/platform.c | 28 | ||||
-rw-r--r-- | arch/mips/alchemy/common/power.c | 35 |
2 files changed, 28 insertions, 35 deletions
diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c index 1dc55ee2681b..3691630931d6 100644 --- a/arch/mips/alchemy/common/platform.c +++ b/arch/mips/alchemy/common/platform.c | |||
@@ -24,6 +24,33 @@ | |||
24 | 24 | ||
25 | #include <prom.h> | 25 | #include <prom.h> |
26 | 26 | ||
27 | static void alchemy_8250_pm(struct uart_port *port, unsigned int state, | ||
28 | unsigned int old_state) | ||
29 | { | ||
30 | switch (state) { | ||
31 | case 0: | ||
32 | if ((__raw_readl(port->membase + UART_MOD_CNTRL) & 3) != 3) { | ||
33 | /* power-on sequence as suggested in the databooks */ | ||
34 | __raw_writel(0, port->membase + UART_MOD_CNTRL); | ||
35 | wmb(); | ||
36 | __raw_writel(1, port->membase + UART_MOD_CNTRL); | ||
37 | wmb(); | ||
38 | } | ||
39 | __raw_writel(3, port->membase + UART_MOD_CNTRL); /* full on */ | ||
40 | wmb(); | ||
41 | serial8250_do_pm(port, state, old_state); | ||
42 | break; | ||
43 | case 3: /* power off */ | ||
44 | serial8250_do_pm(port, state, old_state); | ||
45 | __raw_writel(0, port->membase + UART_MOD_CNTRL); | ||
46 | wmb(); | ||
47 | break; | ||
48 | default: | ||
49 | serial8250_do_pm(port, state, old_state); | ||
50 | break; | ||
51 | } | ||
52 | } | ||
53 | |||
27 | #define PORT(_base, _irq) \ | 54 | #define PORT(_base, _irq) \ |
28 | { \ | 55 | { \ |
29 | .mapbase = _base, \ | 56 | .mapbase = _base, \ |
@@ -33,6 +60,7 @@ | |||
33 | .flags = UPF_SKIP_TEST | UPF_IOREMAP | \ | 60 | .flags = UPF_SKIP_TEST | UPF_IOREMAP | \ |
34 | UPF_FIXED_TYPE, \ | 61 | UPF_FIXED_TYPE, \ |
35 | .type = PORT_16550A, \ | 62 | .type = PORT_16550A, \ |
63 | .pm = alchemy_8250_pm, \ | ||
36 | } | 64 | } |
37 | 65 | ||
38 | static struct plat_serial8250_port au1x00_uart_data[] = { | 66 | static struct plat_serial8250_port au1x00_uart_data[] = { |
diff --git a/arch/mips/alchemy/common/power.c b/arch/mips/alchemy/common/power.c index 5ef06a164a82..e5916a516e58 100644 --- a/arch/mips/alchemy/common/power.c +++ b/arch/mips/alchemy/common/power.c | |||
@@ -49,11 +49,6 @@ | |||
49 | * We only have to save/restore registers that aren't otherwise | 49 | * We only have to save/restore registers that aren't otherwise |
50 | * done as part of a driver pm_* function. | 50 | * done as part of a driver pm_* function. |
51 | */ | 51 | */ |
52 | static unsigned int sleep_uart0_inten; | ||
53 | static unsigned int sleep_uart0_fifoctl; | ||
54 | static unsigned int sleep_uart0_linectl; | ||
55 | static unsigned int sleep_uart0_clkdiv; | ||
56 | static unsigned int sleep_uart0_enable; | ||
57 | static unsigned int sleep_usb[2]; | 52 | static unsigned int sleep_usb[2]; |
58 | static unsigned int sleep_sys_clocks[5]; | 53 | static unsigned int sleep_sys_clocks[5]; |
59 | static unsigned int sleep_sys_pinfunc; | 54 | static unsigned int sleep_sys_pinfunc; |
@@ -62,22 +57,6 @@ static unsigned int sleep_static_memctlr[4][3]; | |||
62 | 57 | ||
63 | static void save_core_regs(void) | 58 | static void save_core_regs(void) |
64 | { | 59 | { |
65 | extern void save_au1xxx_intctl(void); | ||
66 | extern void pm_eth0_shutdown(void); | ||
67 | |||
68 | /* | ||
69 | * Do the serial ports.....these really should be a pm_* | ||
70 | * registered function by the driver......but of course the | ||
71 | * standard serial driver doesn't understand our Au1xxx | ||
72 | * unique registers. | ||
73 | */ | ||
74 | sleep_uart0_inten = au_readl(UART0_ADDR + UART_IER); | ||
75 | sleep_uart0_fifoctl = au_readl(UART0_ADDR + UART_FCR); | ||
76 | sleep_uart0_linectl = au_readl(UART0_ADDR + UART_LCR); | ||
77 | sleep_uart0_clkdiv = au_readl(UART0_ADDR + UART_CLK); | ||
78 | sleep_uart0_enable = au_readl(UART0_ADDR + UART_MOD_CNTRL); | ||
79 | au_sync(); | ||
80 | |||
81 | #ifndef CONFIG_SOC_AU1200 | 60 | #ifndef CONFIG_SOC_AU1200 |
82 | /* Shutdown USB host/device. */ | 61 | /* Shutdown USB host/device. */ |
83 | sleep_usb[0] = au_readl(USB_HOST_CONFIG); | 62 | sleep_usb[0] = au_readl(USB_HOST_CONFIG); |
@@ -175,20 +154,6 @@ static void restore_core_regs(void) | |||
175 | au_writel(sleep_static_memctlr[3][0], MEM_STCFG3); | 154 | au_writel(sleep_static_memctlr[3][0], MEM_STCFG3); |
176 | au_writel(sleep_static_memctlr[3][1], MEM_STTIME3); | 155 | au_writel(sleep_static_memctlr[3][1], MEM_STTIME3); |
177 | au_writel(sleep_static_memctlr[3][2], MEM_STADDR3); | 156 | au_writel(sleep_static_memctlr[3][2], MEM_STADDR3); |
178 | |||
179 | /* | ||
180 | * Enable the UART if it was enabled before sleep. | ||
181 | * I guess I should define module control bits........ | ||
182 | */ | ||
183 | if (sleep_uart0_enable & 0x02) { | ||
184 | au_writel(0, UART0_ADDR + UART_MOD_CNTRL); au_sync(); | ||
185 | au_writel(1, UART0_ADDR + UART_MOD_CNTRL); au_sync(); | ||
186 | au_writel(3, UART0_ADDR + UART_MOD_CNTRL); au_sync(); | ||
187 | au_writel(sleep_uart0_inten, UART0_ADDR + UART_IER); au_sync(); | ||
188 | au_writel(sleep_uart0_fifoctl, UART0_ADDR + UART_FCR); au_sync(); | ||
189 | au_writel(sleep_uart0_linectl, UART0_ADDR + UART_LCR); au_sync(); | ||
190 | au_writel(sleep_uart0_clkdiv, UART0_ADDR + UART_CLK); au_sync(); | ||
191 | } | ||
192 | } | 157 | } |
193 | 158 | ||
194 | void au_sleep(void) | 159 | void au_sleep(void) |