All of lore.kernel.org
 help / color / mirror / Atom feed
* MXC patches for next merge window
@ 2009-11-12 10:41 Sascha Hauer
  2009-11-12 10:41 ` [PATCH 1/9] MXC NFC: Add the clock resource to support NFC in i.MX35 Sascha Hauer
  2009-11-18  9:49 ` MXC patches for next merge window Sascha Hauer
  0 siblings, 2 replies; 30+ messages in thread
From: Sascha Hauer @ 2009-11-12 10:41 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Here are some patches for the next merge window to review which aim at sound
and add Nand support for the pcm043 board.

Sascha

The following changes since commit 52d797c8c0b53e3940427ff0c43ef4356f1d668e:
  Uwe Kleine-K?nig (1):
        imx/gpio: Use handle_level_irq

are available in the git repository at:

  git://git.pengutronix.de/git/imx/linux-2.6.git mxc-master-pu

Juergen Beisert (2):
      MXC NFC: Add the clock resource to support NFC in i.MX35
      MXC NFC: Fix NFCs address area on i.MX35

Sascha Hauer (7):
      pca100: Add board to uncompress.h
      pca100: use correct irq initialisation function
      pcm043: Add NAND support
      i.MX2: Add sound (ssi) resources
      i.MX3: Add sound (ssi) resources
      MXC: Add a digital audio multiplexer (DAM) driver
      i.MX35: Fix audmux clock

 arch/arm/mach-mx2/Kconfig                   |    2 +
 arch/arm/mach-mx2/clock_imx27.c             |    4 +-
 arch/arm/mach-mx2/devices.c                 |   78 +++++++++++++++++++++++++++
 arch/arm/mach-mx2/devices.h                 |    3 +-
 arch/arm/mach-mx2/pca100.c                  |    2 +-
 arch/arm/mach-mx3/Kconfig                   |    2 +
 arch/arm/mach-mx3/clock-imx35.c             |   41 ++++++++++++--
 arch/arm/mach-mx3/devices.c                 |   44 +++++++++++++++-
 arch/arm/mach-mx3/devices.h                 |    2 +
 arch/arm/mach-mx3/pcm043.c                  |    7 +++
 arch/arm/plat-mxc/Kconfig                   |    7 +++
 arch/arm/plat-mxc/Makefile                  |    2 +
 arch/arm/plat-mxc/dam-v1.c                  |   33 +++++++++++
 arch/arm/plat-mxc/dam-v2.c                  |   56 +++++++++++++++++++
 arch/arm/plat-mxc/include/mach/dam.h        |   45 +++++++++++++++
 arch/arm/plat-mxc/include/mach/uncompress.h |    1 +
 16 files changed, 318 insertions(+), 11 deletions(-)
 create mode 100644 arch/arm/plat-mxc/dam-v1.c
 create mode 100644 arch/arm/plat-mxc/dam-v2.c
 create mode 100644 arch/arm/plat-mxc/include/mach/dam.h

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 1/9] MXC NFC: Add the clock resource to support NFC in i.MX35
  2009-11-12 10:41 MXC patches for next merge window Sascha Hauer
@ 2009-11-12 10:41 ` Sascha Hauer
  2009-11-12 10:41   ` [PATCH 2/9] MXC NFC: Fix NFCs address area on i.MX35 Sascha Hauer
  2009-11-18  9:49 ` MXC patches for next merge window Sascha Hauer
  1 sibling, 1 reply; 30+ messages in thread
From: Sascha Hauer @ 2009-11-12 10:41 UTC (permalink / raw)
  To: linux-arm-kernel

From: Juergen Beisert <jbe@pengutronix.de>

Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-mx3/clock-imx35.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c
index fe5c421..63be4a7 100644
--- a/arch/arm/mach-mx3/clock-imx35.c
+++ b/arch/arm/mach-mx3/clock-imx35.c
@@ -387,6 +387,35 @@ DEFINE_CLOCK(csi_clk,    0, CCM_CGR3,  0, get_rate_csi, NULL);
 DEFINE_CLOCK(iim_clk,    0, CCM_CGR3,  2, NULL, NULL);
 DEFINE_CLOCK(gpu2d_clk,  0, CCM_CGR3,  4, NULL, NULL);
 
+static int clk_dummy_enable(struct clk *clk)
+{
+	return 0;
+}
+
+static void clk_dummy_disable(struct clk *clk)
+{
+}
+
+static unsigned long get_rate_nfc(struct clk *clk)
+{
+	unsigned long div1;
+
+	div1 = (__raw_readl(CCM_BASE + CCM_PDR4) >> 28) + 1;
+
+	return get_rate_ahb(NULL) / div1;
+}
+
+/* NAND Controller: It seems it can't be disabled */
+static struct clk nfc_clk = {
+	.id		= 0,
+	.enable_reg	= 0,
+	.enable_shift	= 0,
+	.get_rate	= get_rate_nfc,
+	.set_rate	= NULL, /* set_rate_nfc, */
+	.enable		= clk_dummy_enable,
+	.disable	= clk_dummy_disable
+};
+
 #define _REGISTER_CLOCK(d, n, c)	\
 	{				\
 		.dev_id = d,		\
@@ -449,6 +478,7 @@ static struct clk_lookup lookups[] = {
 	_REGISTER_CLOCK(NULL, "csi", csi_clk)
 	_REGISTER_CLOCK(NULL, "iim", iim_clk)
 	_REGISTER_CLOCK(NULL, "gpu2d", gpu2d_clk)
+	_REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk)
 };
 
 int __init mx35_clocks_init()
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 2/9] MXC NFC: Fix NFCs address area on i.MX35
  2009-11-12 10:41 ` [PATCH 1/9] MXC NFC: Add the clock resource to support NFC in i.MX35 Sascha Hauer
@ 2009-11-12 10:41   ` Sascha Hauer
  2009-11-12 10:41     ` [PATCH 3/9] pca100: Add board to uncompress.h Sascha Hauer
  2009-11-12 20:04     ` [PATCH 2/9] MXC NFC: Fix NFCs address area on i.MX35 Magnus Lilja
  0 siblings, 2 replies; 30+ messages in thread
From: Sascha Hauer @ 2009-11-12 10:41 UTC (permalink / raw)
  To: linux-arm-kernel

From: Juergen Beisert <jbe@pengutronix.de>

The address area of the NFS in the i.MX35 silicon is much larger than 4k.

Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-mx3/devices.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index 8a577f3..f007f22 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -546,7 +546,7 @@ static int mx3_devices_init(void)
 	}
 	if (cpu_is_mx35()) {
 		mxc_nand_resources[0].start = MX35_NFC_BASE_ADDR;
-		mxc_nand_resources[0].end = MX35_NFC_BASE_ADDR + 0xfff;
+		mxc_nand_resources[0].end = MX35_NFC_BASE_ADDR + 0x1fff;
 		otg_resources[0].start = MX35_OTG_BASE_ADDR;
 		otg_resources[0].end = MX35_OTG_BASE_ADDR + 0x1ff;
 		otg_resources[1].start = MXC_INT_USBOTG;
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 3/9] pca100: Add board to uncompress.h
  2009-11-12 10:41   ` [PATCH 2/9] MXC NFC: Fix NFCs address area on i.MX35 Sascha Hauer
@ 2009-11-12 10:41     ` Sascha Hauer
  2009-11-12 10:42       ` [PATCH 4/9] pca100: use correct irq initialisation function Sascha Hauer
  2009-11-12 20:04     ` [PATCH 2/9] MXC NFC: Fix NFCs address area on i.MX35 Magnus Lilja
  1 sibling, 1 reply; 30+ messages in thread
From: Sascha Hauer @ 2009-11-12 10:41 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/plat-mxc/include/mach/uncompress.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-mxc/include/mach/uncompress.h b/arch/arm/plat-mxc/include/mach/uncompress.h
index 0e12876..a41bf57 100644
--- a/arch/arm/plat-mxc/include/mach/uncompress.h
+++ b/arch/arm/plat-mxc/include/mach/uncompress.h
@@ -83,6 +83,7 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
 	case MACH_TYPE_MX27ADS:
 	case MACH_TYPE_PCM038:
 	case MACH_TYPE_MX21ADS:
+	case MACH_TYPE_PCA100:
 		uart_base = MX2X_UART1_BASE_ADDR;
 		break;
 	case MACH_TYPE_MX31LITE:
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 4/9] pca100: use correct irq initialisation function
  2009-11-12 10:41     ` [PATCH 3/9] pca100: Add board to uncompress.h Sascha Hauer
@ 2009-11-12 10:42       ` Sascha Hauer
  2009-11-12 10:42         ` [PATCH 5/9] pcm043: Add NAND support Sascha Hauer
  0 siblings, 1 reply; 30+ messages in thread
From: Sascha Hauer @ 2009-11-12 10:42 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-mx2/pca100.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-mx2/pca100.c b/arch/arm/mach-mx2/pca100.c
index fe5b165..aea3d34 100644
--- a/arch/arm/mach-mx2/pca100.c
+++ b/arch/arm/mach-mx2/pca100.c
@@ -237,7 +237,7 @@ MACHINE_START(PCA100, "phyCARD-i.MX27")
 	.io_pg_offst    = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
 	.boot_params    = PHYS_OFFSET + 0x100,
 	.map_io         = mx27_map_io,
-	.init_irq       = mxc_init_irq,
+	.init_irq       = mx27_init_irq,
 	.init_machine   = pca100_init,
 	.timer          = &pca100_timer,
 MACHINE_END
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 5/9] pcm043: Add NAND support
  2009-11-12 10:42       ` [PATCH 4/9] pca100: use correct irq initialisation function Sascha Hauer
@ 2009-11-12 10:42         ` Sascha Hauer
  2009-11-12 10:42           ` [PATCH 6/9] i.MX2: Add sound (ssi) resources Sascha Hauer
  2009-11-12 12:43           ` [PATCH 5/9] pcm043: Add NAND support Fabio Estevam
  0 siblings, 2 replies; 30+ messages in thread
From: Sascha Hauer @ 2009-11-12 10:42 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-mx3/pcm043.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-mx3/pcm043.c b/arch/arm/mach-mx3/pcm043.c
index e18a224..e3aa829 100644
--- a/arch/arm/mach-mx3/pcm043.c
+++ b/arch/arm/mach-mx3/pcm043.c
@@ -43,6 +43,7 @@
 #include <mach/iomux-mx35.h>
 #include <mach/ipu.h>
 #include <mach/mx3fb.h>
+#include <mach/mxc_nand.h>
 
 #include "devices.h"
 
@@ -206,6 +207,11 @@ static struct pad_desc pcm043_pads[] = {
 	MX35_PAD_ATA_CS0__GPIO2_6,
 };
 
+static struct mxc_nand_platform_data pcm037_nand_board_info = {
+	.width = 1,
+	.hw_ecc = 1,
+};
+
 /*
  * Board specific initialization.
  */
@@ -216,6 +222,7 @@ static void __init mxc_board_init(void)
 	platform_add_devices(devices, ARRAY_SIZE(devices));
 
 	mxc_register_device(&mxc_uart_device0, &uart_pdata);
+	mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info);
 
 	mxc_register_device(&mxc_uart_device1, &uart_pdata);
 
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 6/9] i.MX2: Add sound (ssi) resources
  2009-11-12 10:42         ` [PATCH 5/9] pcm043: Add NAND support Sascha Hauer
@ 2009-11-12 10:42           ` Sascha Hauer
  2009-11-12 10:42             ` [PATCH 7/9] i.MX3: " Sascha Hauer
  2009-11-12 12:43           ` [PATCH 5/9] pcm043: Add NAND support Fabio Estevam
  1 sibling, 1 reply; 30+ messages in thread
