From: s.hauer@pengutronix.de (Sascha Hauer) Date: Mon, 30 Nov 2009 13:31:29 +0100 Subject: [PATCH] i.MX27 audmux: Fix register offsets Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org We have two holes in the register space. The driver did not handle this. Fix it. Signed-off-by: Sascha Hauer --- arch/arm/plat-mxc/audmux-v1.c | 9 +++++++-- 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 70ab5af..da6387d 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; } -- 1.6.5.2 -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | >From bogus@does.not.exist.com Fri Nov 6 13:01:15 2009 From: bogus@does.not.exist.com () Date: Fri, 06 Nov 2009 18:01:15 -0000 Subject: No subject Message-ID: working as intended. The only explaination I have at present is that the CPU is buggy, and for whatever reason, it _is_ caching the values for a C=0 B=1 mapping. Maybe not a buggy L1 but a buggy L2 cache? No idea, I know nothing about Feroceon CPUs, so I'm afraid its up to others to investigate why they're having this problem. All I can say is that from the kernel point of view, the kernel is doing everything it should. >From bogus@does.not.exist.com Fri Nov 6 13:01:15 2009 From: bogus@does.not.exist.com () Date: Fri, 06 Nov 2009 18:01:15 -0000 Subject: No subject Message-ID: working as intended. The only explaination I have at present is that the CPU is buggy, and for whatever reason, it _is_ caching the values for a C=3D0 B=3D1 mapping. Maybe not a buggy L1 but a buggy L2 cache? No idea, I know nothing about Feroceon CPUs, so I'm afraid its up to others to investigate why they're having this problem. All I can say is that from the kernel point of view, the kernel is doing everything it should. >From bogus@does.not.exist.com Fri Nov 6 13:01:15 2009 From: bogus@does.not.exist.com () Date: Fri, 06 Nov 2009 18:01:15 -0000 Subject: No subject Message-ID:
From: Sascha Hauer <s.hauer at pengutronix.de>
Date: Mon, 30 Nov 2009 13:31:29 +0100
Subject: [PATCH] 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 at pengutronix.de>
---
=A0arch/arm/plat-mxc/audmux-v1.c | =A0 =A09 +++++++--
=A01 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-mxc/audmux-v1.c b/arch/arm/plat-mxc/audmux-v1.c<= br>
index 70ab5af..da6387d 100644
--- a/arch/arm/plat-mxc/audmux-v1.c
+++ b/arch/arm/plat-mxc/audmux-v1.c
@@ -28,7 +28,9 @@

=A0static void __iomem *audmux_base;

-#define MXC_AUDMUX_V1_PCR(x) =A0 ((x) * 4)
+static unsigned char port_mapping[] =3D {
+ =A0 =A0 =A0 0x0, 0x4, 0x8, 0x10, 0x14, 0x1c,
+};

=A0int mxc_audmux_v1_configure_port(unsigned int port, unsigned int pcr)
=A0{
@@ -37,7 +39,10 @@ int mxc_audmux_v1_configure_port(unsigned int port, unsi= gned int pcr)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -ENOSYS;
=A0 =A0 =A0 =A0}

- =A0 =A0 =A0 writel(pcr, audmux_base + MXC_AUDMUX_V1_PCR(port));
+ =A0 =A0 =A0 if (port >=3D ARRAY_SIZE(port_mapping))
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -EINVAL;
+
+ =A0 =A0 =A0 writel(pcr, audmux_base + port_mapping[port]);

=A0 =A0 =A0 =A0return 0;
=A0}
--
1.6.5.2

Yes,
it works now. Thank you for= your patience with this.

--
Javier Martin
Vist= a Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n=
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
--0016e6d9a0e87b335c0479be44de--