aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-11-30 13:31:29 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2009-12-02 12:17:16 +0100
commit4c8b581dd28588940a328632e406baab574e0ce5 (patch)
treeafddb5d79c1d360b15c3b0782d484b06ce66d28b
parent9e3e7afe9bd73cc3fe0d742ba3391e864e234923 (diff)
i.MX27 audmux: Fix register offsets
We have two holes in the register space. The driver did not handle this. Fix it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/plat-mxc/audmux-v1.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/plat-mxc/audmux-v1.c b/arch/arm/plat-mxc/audmux-v1.c
index 70ab5aff2b9..da6387dcdf2 100644
--- a/arch/arm/plat-mxc/audmux-v1.c
+++ b/arch/arm/plat-mxc/audmux-v1.c
@@ -28,7 +28,9 @@
static void __iomem *audmux_base;
-#define MXC_AUDMUX_V1_PCR(x) ((x) * 4)
+static unsigned char port_mapping[] = {
+ 0x0, 0x4, 0x8, 0x10, 0x14, 0x1c,
+};
int mxc_audmux_v1_configure_port(unsigned int port, unsigned int pcr)
{
@@ -37,7 +39,10 @@ int mxc_audmux_v1_configure_port(unsigned int port, unsigned int pcr)
return -ENOSYS;
}
- writel(pcr, audmux_base + MXC_AUDMUX_V1_PCR(port));
+ if (port >= ARRAY_SIZE(port_mapping))
+ return -EINVAL;
+
+ writel(pcr, audmux_base + port_mapping[port]);
return 0;
}