From: Sascha Hauer @ 2009-11-12 10:42 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-mx2/clock_imx27.c |    4 +-
 arch/arm/mach-mx2/devices.c     |   78 +++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-mx2/devices.h     |    3 +-
 3 files changed, 82 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-mx2/clock_imx27.c b/arch/arm/mach-mx2/clock_imx27.c
index 4089951..dec1bbc 100644
--- a/arch/arm/mach-mx2/clock_imx27.c
+++ b/arch/arm/mach-mx2/clock_imx27.c
@@ -651,8 +651,8 @@ static struct clk_lookup lookups[] = {
 	_REGISTER_CLOCK("mxc-ehci.1", "usb_ahb", usb_clk1)
 	_REGISTER_CLOCK("mxc-ehci.2", "usb", usb_clk)
 	_REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_clk1)
-	_REGISTER_CLOCK(NULL, "ssi1", ssi1_clk)
-	_REGISTER_CLOCK(NULL, "ssi2", ssi2_clk)
+	_REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
+	_REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
 	_REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk)
 	_REGISTER_CLOCK(NULL, "vpu", vpu_clk)
 	_REGISTER_CLOCK(NULL, "dma", dma_clk)
diff --git a/arch/arm/mach-mx2/devices.c b/arch/arm/mach-mx2/devices.c
index 50199af..3d398ce 100644
--- a/arch/arm/mach-mx2/devices.c
+++ b/arch/arm/mach-mx2/devices.c
@@ -530,6 +530,84 @@ struct platform_device mxc_usbh2 = {
 };
 #endif
 
