aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/alchemy/common/platform.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-11-02 09:58:49 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-11-02 09:58:49 -0400
commit9e3be1edbe5ca57df51140b523168237b3a01f4d (patch)
treea72c0ec1ce0fbcdcd12ecb6aad9bedcc94b94f9d /arch/mips/alchemy/common/platform.c
parentASoC: Fix SND_SOC_ALL_CODECS typo for alc5623 (diff)
parentMerge commit 'v2.6.37-rc1' into for-2.6.37 (diff)
downloadlinux-dev-9e3be1edbe5ca57df51140b523168237b3a01f4d.tar.xz
linux-dev-9e3be1edbe5ca57df51140b523168237b3a01f4d.zip
Merge branch 'for-2.6.37' into HEAD
WARN() fix from Joe moved. Conflicts: sound/soc/codecs/wm_hubs.c
Diffstat (limited to 'arch/mips/alchemy/common/platform.c')
-rw-r--r--arch/mips/alchemy/common/platform.c28
1 files changed, 28 insertions, 0 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 @@
#include <prom.h>
+static void alchemy_8250_pm(struct uart_port *port, unsigned int state,
+ unsigned int old_state)
+{
+ switch (state) {
+ case 0:
+ if ((__raw_readl(port->membase + UART_MOD_CNTRL) & 3) != 3) {
+ /* power-on sequence as suggested in the databooks */
+ __raw_writel(0, port->membase + UART_MOD_CNTRL);
+ wmb();
+ __raw_writel(1, port->membase + UART_MOD_CNTRL);
+ wmb();
+ }
+ __raw_writel(3, port->membase + UART_MOD_CNTRL); /* full on */
+ wmb();
+ serial8250_do_pm(port, state, old_state);
+ break;
+ case 3: /* power off */
+ serial8250_do_pm(port, state, old_state);
+ __raw_writel(0, port->membase + UART_MOD_CNTRL);
+ wmb();
+ break;
+ default:
+ serial8250_do_pm(port, state, old_state);
+ break;
+ }
+}
+
#define PORT(_base, _irq) \
{ \
.mapbase = _base, \
@@ -33,6 +60,7 @@
.flags = UPF_SKIP_TEST | UPF_IOREMAP | \
UPF_FIXED_TYPE, \
.type = PORT_16550A, \
+ .pm = alchemy_8250_pm, \
}
static struct plat_serial8250_port au1x00_uart_data[] = {