Skip to content

Commit

Permalink
i.MX27 audmux: Fix register offsets
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sascha Hauer committed Dec 2, 2009
1 parent 9e3e7af commit 4c8b581
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions arch/arm/plat-mxc/audmux-v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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;
}
Expand Down

0 comments on commit 4c8b581

Please sign in to comment.