+static struct resource imx_ssi_resources0[] = {
+	{
+		.start	= SSI1_BASE_ADDR,
+		.end	= SSI1_BASE_ADDR + 0x6F,
+		.flags	= IORESOURCE_MEM,
+	}, {
+		.start	= MXC_INT_SSI1,
+		.end	= MXC_INT_SSI1,
+		.flags	= IORESOURCE_IRQ,
+	}, {
+		.name	= "tx0",
+		.start	= DMA_REQ_SSI1_TX0,
+		.end	= DMA_REQ_SSI1_TX0,
+		.flags	= IORESOURCE_DMA,
+	}, {
+		.name	= "rx0",
+		.start	= DMA_REQ_SSI1_RX0,
+		.end	= DMA_REQ_SSI1_RX0,
+		.flags	= IORESOURCE_DMA,
+	}, {
+		.name	= "tx1",
+		.start	= DMA_REQ_SSI1_TX1,
+		.end	= DMA_REQ_SSI1_TX1,
+		.flags	= IORESOURCE_DMA,
+	}, {
+		.name	= "rx1",
+		.start	= DMA_REQ_SSI1_RX1,
+		.end	= DMA_REQ_SSI1_RX1,
+		.flags	= IORESOURCE_DMA,
+	},
+};
+
+static struct resource imx_ssi_resources1[] = {
+	{
+		.start	= SSI2_BASE_ADDR,
+		.end	= SSI2_BASE_ADDR + 0x6F,
+		.flags	= IORESOURCE_MEM,
+	}, {
+		.start	= MXC_INT_SSI2,
+		.end	= MXC_INT_SSI2,
+		.flags	= IORESOURCE_IRQ,
+	}, {
+		.name	= "tx0",
+		.start	= DMA_REQ_SSI2_TX0,
+		.end	= DMA_REQ_SSI2_TX0,
+		.flags	= IORESOURCE_DMA,
+	}, {
+		.name	= "rx0",
+		.start	= DMA_REQ_SSI2_RX0,
+		.end	= DMA_REQ_SSI2_RX0,
+		.flags	= IORESOURCE_DMA,
+	}, {
+		.name	= "tx1",
+		.start	= DMA_REQ_SSI2_TX1,
+		.end	= DMA_REQ_SSI2_TX1,
+		.flags	= IORESOURCE_DMA,
+	}, {
+		.name	= "rx1",
+		.start	= DMA_REQ_SSI2_RX1,
+		.end	= DMA_REQ_SSI2_RX1,
+		.flags	= IORESOURCE_DMA,
+	},
+};
+
+struct platform_device imx_ssi_device0 = {
+	.name = "imx-ssi",
+	.id = 0,
+	.num_resources = ARRAY_SIZE(imx_ssi_resources0),
+	.resource = imx_ssi_resources0,
+};
+
+struct platform_device imx_ssi_device1 = {
+	.name = "imx-ssi",
+	.id = 1,
+	.num_resources = ARRAY_SIZE(imx_ssi_resources1),
+	.resource = imx_ssi_resources1,
+};
+
 /* GPIO port description */
 static struct mxc_gpio_port imx_gpio_ports[] = {
 	{
diff --git a/arch/arm/mach-mx2/devices.h b/arch/arm/mach-mx2/devices.h
index d315406..97306aa 100644
--- a/arch/arm/mach-mx2/devices.h
+++ b/arch/arm/mach-mx2/devices.h
@@ -26,4 +26,5 @@ extern struct platform_device mxc_usbh2;
 extern struct platform_device mxc_spi_device0;
 extern struct platform_device mxc_spi_device1;
 extern struct platform_device mxc_spi_device2;
-
+extern struct platform_device imx_ssi_device0;
+extern struct platform_device imx_ssi_device1;
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 7/9] i.MX3: Add sound (ssi) resources
  2009-11-12 10:42           ` [PATCH 6/9] i.MX2: Add sound (ssi) resources Sascha Hauer
@ 2009-11-12 10:42             ` Sascha Hauer
  2009-11-12 10:42               ` [PATCH 8/9] MXC: Add a digital audio multiplexer (DAM) driver Sascha Hauer
  0 siblings, 1 reply; 30+ messages in thread
From: Sascha Hauer @ 2009-11-12 10:42 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-mx3/clock-imx35.c |    4 +-
 arch/arm/mach-mx3/devices.c     |   42 +++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-mx3/devices.h     |    2 +
 3 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c
index 63be4a7..5068e1d 100644
--- a/arch/arm/mach-mx3/clock-imx35.c
+++ b/arch/arm/mach-mx3/clock-imx35.c
@@ -463,8 +463,8 @@ static struct clk_lookup lookups[] = {
 	_REGISTER_CLOCK(NULL, "sdma", sdma_clk)
 	_REGISTER_CLOCK(NULL, "spba", spba_clk)
 	_REGISTER_CLOCK(NULL, "spdif", spdif_clk)
-	_REGISTER_CLOCK(NULL, "ssi", ssi1_clk)
-	_REGISTER_CLOCK(NULL, "ssi", ssi2_clk)
+	_REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
+	_REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
 	_REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk)
 	_REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk)
 	_REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index f007f22..848b0a9 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -537,6 +537,44 @@ struct platform_device mxc_fec_device = {
 };
 #endif
 
+static struct resource imx_ssi_resources0[] = {
+	{
+		.start	= SSI1_BASE_ADDR,
+		.end	= SSI1_BASE_ADDR + 0xfff,
+		.flags	= IORESOURCE_MEM,
+	}, {
+		.start	= MX31_INT_SSI1,
+		.end	= MX31_INT_SSI1,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct resource imx_ssi_resources1[] = {
+	{
+		.start	= SSI2_BASE_ADDR,
+		.end	= SSI2_BASE_ADDR + 0xfff,
+		.flags	= IORESOURCE_MEM
+	}, {
+		.start	= MX31_INT_SSI2,
+		.end	= MX31_INT_SSI2,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+struct platform_device imx_ssi_device0 = {
+	.name = "imx-ssi",
+	.id = 0,
+	.num_resources = ARRAY_SIZE(imx_ssi_resources0),
+	.resource = imx_ssi_resources0,
+};
+
+struct platform_device imx_ssi_device1 = {
+	.name = "imx-ssi",
+	.id = 1,
+	.num_resources = ARRAY_SIZE(imx_ssi_resources1),
+	.resource = imx_ssi_resources1,
+};
+
 static int mx3_devices_init(void)
 {
 	if (cpu_is_mx31()) {
@@ -555,6 +593,10 @@ static int mx3_devices_init(void)
 		mxc_usbh1_resources[0].end = MX35_OTG_BASE_ADDR + 0x5ff;
 		mxc_usbh1_resources[1].start = MXC_INT_USBHS;
 		mxc_usbh1_resources[1].end = MXC_INT_USBHS;
+		imx_ssi_resources0[1].start = MX35_INT_SSI1;
+		imx_ssi_resources0[1].end = MX35_INT_SSI1;
+		imx_ssi_resources1[1].start = MX35_INT_SSI2;
+		imx_ssi_resources1[1].end = MX35_INT_SSI2;
 	}
 
 	return 0;
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h
index 79f2be4..b31c887 100644
--- a/arch/arm/mach-mx3/devices.h
+++ b/arch/arm/mach-mx3/devices.h
@@ -23,4 +23,6 @@ extern struct platform_device mxc_rnga_device;
 extern struct platform_device imx_spi_device0;
 extern struct platform_device imx_spi_device1;
 extern struct platform_device imx_spi_device2;
+extern struct platform_device imx_ssi_device0;
+extern struct platform_device imx_ssi_device1;
 
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 8/9] MXC: Add a digital audio multiplexer (DAM) driver
  2009-11-12 10:42             ` [PATCH 7/9] i.MX3: " Sascha Hauer
@ 2009-11-12 10:42               ` Sascha Hauer
  2009-11-12 10:42                 ` [PATCH 9/9] i.MX35: Fix audmux clock Sascha Hauer
                                   ` (2 more replies)
  0 siblings, 3 replies; 30+ messages in thread
From: Sascha Hauer @ 2009-11-12 10:42 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-mx2/Kconfig            |    2 +
 arch/arm/mach-mx3/Kconfig            |    2 +
 arch/arm/plat-mxc/Kconfig            |    7 ++++
 arch/arm/plat-mxc/Makefile           |    2 +
 arch/arm/plat-mxc/dam-v1.c           |   33 ++++++++++++++++++++
 arch/arm/plat-mxc/dam-v2.c           |   56 ++++++++++++++++++++++++++++++++++
 arch/arm/plat-mxc/include/mach/dam.h |   45 +++++++++++++++++++++++++++
 7 files changed, 147 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-mxc/dam-v1.c
 create mode 100644 arch/arm/plat-mxc/dam-v2.c
 create mode 100644 arch/arm/plat-mxc/include/mach/dam.h

diff --git a/arch/arm/mach-mx2/Kconfig b/arch/arm/mach-mx2/Kconfig
index c8a2eac..43f07b9 100644
--- a/arch/arm/mach-mx2/Kconfig
+++ b/arch/arm/mach-mx2/Kconfig
@@ -6,11 +6,13 @@ choice
 
 config MACH_MX21
 	bool "i.MX21 support"
+	select ARCH_MXC_DAM_V1
 	help
 	  This enables support for Freescale's MX2 based i.MX21 processor.
 
 config MACH_MX27
 	bool "i.MX27 support"
+	select ARCH_MXC_DAM_V1
 	help
 	  This enables support for Freescale's MX2 based i.MX27 processor.
 
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index 851f245..7b9fcbb 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -2,11 +2,13 @@ if ARCH_MX3
 
 config ARCH_MX31
 	select ARCH_HAS_RNGA
+	select ARCH_MXC_DAM_V2
 	bool
 
 config ARCH_MX35
 	bool
 	select ARCH_MXC_IOMUX_V3
+	select ARCH_MXC_DAM_V2
 
 comment "MX3 platforms:"
 
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index e8e92cb..eb3f847 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -78,4 +78,11 @@ config ARCH_HAS_RNGA
 
 config ARCH_MXC_IOMUX_V3
 	bool
+
+config ARCH_MXC_DAM_V1
+	bool
+
+config ARCH_MXC_DAM_V2
+	bool
+
 endif
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile
index 545412f..e0f987f 100644
--- a/arch/arm/plat-mxc/Makefile
+++ b/arch/arm/plat-mxc/Makefile
@@ -10,3 +10,5 @@ obj-$(CONFIG_ARCH_MX2) += iomux-mx1-mx2.o dma-mx1-mx2.o
 obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o
 obj-$(CONFIG_MXC_PWM)  += pwm.o
 obj-$(CONFIG_MXC_ULPI) += ulpi.o
+obj-$(CONFIG_ARCH_MXC_DAM_V1) += dam-v1.o
+obj-$(CONFIG_ARCH_MXC_DAM_V2) += dam-v2.o
diff --git a/arch/arm/plat-mxc/dam-v1.c b/arch/arm/plat-mxc/dam-v1.c
new file mode 100644
index 0000000..0733361
--- /dev/null
+++ b/arch/arm/plat-mxc/dam-v1.c
@@ -0,0 +1,33 @@
+
+#include <linux/module.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/clk.h>
+#include <mach/dam.h>
+#include <mach/hardware.h>
+
+static void __iomem *dam_base;
+
+#define MXC_DAM_V1_PCR(x)	((x) * 4)
+
+int mxc_dam_v1_configure_port(unsigned int port, unsigned int pcr)
+{
+	if (!dam_base) {
+		printk("%s: not configured\n", __func__);
+		return -ENOSYS;
+	}
+
+	writel(pcr, dam_base + MXC_DAM_V1_PCR(port));
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(mxc_dam_v1_configure_port);
+
+static int mxc_dam_v1_init(void)
+{
+	if (cpu_is_mx27() || cpu_is_mx21())
+		dam_base = IO_ADDRESS(AUDMUX_BASE_ADDR);
+	return 0;
+}
+
+postcore_initcall(mxc_dam_v1_init);
diff --git a/arch/arm/plat-mxc/dam-v2.c b/arch/arm/plat-mxc/dam-v2.c
new file mode 100644
index 0000000..a9c8d10
--- /dev/null
+++ b/arch/arm/plat-mxc/dam-v2.c
@@ -0,0 +1,56 @@
+#include <linux/module.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/clk.h>
+#include <mach/dam.h>
+#include <mach/hardware.h>
+
+static struct clk *dam_clk;
+static void __iomem *dam_base;
+
+#define MXC_DAM_V2_PTCR(x)		((x) * 8)
+#define MXC_DAM_V2_PDCR(x)		((x) * 8 + 4)
+
+int mxc_dam_v2_configure_port(unsigned int port, unsigned int ptcr,
+		unsigned int pdcr)
+{
+	if (!dam_base)
+		return -ENOSYS;
+
+	if (dam_clk)
+		clk_enable(dam_clk);
+
+	writel(ptcr, dam_base + MXC_DAM_V2_PTCR(port));
+	writel(pdcr, dam_base + MXC_DAM_V2_PDCR(port));
+
+	if (dam_clk)
+		clk_disable(dam_clk);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(mxc_dam_v2_configure_port);
+
+static int mxc_dam_v2_init(void)
+{
+	int ret;
+
+	if (cpu_is_mx31() || cpu_is_mx35())
+		dam_base = IO_ADDRESS(AUDMUX_BASE_ADDR);
+	else
+		return 0;
+
+	if (cpu_is_mx35()) {
+		dam_clk = clk_get(NULL, "audmux");
+		if (IS_ERR(dam_clk)) {
+			dam_base = NULL;
+			ret = PTR_ERR(dam_clk);
+			printk(KERN_ERR "%s: cannot get clock: %d\n", __func__,
+					ret);
+			return ret;
+		}
+	}
+
+	return 0;
+}
+
+postcore_initcall(mxc_dam_v2_init);
diff --git a/arch/arm/plat-mxc/include/mach/dam.h b/arch/arm/plat-mxc/include/mach/dam.h
new file mode 100644
index 0000000..385b54a
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/dam.h
@@ -0,0 +1,45 @@
+#ifndef __MACH_DAM_H
+#define __MACH_DAM_H
+
+#define MX27_HPCR1_SSI0         0
+#define MX27_HPCR2_SSI1		1
+#define MX27_HPCR3_SSI_PINS_4	2
+#define MX27_PPCR1_SSI_PINS_1   3
+#define MX27_PPCR2_SSI_PINS_2   4
+#define MX27_PPCR3_SSI_PINS_3   5
+
+/* Register definitions for the i.MX21/27 Digital Audio Multiplexer */
+#define MXC_DAM_V1_PCR_INMMASK(x)	((x) & 0xff)
+#define MXC_DAM_V1_PCR_INMEN		(1 << 8)
+#define MXC_DAM_V1_PCR_TXRXEN		(1 << 10)
+#define MXC_DAM_V1_PCR_SYN		(1 << 12)
+#define MXC_DAM_V1_PCR_RXDSEL(x)	(((x) & 0x7) << 13)
+#define MXC_DAM_V1_PCR_RFCSEL(x)	(((x) & 0xf) << 20)
+#define MXC_DAM_V1_PCR_RCLKDIR		(1 << 24)
+#define MXC_DAM_V1_PCR_RFSDIR		(1 << 25)
+#define MXC_DAM_V1_PCR_TFCSEL(x)	(((x) & 0xf) << 26)
+#define MXC_DAM_V1_PCR_TCLKDIR		(1 << 30)
+#define MXC_DAM_V1_PCR_TFSDIR		(1 << 31)
+
+/* Register definitions for the i.MX25/31/35 Digital Audio Multiplexer */
+#define MXC_DAM_V2_PTCR_TFSDIR		(1 << 31)
+#define MXC_DAM_V2_PTCR_TFSEL(x)	(((x) & 0xf) << 27)
+#define MXC_DAM_V2_PTCR_TCLKDIR		(1 << 26)
+#define MXC_DAM_V2_PTCR_TCSEL(x)	(((x) & 0xf) << 22)
+#define MXC_DAM_V2_PTCR_RFSDIR		(1 << 21)
+#define MXC_DAM_V2_PTCR_RFSEL(x)	(((x) & 0xf) << 17)
+#define MXC_DAM_V2_PTCR_RCLKDIR		(1 << 16)
+#define MXC_DAM_V2_PTCR_RCSEL(x)	(((x) & 0xf) << 12)
+#define MXC_DAM_V2_PTCR_SYN		(1 << 11)
+
+#define MXC_DAM_V2_PDCR_RXDSEL(x)	(((x) & 0x7) << 13)
+#define MXC_DAM_V2_PDCR_TXRXEN		(1 << 12)
+#define MXC_DAM_V2_PDCR_MODE(x)		(((x) & 0x3) << 8)
+#define MXC_DAM_V2_PDCR_INMMASK(x)	((x) & 0xff)
+
+int mxc_dam_v1_configure_port(unsigned int port, unsigned int pcr);
+
+int mxc_dam_v2_configure_port(unsigned int port, unsigned int ptcr,
+		unsigned int pdcr);
+
+#endif
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 9/9] i.MX35: Fix audmux clock
  2009-11-12 10:42               ` [PATCH 8/9] MXC: Add a digital audio multiplexer (DAM) driver Sascha Hauer
@ 2009-11-12 10:42                 ` Sascha Hauer
  2009-11-12 12:47                 ` [PATCH 8/9] MXC: Add a digital audio multiplexer (DAM) driver Mark Brown
  2009-11-12 15:06                 ` [PATCH 8/9 v2] MXC: Add a digital audio multiplexer driver Sascha Hauer
  2 siblings, 0 replies; 30+ messages in thread
From: Sascha Hauer @ 2009-11-12 10:42 UTC (permalink / raw)
  To: linux-arm-kernel

The i.MX35 Datasheet claims that CCM_CGR0[4] is for the audio muxer,
but hardware tests showed that really CCM_CGR2[30] is for the audio
muxer (which is labelled as admux in the datasheet). Fix this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-mx3/clock-imx35.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c
index 5068e1d..1353f65 100644
--- a/arch/arm/mach-mx3/clock-imx35.c
+++ b/arch/arm/mach-mx3/clock-imx35.c
@@ -335,7 +335,7 @@ static void clk_cgr_disable(struct clk *clk)
 
 DEFINE_CLOCK(asrc_clk,   0, CCM_CGR0,  0, NULL, NULL);
 DEFINE_CLOCK(ata_clk,    0, CCM_CGR0,  2, get_rate_ipg, NULL);
-DEFINE_CLOCK(audmux_clk, 0, CCM_CGR0,  4, NULL, NULL);
+/* DEFINE_CLOCK(audmux_clk, 0, CCM_CGR0,  4, NULL, NULL); */
 DEFINE_CLOCK(can1_clk,   0, CCM_CGR0,  6, get_rate_ipg, NULL);
 DEFINE_CLOCK(can2_clk,   1, CCM_CGR0,  8, get_rate_ipg, NULL);
 DEFINE_CLOCK(cspi1_clk,  0, CCM_CGR0, 10, get_rate_ipg, NULL);
@@ -381,7 +381,7 @@ DEFINE_CLOCK(uart3_clk,  2, CCM_CGR2, 20, get_rate_uart, NULL);
 DEFINE_CLOCK(usbotg_clk, 0, CCM_CGR2, 22, get_rate_otg, NULL);
 DEFINE_CLOCK(wdog_clk,   0, CCM_CGR2, 24, NULL, NULL);
 DEFINE_CLOCK(max_clk,    0, CCM_CGR2, 26, NULL, NULL);
-DEFINE_CLOCK(admux_clk,  0, CCM_CGR2, 30, NULL, NULL);
+DEFINE_CLOCK(audmux_clk, 0, CCM_CGR2, 30, NULL, NULL);
 
 DEFINE_CLOCK(csi_clk,    0, CCM_CGR3,  0, get_rate_csi, NULL);
 DEFINE_CLOCK(iim_clk,    0, CCM_CGR3,  2, NULL, NULL);
@@ -426,7 +426,6 @@ static struct clk nfc_clk = {
 static struct clk_lookup lookups[] = {
 	_REGISTER_CLOCK(NULL, "asrc", asrc_clk)
 	_REGISTER_CLOCK(NULL, "ata", ata_clk)
-	_REGISTER_CLOCK(NULL, "audmux", audmux_clk)
 	_REGISTER_CLOCK(NULL, "can", can1_clk)
 	_REGISTER_CLOCK(NULL, "can", can2_clk)
 	_REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk)
@@ -474,7 +473,7 @@ static struct clk_lookup lookups[] = {
 	_REGISTER_CLOCK("fsl-usb2-udc", "usb", usbotg_clk)
 	_REGISTER_CLOCK("mxc_wdt.0", NULL, wdog_clk)
 	_REGISTER_CLOCK(NULL, "max", max_clk)
-	_REGISTER_CLOCK(NULL, "admux", admux_clk)
+	_REGISTER_CLOCK(NULL, "audmux", audmux_clk)
 	_REGISTER_CLOCK(NULL, "csi", csi_clk)
 	_REGISTER_CLOCK(NULL, "iim", iim_clk)
 	_REGISTER_CLOCK(NULL, "gpu2d", gpu2d_clk)
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 5/9] pcm043: Add NAND support
  2009-11-12 10:42         ` [PATCH 5/9] pcm043: Add NAND support Sascha Hauer
  2009-11-12 10:42           ` [PATCH 6/9] i.MX2: Add sound (ssi) resources Sascha Hauer
@ 2009-11-12 12:43           ` Fabio Estevam
  2009-11-12 13:06             ` Sascha Hauer
  1 sibling, 1 reply; 30+ messages in thread
From: Fabio Estevam @ 2009-11-12 12:43 UTC (permalink / raw)
  To: linux-arm-kernel

Sascha,

--- On Thu, 11/12/09, Sascha Hauer <s.hauer@pengutronix.de> wrote:

> From: Sascha Hauer <s.hauer@pengutronix.de>
> Subject: [PATCH 5/9] pcm043: Add NAND support
> To: linux-arm-kernel at lists.infradead.org
> Cc: "Sascha Hauer" <s.hauer@pengutronix.de>
> Date: Thursday, November 12, 2009, 8:42 AM
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  arch/arm/mach-mx3/pcm043.c |? ? 7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-mx3/pcm043.c
> b/arch/arm/mach-mx3/pcm043.c
> index e18a224..e3aa829 100644
> --- a/arch/arm/mach-mx3/pcm043.c
> +++ b/arch/arm/mach-mx3/pcm043.c
> @@ -43,6 +43,7 @@
>  #include <mach/iomux-mx35.h>
>  #include <mach/ipu.h>
>  #include <mach/mx3fb.h>
> +#include <mach/mxc_nand.h>
>  
>  #include "devices.h"
>  
> @@ -206,6 +207,11 @@ static struct pad_desc pcm043_pads[] =
> {
>  ??? MX35_PAD_ATA_CS0__GPIO2_6,
>  };
>  
> +static struct mxc_nand_platform_data
> pcm037_nand_board_info = {
> +??? .width = 1,
> +??? .hw_ecc = 1,
> +};
> +
>  /*
> ? * Board specific initialization.
> ? */
> @@ -216,6 +222,7 @@ static void __init
> mxc_board_init(void)
>  ??? platform_add_devices(devices,
> ARRAY_SIZE(devices));
>  
>  ???
> mxc_register_device(&mxc_uart_device0,
> &uart_pdata);
> +???
> mxc_register_device(&mxc_nand_device,
> &pcm037_nand_board_info);
>  
>  ???
> mxc_register_device(&mxc_uart_device1,
> &uart_pdata);
>  
> -- 
> 1.6.5.2

Have you managed to load a root file system via JFFS2 on this board?

Thanks,

Fabio Estevam


      

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 8/9] MXC: Add a digital audio multiplexer (DAM) driver
  2009-11-12 10:42               ` [PATCH 8/9] MXC: Add a digital audio multiplexer (DAM) driver Sascha Hauer
  2009-11-12 10:42                 ` [PATCH 9/9] i.MX35: Fix audmux clock Sascha Hauer
@ 2009-11-12 12:47                 ` Mark Brown
  2009-11-12 13:04                   ` Sascha Hauer
  2009-11-12 15:06                 ` [PATCH 8/9 v2] MXC: Add a digital audio multiplexer driver Sascha Hauer
  2 siblings, 1 reply; 30+ messages in thread
From: Mark Brown @ 2009-11-12 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 12, 2009 at 11:42:04AM +0100, Sascha Hauer wrote:
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  arch/arm/mach-mx2/Kconfig            |    2 +
>  arch/arm/mach-mx3/Kconfig            |    2 +
>  arch/arm/plat-mxc/Kconfig            |    7 ++++
>  arch/arm/plat-mxc/Makefile           |    2 +
>  arch/arm/plat-mxc/dam-v1.c           |   33 ++++++++++++++++++++
>  arch/arm/plat-mxc/dam-v2.c           |   56 ++++++++++++++++++++++++++++++++++

Is there any great reason to use the DAM name rather than AUDMUX?  I've
never heard it called anything except AUDMUX before, though I may have
been missing something.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 8/9] MXC: Add a digital audio multiplexer (DAM) driver
  2009-11-12 12:47                 ` [PATCH 8/9] MXC: Add a digital audio multiplexer (DAM) driver Mark Brown
@ 2009-11-12 13:04                   ` Sascha Hauer
  0 siblings, 0 replies; 30+ messages in thread
From: Sascha Hauer @ 2009-11-12 13:04 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Mark,

On Thu, Nov 12, 2009 at 12:47:07PM +0000, Mark Brown wrote:
> On Thu, Nov 12, 2009 at 11:42:04AM +0100, Sascha Hauer wrote:
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> >  arch/arm/mach-mx2/Kconfig            |    2 +
> >  arch/arm/mach-mx3/Kconfig            |    2 +
> >  arch/arm/plat-mxc/Kconfig            |    7 ++++
> >  arch/arm/plat-mxc/Makefile           |    2 +
> >  arch/arm/plat-mxc/dam-v1.c           |   33 ++++++++++++++++++++
> >  arch/arm/plat-mxc/dam-v2.c           |   56 ++++++++++++++++++++++++++++++++++
> 
> Is there any great reason to use the DAM name rather than AUDMUX?  I've
> never heard it called anything except AUDMUX before, though I may have
> been missing something.

I don't know who invented this name, but audmux seems better to me, too.
Will change this.

Sascha


-- 
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 |

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 5/9] pcm043: Add NAND support
  2009-11-12 12:43           ` [PATCH 5/9] pcm043: Add NAND support Fabio Estevam
@ 2009-11-12 13:06             ` Sascha Hauer
  0 siblings, 0 replies; 30+ messages in thread
From: Sascha Hauer @ 2009-11-12 13:06 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Fabio,

On Thu, Nov 12, 2009 at 04:43:59AM -0800, Fabio Estevam wrote:
> 
> Have you managed to load a root file system via JFFS2 on this board?

No, I'm using UBIFS. There still is a bug with oob handling preventing
jffs2 to work properly on i.MX35 (see my mail on the mtd list). I have a
fix for this and I assume I could boot from JFFS2 now, but I haven't
tested.

Sascha


-- 
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 |

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 8/9 v2] MXC: Add a digital audio multiplexer driver
  2009-11-12 10:42               ` [PATCH 8/9] MXC: Add a digital audio multiplexer (DAM) driver Sascha Hauer
  2009-11-12 10:42                 ` [PATCH 9/9] i.MX35: Fix audmux clock Sascha Hauer
  2009-11-12 12:47                 ` [PATCH 8/9] MXC: Add a digital audio multiplexer (DAM) driver Mark Brown
@ 2009-11-12 15:06                 ` Sascha Hauer
  2009-11-12 22:32                   ` Russell King - ARM Linux
  2009-11-30 11:56                   ` javier Martin
  2 siblings, 2 replies; 30+ messages in thread
From: Sascha Hauer @ 2009-11-12 15:06 UTC (permalink / raw)
  To: linux-arm-kernel

Here is an updated version of this patch with audmux instead of DAM

Sascha


Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-mx2/Kconfig               |    2 +
 arch/arm/mach-mx3/Kconfig               |    2 +
 arch/arm/plat-mxc/Kconfig               |    7 +++
 arch/arm/plat-mxc/Makefile              |    2 +
 arch/arm/plat-mxc/audmux-v1.c           |   53 +++++++++++++++++++++
 arch/arm/plat-mxc/audmux-v2.c           |   77 +++++++++++++++++++++++++++++++
 arch/arm/plat-mxc/include/mach/audmux.h |   52 +++++++++++++++++++++
 7 files changed, 195 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-mxc/audmux-v1.c
 create mode 100644 arch/arm/plat-mxc/audmux-v2.c
 create mode 100644 arch/arm/plat-mxc/include/mach/audmux.h

diff --git a/arch/arm/mach-mx2/Kconfig b/arch/arm/mach-mx2/Kconfig
index c8a2eac..3e14da3 100644
--- a/arch/arm/mach-mx2/Kconfig
+++ b/arch/arm/mach-mx2/Kconfig
@@ -6,11 +6,13 @@ choice
 
 config MACH_MX21
 	bool "i.MX21 support"
+	select ARCH_MXC_AUDMUX_V1
 	help
 	  This enables support for Freescale's MX2 based i.MX21 processor.
 
 config MACH_MX27
 	bool "i.MX27 support"
+	select ARCH_MXC_AUDMUX_V1
 	help
 	  This enables support for Freescale's MX2 based i.MX27 processor.
 
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index 851f245..ffdd211 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -2,11 +2,13 @@ if ARCH_MX3
 
 config ARCH_MX31
 	select ARCH_HAS_RNGA
+	select ARCH_MXC_AUDMUX_V2
 	bool
 
 config ARCH_MX35
 	bool
 	select ARCH_MXC_IOMUX_V3
+	select ARCH_MXC_AUDMUX_V2
 
 comment "MX3 platforms:"
 
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index e8e92cb..8b0a1ee 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -78,4 +78,11 @@ config ARCH_HAS_RNGA
 
 config ARCH_MXC_IOMUX_V3
 	bool
+
+config ARCH_MXC_AUDMUX_V1
+	bool
+
+config ARCH_MXC_AUDMUX_V2
+	bool
+
 endif
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile
index 545412f..4cbca9d 100644
--- a/arch/arm/plat-mxc/Makefile
+++ b/arch/arm/plat-mxc/Makefile
@@ -10,3 +10,5 @@ obj-$(CONFIG_ARCH_MX2) += iomux-mx1-mx2.o dma-mx1-mx2.o
 obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o
 obj-$(CONFIG_MXC_PWM)  += pwm.o
 obj-$(CONFIG_MXC_ULPI) += ulpi.o
+obj-$(CONFIG_ARCH_MXC_AUDMUX_V1) += audmux-v1.o
+obj-$(CONFIG_ARCH_MXC_AUDMUX_V2) += audmux-v2.o
diff --git a/arch/arm/plat-mxc/audmux-v1.c b/arch/arm/plat-mxc/audmux-v1.c
new file mode 100644
index 0000000..70ab5af
--- /dev/null
+++ b/arch/arm/plat-mxc/audmux-v1.c
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
+ *
+ * Initial development of this code was funded by
+ * Phytec Messtechnik GmbH, http://www.phytec.de
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/module.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/clk.h>
+#include <mach/audmux.h>
+#include <mach/hardware.h>
+
+static void __iomem *audmux_base;
+
+#define MXC_AUDMUX_V1_PCR(x)	((x) * 4)
+
+int mxc_audmux_v1_configure_port(unsigned int port, unsigned int pcr)
+{
+	if (!audmux_base) {
+		printk("%s: not configured\n", __func__);
+		return -ENOSYS;
+	}
+
+	writel(pcr, audmux_base + MXC_AUDMUX_V1_PCR(port));
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(mxc_audmux_v1_configure_port);
+
+static int mxc_audmux_v1_init(void)
+{
+	if (cpu_is_mx27() || cpu_is_mx21())
+		audmux_base = IO_ADDRESS(AUDMUX_BASE_ADDR);
+	return 0;
+}
+
+postcore_initcall(mxc_audmux_v1_init);
diff --git a/arch/arm/plat-mxc/audmux-v2.c b/arch/arm/plat-mxc/audmux-v2.c
new file mode 100644
index 0000000..fe8d46d
--- /dev/null
+++ b/arch/arm/plat-mxc/audmux-v2.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
+ *
+ * Initial development of this code was funded by
+ * Phytec Messtechnik GmbH, http://www.phytec.de
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/module.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/clk.h>
+#include <mach/audmux.h>
+#include <mach/hardware.h>
+
+static struct clk *audmux_clk;
+static void __iomem *audmux_base;
+
+#define MXC_AUDMUX_V2_PTCR(x)		((x) * 8)
+#define MXC_AUDMUX_V2_PDCR(x)		((x) * 8 + 4)
+
+int mxc_audmux_v2_configure_port(unsigned int port, unsigned int ptcr,
+		unsigned int pdcr)
+{
+	if (!audmux_base)
+		return -ENOSYS;
+
+	if (audmux_clk)
+		clk_enable(audmux_clk);
+
+	writel(ptcr, audmux_base + MXC_AUDMUX_V2_PTCR(port));
+	writel(pdcr, audmux_base + MXC_AUDMUX_V2_PDCR(port));
+
+	if (audmux_clk)
+		clk_disable(audmux_clk);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(mxc_audmux_v2_configure_port);
+
+static int mxc_audmux_v2_init(void)
+{
+	int ret;
+
+	if (cpu_is_mx31() || cpu_is_mx35())
+		audmux_base = IO_ADDRESS(AUDMUX_BASE_ADDR);
+	else
+		return 0;
+
+	if (cpu_is_mx35()) {
+		audmux_clk = clk_get(NULL, "audmux");
+		if (IS_ERR(audmux_clk)) {
+			audmux_base = NULL;
+			ret = PTR_ERR(audmux_clk);
+			printk(KERN_ERR "%s: cannot get clock: %d\n", __func__,
+					ret);
+			return ret;
+		}
+	}
+
+	return 0;
+}
+
+postcore_initcall(mxc_audmux_v2_init);
diff --git a/arch/arm/plat-mxc/include/mach/audmux.h b/arch/arm/plat-mxc/include/mach/audmux.h
new file mode 100644
index 0000000..5cd6466
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/audmux.h
@@ -0,0 +1,52 @@
+#ifndef __MACH_AUDMUX_H
+#define __MACH_AUDMUX_H
+
+#define MX27_AUDMUX_HPCR1_SSI0		0
+#define MX27_AUDMUX_HPCR2_SSI1		1
+#define MX27_AUDMUX_HPCR3_SSI_PINS_4	2
+#define MX27_AUDMUX_PPCR1_SSI_PINS_1	3
+#define MX27_AUDMUX_PPCR2_SSI_PINS_2	4
+#define MX27_AUDMUX_PPCR3_SSI_PINS_3	5
+
+#define MX31_AUDMUX_PORT1_SSI0		0
+#define MX31_AUDMUX_PORT2_SSI1		1
+#define MX31_AUDMUX_PORT3_SSI_PINS_3	2
+#define MX31_AUDMUX_PORT4_SSI_PINS_4	3
+#define MX31_AUDMUX_PORT5_SSI_PINS_5	4
+#define MX31_AUDMUX_PORT6_SSI_PINS_6	5
+
+/* Register definitions for the i.MX21/27 Digital Audio Multiplexer */
+#define MXC_AUDMUX_V1_PCR_INMMASK(x)	((x) & 0xff)
+#define MXC_AUDMUX_V1_PCR_INMEN		(1 << 8)
+#define MXC_AUDMUX_V1_PCR_TXRXEN	(1 << 10)
+#define MXC_AUDMUX_V1_PCR_SYN		(1 << 12)
+#define MXC_AUDMUX_V1_PCR_RXDSEL(x)	(((x) & 0x7) << 13)
+#define MXC_AUDMUX_V1_PCR_RFCSEL(x)	(((x) & 0xf) << 20)
+#define MXC_AUDMUX_V1_PCR_RCLKDIR	(1 << 24)
+#define MXC_AUDMUX_V1_PCR_RFSDIR	(1 << 25)
+#define MXC_AUDMUX_V1_PCR_TFCSEL(x)	(((x) & 0xf) << 26)
+#define MXC_AUDMUX_V1_PCR_TCLKDIR	(1 << 30)
+#define MXC_AUDMUX_V1_PCR_TFSDIR	(1 << 31)
+
+/* Register definitions for the i.MX25/31/35 Digital Audio Multiplexer */
+#define MXC_AUDMUX_V2_PTCR_TFSDIR	(1 << 31)
+#define MXC_AUDMUX_V2_PTCR_TFSEL(x)	(((x) & 0xf) << 27)
+#define MXC_AUDMUX_V2_PTCR_TCLKDIR	(1 << 26)
+#define MXC_AUDMUX_V2_PTCR_TCSEL(x)	(((x) & 0xf) << 22)
+#define MXC_AUDMUX_V2_PTCR_RFSDIR	(1 << 21)
+#define MXC_AUDMUX_V2_PTCR_RFSEL(x)	(((x) & 0xf) << 17)
+#define MXC_AUDMUX_V2_PTCR_RCLKDIR	(1 << 16)
+#define MXC_AUDMUX_V2_PTCR_RCSEL(x)	(((x) & 0xf) << 12)
+#define MXC_AUDMUX_V2_PTCR_SYN		(1 << 11)
+
+#define MXC_AUDMUX_V2_PDCR_RXDSEL(x)	(((x) & 0x7) << 13)
+#define MXC_AUDMUX_V2_PDCR_TXRXEN	(1 << 12)
+#define MXC_AUDMUX_V2_PDCR_MODE(x)	(((x) & 0x3) << 8)
+#define MXC_AUDMUX_V2_PDCR_INMMASK(x)	((x) & 0xff)
+
+int mxc_audmux_v1_configure_port(unsigned int port, unsigned int pcr);
+
+int mxc_audmux_v2_configure_port(unsigned int port, unsigned int ptcr,
+		unsigned int pdcr);
+
+#endif /* __MACH_AUDMUX_H */
-- 
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 |

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 2/9] MXC NFC: Fix NFCs address area on i.MX35
  2009-11-12 10:41   ` [PATCH 2/9] MXC NFC: Fix NFCs address area on i.MX35 Sascha Hauer
  2009-11-12 10:41     ` [PATCH 3/9] pca100: Add board to uncompress.h Sascha Hauer
@ 2009-11-12 20:04     ` Magnus Lilja
  2009-11-13  7:29       ` Sascha Hauer
  1 sibling, 1 reply; 30+ messages in thread
From: Magnus Lilja @ 2009-11-12 20:04 UTC (permalink / raw)
  To: linux-arm-kernel

Hi

Sascha Hauer skrev:
> From: Juergen Beisert <jbe@pengutronix.de>
> 
> The address area of the NFS in the i.MX35 silicon is much larger than 4k.

"NFS"? Did you mean "NFC" or am I missing something?

Regards, Magnus

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 8/9 v2] MXC: Add a digital audio multiplexer driver
  2009-11-12 15:06                 ` [PATCH 8/9 v2] MXC: Add a digital audio multiplexer driver Sascha Hauer
@ 2009-11-12 22:32                   ` Russell King - ARM Linux
  2009-11-13  7:29                     ` Sascha Hauer
  2009-11-30 11:56                   ` javier Martin
  1 sibling, 1 reply; 30+ messages in thread
From: Russell King - ARM Linux @ 2009-11-12 22:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 12, 2009 at 04:06:15PM +0100, Sascha Hauer wrote:
> +static int mxc_audmux_v2_init(void)
> +{
> +	int ret;
> +
> +	if (cpu_is_mx31() || cpu_is_mx35())
> +		audmux_base = IO_ADDRESS(AUDMUX_BASE_ADDR);
> +	else
> +		return 0;
> +
> +	if (cpu_is_mx35()) {
> +		audmux_clk = clk_get(NULL, "audmux");
> +		if (IS_ERR(audmux_clk)) {
> +			audmux_base = NULL;
> +			ret = PTR_ERR(audmux_clk);
> +			printk(KERN_ERR "%s: cannot get clock: %d\n", __func__,
> +					ret);
> +			return ret;
> +		}
> +	}
> +
> +	return 0;
> +}

Hmm.  Wouldn't something like:

	if (cpu_is_mx35()) {
		audmux_clk = clk_get(NULL, "audmux");
		if (IS_ERR(audmux_clk)) {
			int ret = PTR_ERR(audmux_clk);
			printk(KERN_ERR "%s: cannot get clock: %d\n", __func__,
					ret);
			return ret;
		}
	}

	if (cpu_is_mx31() || cpu_is_mx35())
		audmux_base = IO_ADDRESS(AUDMUX_BASE_ADDR);

	return 0;

be a better and clearer way to write this?

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 8/9 v2] MXC: Add a digital audio multiplexer driver
  2009-11-12 22:32                   ` Russell King - ARM Linux
@ 2009-11-13  7:29                     ` Sascha Hauer
  0 siblings, 0 replies; 30+ messages in thread
From: Sascha Hauer @ 2009-11-13  7:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 12, 2009 at 10:32:37PM +0000, Russell King - ARM Linux wrote:
> On Thu, Nov 12, 2009 at 04:06:15PM +0100, Sascha Hauer wrote:
> > +static int mxc_audmux_v2_init(void)
> > +{
> > +	int ret;
> > +
> > +	if (cpu_is_mx31() || cpu_is_mx35())
> > +		audmux_base = IO_ADDRESS(AUDMUX_BASE_ADDR);
> > +	else
> > +		return 0;
> > +
> > +	if (cpu_is_mx35()) {
> > +		audmux_clk = clk_get(NULL, "audmux");
> > +		if (IS_ERR(audmux_clk)) {
> > +			audmux_base = NULL;
> > +			ret = PTR_ERR(audmux_clk);
> > +			printk(KERN_ERR "%s: cannot get clock: %d\n", __func__,
> > +					ret);
> > +			return ret;
> > +		}
> > +	}
> > +
> > +	return 0;
> > +}
> 
> Hmm.  Wouldn't something like:
> 
> 	if (cpu_is_mx35()) {
> 		audmux_clk = clk_get(NULL, "audmux");
> 		if (IS_ERR(audmux_clk)) {
> 			int ret = PTR_ERR(audmux_clk);
> 			printk(KERN_ERR "%s: cannot get clock: %d\n", __func__,
> 					ret);
> 			return ret;
> 		}
> 	}
> 
> 	if (cpu_is_mx31() || cpu_is_mx35())
> 		audmux_base = IO_ADDRESS(AUDMUX_BASE_ADDR);
> 
> 	return 0;
> 
> be a better and clearer way to write this?

Indeed. I Changed this.

Sascha


-- 
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 |

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 2/9] MXC NFC: Fix NFCs address area on i.MX35
  2009-11-12 20:04     ` [PATCH 2/9] MXC NFC: Fix NFCs address area on i.MX35 Magnus Lilja
@ 2009-11-13  7:29       ` Sascha Hauer
  0 siblings, 0 replies; 30+ messages in thread
From: Sascha Hauer @ 2009-11-13  7:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 12, 2009 at 09:04:07PM +0100, Magnus Lilja wrote:
> Hi
> 
> Sascha Hauer skrev:
> > From: Juergen Beisert <jbe@pengutronix.de>
> > 
> > The address area of the NFS in the i.MX35 silicon is much larger than 4k.
> 
> "NFS"? Did you mean "NFC" or am I missing something?

I meant NFC of course.

Sascha


-- 
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 |

^ permalink raw reply	[flat|nested] 30+ messages in thread

* MXC patches for next merge window
  2009-11-12 10:41 MXC patches for next merge window Sascha Hauer
  2009-11-12 10:41 ` [PATCH 1/9] MXC NFC: Add the clock resource to support NFC in i.MX35 Sascha Hauer
@ 2009-11-18  9:49 ` Sascha Hauer
  1 sibling, 0 replies; 30+ messages in thread
From: Sascha Hauer @ 2009-11-18  9:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 12, 2009 at 11:41:56AM +0100, Sascha Hauer wrote:
> Hi,
> 
> Here are some patches for the next merge window to review which aim at sound
> and add Nand support for the pcm043 board.
> 
> Sascha
> 
> The following changes since commit 52d797c8c0b53e3940427ff0c43ef4356f1d668e:
>   Uwe Kleine-K?nig (1):
>         imx/gpio: Use handle_level_irq
> 
> are available in the git repository at:
> 
>   git://git.pengutronix.de/git/imx/linux-2.6.git mxc-master-pu

Added this series to mxc-master (including the comments I received for
these patches)

Sascha

-- 
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 |

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 8/9 v2] MXC: Add a digital audio multiplexer driver
  2009-11-12 15:06                 ` [PATCH 8/9 v2] MXC: Add a digital audio multiplexer driver Sascha Hauer
  2009-11-12 22:32                   ` Russell King - ARM Linux
@ 2009-11-30 11:56                   ` javier Martin
  2009-11-30 12:10                     ` Sascha Hauer
  1 sibling, 1 reply; 30+ messages in thread
From: javier Martin @ 2009-11-30 11:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sascha,
as you know I have been testing your i.MX27 support and I have found a
problem in this audmux patch.

Please, see my comment below:


+++ b/arch/arm/plat-mxc/audmux-v1.c
> @@ -0,0 +1,53 @@
> +/*
> + * Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
> + *
> + * Initial development of this code was funded by
> + * Phytec Messtechnik GmbH, http://www.phytec.de
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> + */
> +
> +#include <linux/module.h>
> +#include <linux/err.h>
> +#include <linux/io.h>
> +#include <linux/clk.h>
> +#include <mach/audmux.h>
> +#include <mach/hardware.h>
> +
> +static void __iomem *audmux_base;
> +
> +#define MXC_AUDMUX_V1_PCR(x)   ((x) * 4)
>

You cannot calculate AUDMUX register offsets this way because according to
i.MX27 manual:

0x1001_6000 (HPCR1)
0x1001_6004 (HPCR2)
0x1001_6008 (HPCR3)
0x1001_6010 (PPCR1)  <-- You are using 0x0C for this
0x1001_6014 (PPCR2)  <--- You are using 0x10 for this
0x1001_601C (PPCR3)  <--- You are using 0x18 for this


+int mxc_audmux_v1_configure_port(unsigned int port, unsigned int pcr)
> +{
> +       if (!audmux_base) {
> +               printk("%s: not configured\n", __func__);
> +               return -ENOSYS;
> +       }
> +
> +       writel(pcr, audmux_base + MXC_AUDMUX_V1_PCR(port));
> +
> +       return 0;
> +}
> +EXPORT_SYMBOL_GPL(mxc_audmux_v1_configure_port);
> +
> +static int mxc_audmux_v1_init(void)
> +{
> +       if (cpu_is_mx27() || cpu_is_mx21())
> +               audmux_base = IO_ADDRESS(AUDMUX_BASE_ADDR);
> +       return 0;
> +}
> +
> +postcore_initcall(mxc_audmux_v1_init);
>
>

Thank you.

-- 
Javier Martin
Vista 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091130/7a393e51/attachment-0001.htm>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 8/9 v2] MXC: Add a digital audio multiplexer driver
  2009-11-30 11:56                   ` javier Martin
@ 2009-11-30 12:10                     ` Sascha Hauer
  2009-11-30 12:25                       ` javier Martin
  0 siblings, 1 reply; 30+ messages in thread
From: Sascha Hauer @ 2009-11-30 12:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 30, 2009 at 12:56:19PM +0100, javier Martin wrote:
> Hi Sascha,
> as you know I have been testing your i.MX27 support and I have found a
> problem in this audmux patch.
> 
> Please, see my comment below:
> 
> 
> +++ b/arch/arm/plat-mxc/audmux-v1.c
> > @@ -0,0 +1,53 @@
> > +/*
> > + * Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
> > + *
> > + * Initial development of this code was funded by
> > + * Phytec Messtechnik GmbH, http://www.phytec.de
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU General Public License
> > + * along with this program; if not, write to the Free Software
> > + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> > + */
> > +
> > +#include <linux/module.h>
> > +#include <linux/err.h>
> > +#include <linux/io.h>
> > +#include <linux/clk.h>
> > +#include <mach/audmux.h>
> > +#include <mach/hardware.h>
> > +
> > +static void __iomem *audmux_base;
> > +
> > +#define MXC_AUDMUX_V1_PCR(x)   ((x) * 4)
> >
> 
> You cannot calculate AUDMUX register offsets this way because according to
> i.MX27 manual:
> 
> 0x1001_6000 (HPCR1)
> 0x1001_6004 (HPCR2)
> 0x1001_6008 (HPCR3)
> 0x1001_6010 (PPCR1)  <-- You are using 0x0C for this
> 0x1001_6014 (PPCR2)  <--- You are using 0x10 for this
> 0x1001_601C (PPCR3)  <--- You are using 0x18 for this

It's fine the way it is. See mach/audmux.h:

#define MX27_AUDMUX_HPCR1_SSI0		0
#define MX27_AUDMUX_HPCR2_SSI1		1
#define MX27_AUDMUX_HPCR3_SSI_PINS_4	2
#define MX27_AUDMUX_PPCR1_SSI_PINS_1	3
#define MX27_AUDMUX_PPCR2_SSI_PINS_2	4
#define MX27_AUDMUX_PPCR3_SSI_PINS_3	5

Sascha


-- 
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 |

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 8/9 v2] MXC: Add a digital audio multiplexer driver
  2009-11-30 12:10                     ` Sascha Hauer
@ 2009-11-30 12:25                       ` javier Martin
  2009-11-30 12:34                         ` Sascha Hauer
  0 siblings, 1 reply; 30+ messages in thread
From: javier Martin @ 2009-11-30 12:25 UTC (permalink / raw)
  To: linux-arm-kernel

> > You cannot calculate AUDMUX register offsets this way because according
> to
> > i.MX27 manual:
> >
> > 0x1001_6000 (HPCR1)
> > 0x1001_6004 (HPCR2)
> > 0x1001_6008 (HPCR3)
> > 0x1001_6010 (PPCR1)  <-- You are using 0x0C for this
> > 0x1001_6014 (PPCR2)  <--- You are using 0x10 for this
> > 0x1001_601C (PPCR3)  <--- You are using 0x18 for this
>
> It's fine the way it is. See mach/audmux.h:
>
> #define MX27_AUDMUX_HPCR1_SSI0          0
> #define MX27_AUDMUX_HPCR2_SSI1          1
> #define MX27_AUDMUX_HPCR3_SSI_PINS_4    2
> #define MX27_AUDMUX_PPCR1_SSI_PINS_1    3
> #define MX27_AUDMUX_PPCR2_SSI_PINS_2    4
> #define MX27_AUDMUX_PPCR3_SSI_PINS_3    5
>


Sorry for my insistence but, unless I am missing something weird, I have
looked at mach/audmux.h and still think that it is wrong:

AUDMUX PORT        Your offset         i.MX27 Manual offset
---------------------------        ------------------
---------------------------------------
(0) HPCR1                       (0 x 4) = 0x0        0x00
(1) HPCR2                       (1 x 4) = 0x4        0x04
(2) HPCR3                       (2 x 4) = 0x8        0x08
(3) PPCR1                       (3 x 4) = 0xC        0x10
(4) HPCR2                      (4 x 4) = 0x10        0x14
(5) HPCR3                      (5 x 4) = 0x14        0x1C


-- 
Javier Martin
Vista 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091130/92016fac/attachment-0001.htm>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 8/9 v2] MXC: Add a digital audio multiplexer driver
  2009-11-30 12:25                       ` javier Martin
@ 2009-11-30 12:34                         ` Sascha Hauer
  2009-11-30 13:09                           ` javier Martin
  0 siblings, 1 reply; 30+ messages in thread
From: Sascha Hauer @ 2009-11-30 12:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 30, 2009 at 01:25:12PM +0100, javier Martin wrote:
> > > You cannot calculate AUDMUX register offsets this way because according
> > to
> > > i.MX27 manual:
> > >
> > > 0x1001_6000 (HPCR1)
> > > 0x1001_6004 (HPCR2)
> > > 0x1001_6008 (HPCR3)
> > > 0x1001_6010 (PPCR1)  <-- You are using 0x0C for this
> > > 0x1001_6014 (PPCR2)  <--- You are using 0x10 for this
> > > 0x1001_601C (PPCR3)  <--- You are using 0x18 for this
> >
> > It's fine the way it is. See mach/audmux.h:
> >
> > #define MX27_AUDMUX_HPCR1_SSI0          0
> > #define MX27_AUDMUX_HPCR2_SSI1          1
> > #define MX27_AUDMUX_HPCR3_SSI_PINS_4    2
> > #define MX27_AUDMUX_PPCR1_SSI_PINS_1    3
> > #define MX27_AUDMUX_PPCR2_SSI_PINS_2    4
> > #define MX27_AUDMUX_PPCR3_SSI_PINS_3    5
> >
> 
> 
> Sorry for my insistence but, unless I am missing something weird, I have
> looked at mach/audmux.h and still think that it is wrong:
> 
> AUDMUX PORT        Your offset         i.MX27 Manual offset
> ---------------------------        ------------------
> ---------------------------------------
> (0) HPCR1                       (0 x 4) = 0x0        0x00
> (1) HPCR2                       (1 x 4) = 0x4        0x04
> (2) HPCR3                       (2 x 4) = 0x8        0x08
> (3) PPCR1                       (3 x 4) = 0xC        0x10
> (4) HPCR2                      (4 x 4) = 0x10        0x14
> (5) HPCR3                      (5 x 4) = 0x14        0x1C

Oops, you're right. I have overlooked this whole in the register space.
The following should fix it.

Sascha

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 8/9 v2] MXC: Add a digital audio multiplexer driver
  2009-11-30 12:34                         ` Sascha Hauer
@ 2009-11-30 13:09                           ` javier Martin
  2009-11-30 16:03                             ` Sascha Hauer
  0 siblings, 1 reply; 30+ messages in thread
From: javier Martin @ 2009-11-30 13:09 UTC (permalink / raw)
  To: linux-arm-kernel


>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: <mailman.58.1259665835.2170.linux-arm-kernel@lists.infradead.org>

> From: Sascha Hauer <s.hauer@pengutronix.de>
> Date: Mon, 30 Nov 2009 13:31:29 +0100
> Subject: [PATCH] i.MX27 audmux: Fix register offsets
>
> The PPCR registers start at 0x10, not 0xc. Fix this.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  arch/arm/plat-mxc/include/mach/audmux.h |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/plat-mxc/include/mach/audmux.h
> b/arch/arm/plat-mxc/include/mach/audmux.h
> index 5cd6466..dcc12d4 100644
> --- a/arch/arm/plat-mxc/include/mach/audmux.h
> +++ b/arch/arm/plat-mxc/include/mach/audmux.h
> @@ -4,9 +4,9 @@
>  #define MX27_AUDMUX_HPCR1_SSI0         0
>  #define MX27_AUDMUX_HPCR2_SSI1         1
>  #define MX27_AUDMUX_HPCR3_SSI_PINS_4   2
> -#define MX27_AUDMUX_PPCR1_SSI_PINS_1   3
> -#define MX27_AUDMUX_PPCR2_SSI_PINS_2   4
> -#define MX27_AUDMUX_PPCR3_SSI_PINS_3   5
> +#define MX27_AUDMUX_PPCR1_SSI_PINS_1   4
> +#define MX27_AUDMUX_PPCR2_SSI_PINS_2   5
> +#define MX27_AUDMUX_PPCR3_SSI_PINS_3   6
>

Be careful,
I think this patch breaks some of the boards currently using
MXC_AUDMUX_V1_PCR_RXDSEL(x) and similar macros defined in mach/audmux.h (for
example pcm038).
For those macros the old AUDMUX register indexes are fine.

I suggest fixing this inside audmux_v1.c instead of modifying mach/audmux.h.


Thank you.
-- 
Javier Martin
Vista 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

--0016e6d58cb2408bb9047996596d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable


>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: <mailman.59.1259665835.2170.linux-arm-kernel@lists.infradead.org>

div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"border=
-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-lef=
t: 1ex;">

From: Sascha Hauer &lt;<a href=3D"mailto:s.hauer@pengutronix.de">s.hauer at pe=
ngutronix.de</a>&gt;<br>
Date: Mon, 30 Nov 2009 13:31:29 +0100<br>
Subject: [PATCH] i.MX27 audmux: Fix register offsets<br>
<br>
The PPCR registers start at 0x10, not 0xc. Fix this.<br>
<br>
Signed-off-by: Sascha Hauer &lt;<a href=3D"mailto:s.hauer@pengutronix.de">s=
.hauer at pengutronix.de</a>&gt;<br>
---<br>
=A0arch/arm/plat-mxc/include/mach/audmux.h | =A0 =A06 +++---<br>
=A01 files changed, 3 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/arch/arm/plat-mxc/include/mach/audmux.h b/arch/arm/plat-mxc/in=
clude/mach/audmux.h<br>
index 5cd6466..dcc12d4 100644<br>
--- a/arch/arm/plat-mxc/include/mach/audmux.h<br>
+++ b/arch/arm/plat-mxc/include/mach/audmux.h<br>
@@ -4,9 +4,9 @@<br>
<div class=3D"im">=A0#define MX27_AUDMUX_HPCR1_SSI0 =A0 =A0 =A0 =A0 0<br>
=A0#define MX27_AUDMUX_HPCR2_SSI1 =A0 =A0 =A0 =A0 1<br>
=A0#define MX27_AUDMUX_HPCR3_SSI_PINS_4 =A0 2<br>
-#define MX27_AUDMUX_PPCR1_SSI_PINS_1 =A0 3<br>
-#define MX27_AUDMUX_PPCR2_SSI_PINS_2 =A0 4<br>
-#define MX27_AUDMUX_PPCR3_SSI_PINS_3 =A0 5<br>
</div>+#define MX27_AUDMUX_PPCR1_SSI_PINS_1 =A0 4<br>
+#define MX27_AUDMUX_PPCR2_SSI_PINS_2 =A0 5<br>
+#define MX27_AUDMUX_PPCR3_SSI_PINS_3 =A0 6<br></blockquote><br>Be careful,=
<br>I think this patch breaks some of the boards currently using MXC_AUDMUX=
_V1_PCR_RXDSEL(x) and similar macros defined in mach/audmux.h (for example =
pcm038).<br>
For those macros the old AUDMUX register indexes are fine.<br><br>I suggest=
 fixing this inside audmux_v1.c instead of modifying mach/audmux.h.<br><br>=
<br>Thank you.<br></div>-- <br>Javier Martin<br>Vista Silicon S.L.<br>CDTUC=
 - FASE C - Oficina S-345<br>
Avda de los Castros s/n<br>39005- Santander. Cantabria. Spain<br>+34 942 25=
 32 60<br><a href=3D"http://www.vista-silicon.com">www.vista-silicon.com</a=
><br>

--0016e6d58cb2408bb9047996596d--

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 8/9 v2] MXC: Add a digital audio multiplexer driver
  2009-11-30 13:09                           ` javier Martin
@ 2009-11-30 16:03                             ` Sascha Hauer
  2009-11-30 16:15                               ` javier Martin
  0 siblings, 1 reply; 30+ messages in thread
From: Sascha Hauer @ 2009-11-30 16:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 30, 2009 at 02:09:16PM +0100, javier Martin wrote:
> From fa87b65915e78ad29a8e4f3f22b26ed0fa6dc7f5 Mon Sep 17 00:00:00 2001
> 
> > From: Sascha Hauer <s.hauer@pengutronix.de>
> > Date: Mon, 30 Nov 2009 13:31:29 +0100
> > Subject: [PATCH] i.MX27 audmux: Fix register offsets
> >
> > The PPCR registers start at 0x10, not 0xc. Fix this.
> >
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> >  arch/arm/plat-mxc/include/mach/audmux.h |    6 +++---
> >  1 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/arm/plat-mxc/include/mach/audmux.h
> > b/arch/arm/plat-mxc/include/mach/audmux.h
> > index 5cd6466..dcc12d4 100644
> > --- a/arch/arm/plat-mxc/include/mach/audmux.h
> > +++ b/arch/arm/plat-mxc/include/mach/audmux.h
> > @@ -4,9 +4,9 @@
> >  #define MX27_AUDMUX_HPCR1_SSI0         0
> >  #define MX27_AUDMUX_HPCR2_SSI1         1
> >  #define MX27_AUDMUX_HPCR3_SSI_PINS_4   2
> > -#define MX27_AUDMUX_PPCR1_SSI_PINS_1   3
> > -#define MX27_AUDMUX_PPCR2_SSI_PINS_2   4
> > -#define MX27_AUDMUX_PPCR3_SSI_PINS_3   5
> > +#define MX27_AUDMUX_PPCR1_SSI_PINS_1   4
> > +#define MX27_AUDMUX_PPCR2_SSI_PINS_2   5
> > +#define MX27_AUDMUX_PPCR3_SSI_PINS_3   6
> >
> 
> Be careful,
> I think this patch breaks some of the boards currently using
> MXC_AUDMUX_V1_PCR_RXDSEL(x) and similar macros defined in mach/audmux.h (for
> example pcm038).
> For those macros the old AUDMUX register indexes are fine.
> 
> I suggest fixing this inside audmux_v1.c instead of modifying mach/audmux.h.

Ok. The AUDMUX V1 is used on i.MX21 and i.MX27 and both have this hole
in the register space, so fixing it in the driver should be safe.

How about this one then?

Sascha

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 8/9 v2] MXC: Add a digital audio multiplexer driver
  2009-11-30 16:03                             ` Sascha Hauer
@ 2009-11-30 16:15                               ` javier Martin
  2009-11-30 16:18                                 ` Sascha Hauer
  2009-12-02 11:20                                 ` Sascha Hauer
  0 siblings, 2 replies; 30+ messages in thread
From: javier Martin @ 2009-11-30 16:15 UTC (permalink / raw)
  To: linux-arm-kernel

2009/11/30 Sascha Hauer <s.hauer@pengutronix.de>

> On Mon, Nov 30, 2009 at 02:09:16PM +0100, javier Martin wrote:
> > From fa87b65915e78ad29a8e4f3f22b26ed0fa6dc7f5 Mon Sep 17 00:00:00 2001
> >
> > > From: Sascha Hauer <s.hauer@pengutronix.de>
> > > Date: Mon, 30 Nov 2009 13:31:29 +0100
> > > Subject: [PATCH] i.MX27 audmux: Fix register offsets
> > >
> > > The PPCR registers start at 0x10, not 0xc. Fix this.
> > >
> > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > > ---
> > >  arch/arm/plat-mxc/include/mach/audmux.h |    6 +++---
> > >  1 files changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/arch/arm/plat-mxc/include/mach/audmux.h
> > > b/arch/arm/plat-mxc/include/mach/audmux.h
> > > index 5cd6466..dcc12d4 100644
> > > --- a/arch/arm/plat-mxc/include/mach/audmux.h
> > > +++ b/arch/arm/plat-mxc/include/mach/audmux.h
> > > @@ -4,9 +4,9 @@
> > >  #define MX27_AUDMUX_HPCR1_SSI0         0
> > >  #define MX27_AUDMUX_HPCR2_SSI1         1
> > >  #define MX27_AUDMUX_HPCR3_SSI_PINS_4   2
> > > -#define MX27_AUDMUX_PPCR1_SSI_PINS_1   3
> > > -#define MX27_AUDMUX_PPCR2_SSI_PINS_2   4
> > > -#define MX27_AUDMUX_PPCR3_SSI_PINS_3   5
> > > +#define MX27_AUDMUX_PPCR1_SSI_PINS_1   4
> > > +#define MX27_AUDMUX_PPCR2_SSI_PINS_2   5
> > > +#define MX27_AUDMUX_PPCR3_SSI_PINS_3   6
> > >
> >
> > Be careful,
> > I think this patch breaks some of the boards currently using
> > MXC_AUDMUX_V1_PCR_RXDSEL(x) and similar macros defined in mach/audmux.h
> (for
> > example pcm038).
> > For those macros the old AUDMUX register indexes are fine.
> >
> > I suggest fixing this inside audmux_v1.c instead of modifying
> mach/audmux.h.
>
> Ok. The AUDMUX V1 is used on i.MX21 and i.MX27 and both have this hole
> in the register space, so fixing it in the driver should be safe.
>
> How about this one then?
>
> Sascha
>
>
> From 297b5c4cea40c2e7023bbdb96a0c90c13b0e02a1 Mon Sep 17 00:00:00 2001
> From: Sascha Hauer <s.hauer@pengutronix.de>
> Date: Mon, 30 Nov 2009 13:31:29 +0100
> Subject: [PATCH] i.MX27 audmux: Fix register offsets
>
> The PPCR registers start at 0x10, not 0xc. Fix this.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  arch/arm/plat-mxc/audmux-v1.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/plat-mxc/audmux-v1.c b/arch/arm/plat-mxc/audmux-v1.c
> index 70ab5af..8fbce7b 100644
> --- a/arch/arm/plat-mxc/audmux-v1.c
> +++ b/arch/arm/plat-mxc/audmux-v1.c
> @@ -37,6 +37,10 @@ int mxc_audmux_v1_configure_port(unsigned int port,
> unsigned int pcr)
>                return -ENOSYS;
>        }
>
> +       /* handle hole in the register space */
> +       if (port > 2)
> +               port++;
> +
>         writel(pcr, audmux_base + MXC_AUDMUX_V1_PCR(port));
>
>        return 0;
> --
> 1.6.5.2
>

Sascha,
there are actually two holes, with this current patch, PPCR3 still receives
a wrong value:

0x1001_6000 (HPCR1)
0x1001_6004 (HPCR2)
0x1001_6008 (HPCR3)
0x1001_600C (hole)
0x1001_6010 (PPCR1)
0x1001_6014 (PPCR2)
0x1001_6018 (hole)
0x1001_601C (PPCR3)


Thank you.

-- 
Javier Martin
Vista 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091130/33464ed9/attachment-0001.htm>

>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: <mailman.60.1259665861.2170.linux-arm-kernel@lists.infradead.org>

<div class=3D"im">From: Sascha Hauer &lt;<a href=3D"mailto:s.hauer@pengutro=
nix.de">s.hauer at pengutronix.de</a>&gt;<br>
Date: Mon, 30 Nov 2009 13:31:29 +0100<br>
Subject: [PATCH] i.MX27 audmux: Fix register offsets<br>
<br>
The PPCR registers start at 0x10, not 0xc. Fix this.<br>
<br>
Signed-off-by: Sascha Hauer &lt;<a href=3D"mailto:s.hauer@pengutronix.de">s=
.hauer at pengutronix.de</a>&gt;<br>
---<br>
</div>=A0arch/arm/plat-mxc/audmux-v1.c | =A0 =A04 ++++<br>
<div class=3D"im">=A01 files changed, 4 insertions(+), 0 deletions(-)<br>
<br>
</div>diff --git a/arch/arm/plat-mxc/audmux-v1.c b/arch/arm/plat-mxc/audmux=
-v1.c<br>
index 70ab5af..8fbce7b 100644<br>
--- a/arch/arm/plat-mxc/audmux-v1.c<br>
+++ b/arch/arm/plat-mxc/audmux-v1.c<br>
@@ -37,6 +37,10 @@ int mxc_audmux_v1_configure_port(unsigned int port, unsi=
gned int pcr)<br>
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -ENOSYS;<br>
 =A0 =A0 =A0 =A0}<br>
<br>
+ =A0 =A0 =A0 /* handle hole in the register space */<br>
+ =A0 =A0 =A0 if (port &gt; 2)<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 port++;<br>
+<br>
<div class=3D"im"> =A0 =A0 =A0 =A0writel(pcr, audmux_base + MXC_AUDMUX_V1_P=
CR(port));<br>
<br>
 =A0 =A0 =A0 =A0return 0;<br>
</div><div><div></div><div>--<br>
1.6.5.2<br></div></div></blockquote><div>=A0<br>Sascha,<br>there are actual=
ly two holes, with this current patch, PPCR3 still receives a wrong value:<=
br><br></div>0x1001_6000 (HPCR1) <br>0x1001_6004 (HPCR2)<br>0x1001_6008 (HP=
CR3) <br>
0x1001_600C (hole)<br>0x1001_6010 (PPCR1)<br>0x1001_6014 (PPCR2)<br>0x1001_=
6018 (hole)<br>0x1001_601C (PPCR3)<br><br></div><br clear=3D"all">Thank you=
.<br><br>-- <br>Javier Martin<br>Vista Silicon S.L.<br>CDTUC - FASE C - Ofi=
cina S-345<br>
Avda de los Castros s/n<br>39005- Santander. Cantabria. Spain<br>+34 942 25=
 32 60<br><a href=3D"http://www.vista-silicon.com">www.vista-silicon.com</a=
><br>

--0016e6d9a0e82a18a0047998f48a--

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 8/9 v2] MXC: Add a digital audio multiplexer driver
  2009-11-30 16:15                               ` javier Martin
@ 2009-11-30 16:18                                 ` Sascha Hauer
  2009-12-02 11:20                                 ` Sascha Hauer
  1 sibling, 0 replies; 30+ messages in thread
From: Sascha Hauer @ 2009-11-30 16:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 30, 2009 at 05:15:45PM +0100, javier Martin wrote:
> 2009/11/30 Sascha Hauer <s.hauer@pengutronix.de>
> 
> > On Mon, Nov 30, 2009 at 02:09:16PM +0100, javier Martin wrote:
> > > From fa87b65915e78ad29a8e4f3f22b26ed0fa6dc7f5 Mon Sep 17 00:00:00 2001
> > >
> > > > From: Sascha Hauer <s.hauer@pengutronix.de>
> > > > Date: Mon, 30 Nov 2009 13:31:29 +0100
> > > > Subject: [PATCH] i.MX27 audmux: Fix register offsets
> > > >
> > > > The PPCR registers start at 0x10, not 0xc. Fix this.
> > > >
> > > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > > > ---
> > > >  arch/arm/plat-mxc/include/mach/audmux.h |    6 +++---
> > > >  1 files changed, 3 insertions(+), 3 deletions(-)
> > > >
> > > > diff --git a/arch/arm/plat-mxc/include/mach/audmux.h
> > > > b/arch/arm/plat-mxc/include/mach/audmux.h
> > > > index 5cd6466..dcc12d4 100644
> > > > --- a/arch/arm/plat-mxc/include/mach/audmux.h
> > > > +++ b/arch/arm/plat-mxc/include/mach/audmux.h
> > > > @@ -4,9 +4,9 @@
> > > >  #define MX27_AUDMUX_HPCR1_SSI0         0
> > > >  #define MX27_AUDMUX_HPCR2_SSI1         1
> > > >  #define MX27_AUDMUX_HPCR3_SSI_PINS_4   2
> > > > -#define MX27_AUDMUX_PPCR1_SSI_PINS_1   3
> > > > -#define MX27_AUDMUX_PPCR2_SSI_PINS_2   4
> > > > -#define MX27_AUDMUX_PPCR3_SSI_PINS_3   5
> > > > +#define MX27_AUDMUX_PPCR1_SSI_PINS_1   4
> > > > +#define MX27_AUDMUX_PPCR2_SSI_PINS_2   5
> > > > +#define MX27_AUDMUX_PPCR3_SSI_PINS_3   6
> > > >
> > >
> > > Be careful,
> > > I think this patch breaks some of the boards currently using
> > > MXC_AUDMUX_V1_PCR_RXDSEL(x) and similar macros defined in mach/audmux.h
> > (for
> > > example pcm038).
> > > For those macros the old AUDMUX register indexes are fine.
> > >
> > > I suggest fixing this inside audmux_v1.c instead of modifying
> > mach/audmux.h.
> >
> > Ok. The AUDMUX V1 is used on i.MX21 and i.MX27 and both have this hole
> > in the register space, so fixing it in the driver should be safe.
> >
> > How about this one then?
> >
> > Sascha
> >
> >
> > From 297b5c4cea40c2e7023bbdb96a0c90c13b0e02a1 Mon Sep 17 00:00:00 2001
> > From: Sascha Hauer <s.hauer@pengutronix.de>
> > Date: Mon, 30 Nov 2009 13:31:29 +0100
> > Subject: [PATCH] i.MX27 audmux: Fix register offsets
> >
> > The PPCR registers start at 0x10, not 0xc. Fix this.
> >
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> >  arch/arm/plat-mxc/audmux-v1.c |    4 ++++
> >  1 files changed, 4 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/plat-mxc/audmux-v1.c b/arch/arm/plat-mxc/audmux-v1.c
> > index 70ab5af..8fbce7b 100644
> > --- a/arch/arm/plat-mxc/audmux-v1.c
> > +++ b/arch/arm/plat-mxc/audmux-v1.c
> > @@ -37,6 +37,10 @@ int mxc_audmux_v1_configure_port(unsigned int port,
> > unsigned int pcr)
> >                return -ENOSYS;
> >        }
> >
> > +       /* handle hole in the register space */
> > +       if (port > 2)
> > +               port++;
> > +
> >         writel(pcr, audmux_base + MXC_AUDMUX_V1_PCR(port));
> >
> >        return 0;
> > --
> > 1.6.5.2
> >
> 
> Sascha,
> there are actually two holes, with this current patch, PPCR3 still receives
> a wrong value:
> 
> 0x1001_6000 (HPCR1)
> 0x1001_6004 (HPCR2)
> 0x1001_6008 (HPCR3)
> 0x1001_600C (hole)
> 0x1001_6010 (PPCR1)
> 0x1001_6014 (PPCR2)
> 0x1001_6018 (hole)
> 0x1001_601C (PPCR3)

Grumpf. I'm not creating a new patch before getting some sleep.

Sascha

-- 
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 |

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 8/9 v2] MXC: Add a digital audio multiplexer driver
  2009-11-30 16:15                               ` javier Martin
  2009-11-30 16:18                                 ` Sascha Hauer
@ 2009-12-02 11:20                                 ` Sascha Hauer
  2009-12-02 12:46                                   ` javier Martin
  1 sibling, 1 reply; 30+ messages in thread
From: Sascha Hauer @ 2009-12-02 11:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 30, 2009 at 05:15:45PM +0100, javier Martin wrote:
> 
> Sascha,
> there are actually two holes, with this current patch, PPCR3 still receives
> a wrong value:
> 
> 0x1001_6000 (HPCR1)
> 0x1001_6004 (HPCR2)
> 0x1001_6008 (HPCR3)
> 0x1001_600C (hole)
> 0x1001_6010 (PPCR1)
> 0x1001_6014 (PPCR2)
> 0x1001_6018 (hole)
> 0x1001_601C (PPCR3)


Lets hope I had enough sleep this night...

Sascha

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 8/9 v2] MXC: Add a digital audio multiplexer driver
  2009-12-02 11:20                                 ` Sascha Hauer
@ 2009-12-02 12:46                                   ` javier Martin
  0 siblings, 0 replies; 30+ messages in thread
From: javier Martin @ 2009-12-02 12:46 UTC (permalink / raw)
  To: linux-arm-kernel

> From 4c8b581dd28588940a328632e406baab574e0ce5 Mon Sep 17 00:00:00 2001
> From: Sascha Hauer <s.hauer@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@pengutronix.de>
> ---
>  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
>

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

-- 
Javier Martin
Vista 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091202/f10ccfe5/attachment-0001.htm>

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2009-12-02 12:46 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-12 10:41 MXC patches for next merge window Sascha Hauer
2009-11-12 10:41 ` [PATCH 1/9] MXC NFC: Add the clock resource to support NFC in i.MX35 Sascha Hauer
2009-11-12 10:41   ` [PATCH 2/9] MXC NFC: Fix NFCs address area on i.MX35 Sascha Hauer
2009-11-12 10:41     ` [PATCH 3/9] pca100: Add board to uncompress.h Sascha Hauer
2009-11-12 10:42       ` [PATCH 4/9] pca100: use correct irq initialisation function Sascha Hauer
2009-11-12 10:42         ` [PATCH 5/9] pcm043: Add NAND support Sascha Hauer
2009-11-12 10:42           ` [PATCH 6/9] i.MX2: Add sound (ssi) resources Sascha Hauer
2009-11-12 10:42             ` [PATCH 7/9] i.MX3: " Sascha Hauer
2009-11-12 10:42               ` [PATCH 8/9] MXC: Add a digital audio multiplexer (DAM) driver Sascha Hauer
2009-11-12 10:42                 ` [PATCH 9/9] i.MX35: Fix audmux clock Sascha Hauer
2009-11-12 12:47                 ` [PATCH 8/9] MXC: Add a digital audio multiplexer (DAM) driver Mark Brown
2009-11-12 13:04                   ` Sascha Hauer
2009-11-12 15:06                 ` [PATCH 8/9 v2] MXC: Add a digital audio multiplexer driver Sascha Hauer
2009-11-12 22:32                   ` Russell King - ARM Linux
2009-11-13  7:29                     ` Sascha Hauer
2009-11-30 11:56                   ` javier Martin
2009-11-30 12:10                     ` Sascha Hauer
2009-11-30 12:25                       ` javier Martin
2009-11-30 12:34                         ` Sascha Hauer
2009-11-30 13:09                           ` javier Martin
2009-11-30 16:03                             ` Sascha Hauer
2009-11-30 16:15                               ` javier Martin
2009-11-30 16:18                                 ` Sascha Hauer
2009-12-02 11:20                                 ` Sascha Hauer
2009-12-02 12:46                                   ` javier Martin
2009-11-12 12:43           ` [PATCH 5/9] pcm043: Add NAND support Fabio Estevam
2009-11-12 13:06             ` Sascha Hauer
2009-11-12 20:04     ` [PATCH 2/9] MXC NFC: Fix NFCs address area on i.MX35 Magnus Lilja
2009-11-13  7:29       ` Sascha Hauer
2009-11-18  9:49 ` MXC patches for next merge window Sascha Hauer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.