All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/5] Support for OMAP4 Digital Microphone interface
@ 2011-11-28 13:45 Peter Ujfalusi
  2011-11-28 13:45 ` [PATCH v4 1/5] OMAP4: hwmod: Add names for DMIC memory address space Peter Ujfalusi
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Peter Ujfalusi @ 2011-11-28 13:45 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, Tony Lindgren
  Cc: alsa-devel, linux-omap, Benoit Cousson

Hello,

The following series will add support for OMAP4 DMIC interface, and enable them
on sdp4430/Blaze boards.

Changes since v3:
- dmic clk divider selection moved to hw_params phase to allow fixed rate
  configuration from machine driver init.

Changes since v2:
- Use module_platform_driver
- convert to use devm_
- Add clk_id for the output clock
- Extend the comment to explain why the driven can change the divider for 192KHz
  sampling rate.

Changes since v1:
- 192KHz rate support fixed (need to use different divider)
- Hold reference for dmic_fclk over the lifetime of the driver
- Removed the clkdiv callback, and replaced with frequency based configuration
  for the external components (dmic frequency)

Regards,
Peter
---
Peter Ujfalusi (5):
  OMAP4: hwmod: Add names for DMIC memory address space
  ASoC: OMAP4: omap-dmic: Initial support for OMAP DMIC
  OMAP4: devices: Register OMAP4 DMIC platform device
  OMAP4: board-4430sdp: Register platform device for digimic codec
  ASoC: sdp4430: Add support for digital microphones

 arch/arm/mach-omap2/board-4430sdp.c        |    6 +
 arch/arm/mach-omap2/devices.c              |   22 ++
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    2 +
 sound/soc/omap/Kconfig                     |    5 +
 sound/soc/omap/Makefile                    |    2 +
 sound/soc/omap/omap-dmic.c                 |  549 ++++++++++++++++++++++++++++
 sound/soc/omap/omap-dmic.h                 |   69 ++++
 sound/soc/omap/sdp4430.c                   |   85 ++++-
 8 files changed, 729 insertions(+), 11 deletions(-)
 create mode 100644 sound/soc/omap/omap-dmic.c
 create mode 100644 sound/soc/omap/omap-dmic.h

-- 
1.7.8.rc3


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

* [PATCH v4 1/5] OMAP4: hwmod: Add names for DMIC memory address space
  2011-11-28 13:45 [PATCH v4 0/5] Support for OMAP4 Digital Microphone interface Peter Ujfalusi
@ 2011-11-28 13:45 ` Peter Ujfalusi
  2011-12-16  6:28   ` Paul Walmsley
  2011-11-28 13:45 ` [PATCH v4 2/5] ASoC: OMAP4: omap-dmic: Initial support for OMAP DMIC Peter Ujfalusi
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 19+ messages in thread
From: Peter Ujfalusi @ 2011-11-28 13:45 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, Tony Lindgren
  Cc: alsa-devel, linux-omap, Benoit Cousson

To be able to get the memory resources by name from
the DMIC driver (for MPU and for DMA).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 7695e5d..8b75c60 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -1028,6 +1028,7 @@ static struct omap_hwmod_dma_info omap44xx_dmic_sdma_reqs[] = {
 
 static struct omap_hwmod_addr_space omap44xx_dmic_addrs[] = {
 	{
+		.name		= "mpu",
 		.pa_start	= 0x4012e000,
 		.pa_end		= 0x4012e07f,
 		.flags		= ADDR_TYPE_RT
@@ -1046,6 +1047,7 @@ static struct omap_hwmod_ocp_if omap44xx_l4_abe__dmic = {
 
 static struct omap_hwmod_addr_space omap44xx_dmic_dma_addrs[] = {
 	{
+		.name		= "dma",
 		.pa_start	= 0x4902e000,
 		.pa_end		= 0x4902e07f,
 		.flags		= ADDR_TYPE_RT
-- 
1.7.8.rc3


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

* [PATCH v4 2/5] ASoC: OMAP4: omap-dmic: Initial support for OMAP DMIC
  2011-11-28 13:45 [PATCH v4 0/5] Support for OMAP4 Digital Microphone interface Peter Ujfalusi
  2011-11-28 13:45 ` [PATCH v4 1/5] OMAP4: hwmod: Add names for DMIC memory address space Peter Ujfalusi
@ 2011-11-28 13:45 ` Peter Ujfalusi
  2011-11-28 17:21   ` Mark Brown
  2011-11-28 13:45 ` [PATCH v4 3/5] OMAP4: devices: Register OMAP4 DMIC platform device Peter Ujfalusi
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 19+ messages in thread
From: Peter Ujfalusi @ 2011-11-28 13:45 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, Tony Lindgren
  Cc: alsa-devel, linux-omap, Benoit Cousson

Add support for OMAP4 Digital Microphone interface.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/Kconfig     |    3 +
 sound/soc/omap/Makefile    |    2 +
 sound/soc/omap/omap-dmic.c |  549 ++++++++++++++++++++++++++++++++++++++++++++
 sound/soc/omap/omap-dmic.h |   69 ++++++
 4 files changed, 623 insertions(+), 0 deletions(-)
 create mode 100644 sound/soc/omap/omap-dmic.c
 create mode 100644 sound/soc/omap/omap-dmic.h

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index fe83d0d..052254a 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -2,6 +2,9 @@ config SND_OMAP_SOC
 	tristate "SoC Audio for the Texas Instruments OMAP chips"
 	depends on ARCH_OMAP
 
+config SND_OMAP_SOC_DMIC
+	tristate
+
 config SND_OMAP_SOC_MCBSP
 	tristate
 	select OMAP_MCBSP
diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
index 052fd75..1fd723f 100644
--- a/sound/soc/omap/Makefile
+++ b/sound/soc/omap/Makefile
@@ -1,10 +1,12 @@
 # OMAP Platform Support
 snd-soc-omap-objs := omap-pcm.o
+snd-soc-omap-dmic-objs := omap-dmic.o
 snd-soc-omap-mcbsp-objs := omap-mcbsp.o
 snd-soc-omap-mcpdm-objs := omap-mcpdm.o
 snd-soc-omap-hdmi-objs := omap-hdmi.o
 
 obj-$(CONFIG_SND_OMAP_SOC) += snd-soc-omap.o
+obj-$(CONFIG_SND_OMAP_SOC_DMIC) += snd-soc-omap-dmic.o
 obj-$(CONFIG_SND_OMAP_SOC_MCBSP) += snd-soc-omap-mcbsp.o
 obj-$(CONFIG_SND_OMAP_SOC_MCPDM) += snd-soc-omap-mcpdm.o
 obj-$(CONFIG_SND_OMAP_SOC_HDMI) += snd-soc-omap-hdmi.o
diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c
new file mode 100644
index 0000000..9c73c0c
--- /dev/null
+++ b/sound/soc/omap/omap-dmic.c
@@ -0,0 +1,549 @@
+/*
+ * omap-dmic.c  --  OMAP ASoC DMIC DAI driver
+ *
+ * Copyright (C) 2010 - 2011 Texas Instruments
+ *
+ * Author: David Lambert <dlambert@ti.com>
+ *	   Misael Lopez Cruz <misael.lopez@ti.com>
+ *	   Liam Girdwood <lrg@ti.com>
+ *	   Peter Ujfalusi <peter.ujfalusi@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/err.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+#include <linux/pm_runtime.h>
+#include <plat/dma.h>
+
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/initval.h>
+#include <sound/soc.h>
+
+#include "omap-pcm.h"
+#include "omap-dmic.h"
+
+struct omap_dmic {
+	struct device *dev;
+	void __iomem *io_base;
+	struct clk *fclk;
+	int fclk_freq;
+	int out_freq;
+	int clk_div;
+	int sysclk;
+	int threshold;
+	u32 ch_enabled;
+	bool active;
+	struct mutex mutex;
+};
+
+/*
+ * Stream DMA parameters
+ */
+static struct omap_pcm_dma_data omap_dmic_dai_dma_params = {
+	.name		= "DMIC capture",
+	.data_type	= OMAP_DMA_DATA_TYPE_S32,
+	.sync_mode	= OMAP_DMA_SYNC_PACKET,
+};
+
+static inline void omap_dmic_write(struct omap_dmic *dmic, u16 reg, u32 val)
+{
+	__raw_writel(val, dmic->io_base + reg);
+}
+
+static inline int omap_dmic_read(struct omap_dmic *dmic, u16 reg)
+{
+	return __raw_readl(dmic->io_base + reg);
+}
+
+static inline void omap_dmic_start(struct omap_dmic *dmic)
+{
+	u32 ctrl = omap_dmic_read(dmic, OMAP_DMIC_CTRL_REG);
+
+	/* Configure DMA controller */
+	omap_dmic_write(dmic, OMAP_DMIC_DMAENABLE_SET_REG,
+			OMAP_DMIC_DMA_ENABLE);
+
+	omap_dmic_write(dmic, OMAP_DMIC_CTRL_REG, ctrl | dmic->ch_enabled);
+}
+
+static inline void omap_dmic_stop(struct omap_dmic *dmic)
+{
+	u32 ctrl = omap_dmic_read(dmic, OMAP_DMIC_CTRL_REG);
+	omap_dmic_write(dmic, OMAP_DMIC_CTRL_REG,
+			ctrl & ~OMAP_DMIC_UP_ENABLE_MASK);
+
+	/* Disable DMA request generation */
+	omap_dmic_write(dmic, OMAP_DMIC_DMAENABLE_CLR_REG,
+			OMAP_DMIC_DMA_ENABLE);
+
+}
+
+static inline int dmic_is_enabled(struct omap_dmic *dmic)
+{
+	return omap_dmic_read(dmic, OMAP_DMIC_CTRL_REG) &
+						OMAP_DMIC_UP_ENABLE_MASK;
+}
+
+static int omap_dmic_dai_startup(struct snd_pcm_substream *substream,
+				  struct snd_soc_dai *dai)
+{
+	struct omap_dmic *dmic = snd_soc_dai_get_drvdata(dai);
+	int ret = 0;
+
+	mutex_lock(&dmic->mutex);
+
+	if (!dai->active) {
+		pm_runtime_get_sync(dmic->dev);
+		snd_pcm_hw_constraint_msbits(substream->runtime, 0, 32, 24);
+		dmic->active = 1;
+	} else {
+		ret = -EBUSY;
+	}
+
+	mutex_unlock(&dmic->mutex);
+
+	return ret;
+}
+
+static void omap_dmic_dai_shutdown(struct snd_pcm_substream *substream,
+				    struct snd_soc_dai *dai)
+{
+	struct omap_dmic *dmic = snd_soc_dai_get_drvdata(dai);
+
+	mutex_lock(&dmic->mutex);
+
+	if (!dai->active) {
+		pm_runtime_put_sync(dmic->dev);
+		dmic->active = 0;
+	}
+
+	mutex_unlock(&dmic->mutex);
+}
+
+static int omap_dmic_select_divider(struct omap_dmic *dmic, int sample_rate)
+{
+	int divider = -EINVAL;
+
+	/*
+	 * 192KHz rate is only supported with 19.2MHz/3.84MHz clock
+	 * configuration.
+	 */
+	if (sample_rate == 192000) {
+		if (dmic->fclk_freq == 19200000 && dmic->out_freq == 3840000)
+			divider = 0x6; /* Divider: 5 (192KHz sampling rate) */
+		else
+			dev_err(dmic->dev,
+				"invalid clock configuration for 192KHz\n");
+
+		return divider;
+	}
+
+	switch (dmic->out_freq) {
+	case 1536000:
+		if (dmic->fclk_freq != 24576000)
+			goto div_err;
+		divider = 0x4; /* Divider: 16 */
+		break;
+	case 2400000:
+		switch (dmic->fclk_freq) {
+		case 12000000:
+			divider = 0x5; /* Divider: 5 */
+			break;
+		case 19200000:
+			divider = 0x0; /* Divider: 8 */
+			break;
+		case 24000000:
+			divider = 0x2; /* Divider: 10 */
+			break;
+		default:
+			goto div_err;
+		}
+		break;
+	case 3072000:
+		if (dmic->fclk_freq != 24576000)
+			goto div_err;
+		divider = 0x3; /* Divider: 8 */
+		break;
+	case 3840000:
+		if (dmic->fclk_freq != 19200000)
+			goto div_err;
+		divider = 0x1; /* Divider: 5 (96KHz sampling rate) */
+		break;
+	default:
+		dev_err(dmic->dev, "invalid out frequency: %dHz\n",
+			dmic->out_freq);
+		break;
+	}
+
+	return divider;
+
+div_err:
+	dev_err(dmic->dev, "invalid out frequency %dHz for %dHz input\n",
+		dmic->out_freq, dmic->fclk_freq);
+	return -EINVAL;
+}
+
+static int omap_dmic_dai_hw_params(struct snd_pcm_substream *substream,
+				    struct snd_pcm_hw_params *params,
+				    struct snd_soc_dai *dai)
+{
+	struct omap_dmic *dmic = snd_soc_dai_get_drvdata(dai);
+	int channels;
+
+	dmic->clk_div = omap_dmic_select_divider(dmic, params_rate(params));
+	if (dmic->clk_div < 0) {
+		dev_err(dmic->dev, "no valid divider for %dHz from %dHz\n",
+			dmic->out_freq, dmic->fclk_freq);
+		return -EINVAL;
+	}
+
+	dmic->ch_enabled = 0;
+	channels = params_channels(params);
+	switch (channels) {
+	case 6:
+		dmic->ch_enabled |= OMAP_DMIC_UP3_ENABLE;
+	case 4:
+		dmic->ch_enabled |= OMAP_DMIC_UP2_ENABLE;
+	case 2:
+		dmic->ch_enabled |= OMAP_DMIC_UP1_ENABLE;
+		break;
+	default:
+		dev_err(dmic->dev, "invalid number of legacy channels\n");
+		return -EINVAL;
+	}
+
+	/* packet size is threshold * channels */
+	omap_dmic_dai_dma_params.packet_size = dmic->threshold * channels;
+	snd_soc_dai_set_dma_data(dai, substream, &omap_dmic_dai_dma_params);
+
+	return 0;
+}
+
+static int omap_dmic_dai_prepare(struct snd_pcm_substream *substream,
+				  struct snd_soc_dai *dai)
+{
+	struct omap_dmic *dmic = snd_soc_dai_get_drvdata(dai);
+	u32 ctrl;
+
+	/* Configure uplink threshold */
+	omap_dmic_write(dmic, OMAP_DMIC_FIFO_CTRL_REG, dmic->threshold);
+
+	ctrl = omap_dmic_read(dmic, OMAP_DMIC_CTRL_REG);
+
+	/* Set dmic out format */
+	ctrl &= ~(OMAP_DMIC_FORMAT | OMAP_DMIC_POLAR_MASK);
+	ctrl |= (OMAP_DMICOUTFORMAT_LJUST | OMAP_DMIC_POLAR1 |
+		 OMAP_DMIC_POLAR2 | OMAP_DMIC_POLAR3);
+
+	/* Configure dmic clock divider */
+	ctrl &= ~OMAP_DMIC_CLK_DIV_MASK;
+	ctrl |= OMAP_DMIC_CLK_DIV(dmic->clk_div);
+
+	omap_dmic_write(dmic, OMAP_DMIC_CTRL_REG, ctrl);
+
+	omap_dmic_write(dmic, OMAP_DMIC_CTRL_REG,
+			ctrl | OMAP_DMICOUTFORMAT_LJUST | OMAP_DMIC_POLAR1 |
+			OMAP_DMIC_POLAR2 | OMAP_DMIC_POLAR3);
+
+	return 0;
+}
+
+static int omap_dmic_dai_trigger(struct snd_pcm_substream *substream,
+				  int cmd, struct snd_soc_dai *dai)
+{
+	struct omap_dmic *dmic = snd_soc_dai_get_drvdata(dai);
+
+	switch (cmd) {
+	case SNDRV_PCM_TRIGGER_START:
+		omap_dmic_start(dmic);
+		break;
+	case SNDRV_PCM_TRIGGER_STOP:
+		omap_dmic_stop(dmic);
+		break;
+	default:
+		break;
+	}
+
+	return 0;
+}
+
+static int omap_dmic_select_fclk(struct omap_dmic *dmic, int clk_id,
+				 unsigned int freq)
+{
+	struct clk *parent_clk;
+	char *parent_clk_name;
+	int ret = 0;
+
+	switch (freq) {
+	case 12000000:
+	case 19200000:
+	case 24000000:
+	case 24576000:
+		break;
+	default:
+		dev_err(dmic->dev, "invalid input frequency: %dHz\n", freq);
+		dmic->fclk_freq = 0;
+		return -EINVAL;
+	}
+
+	if (dmic->sysclk == clk_id) {
+		dmic->fclk_freq = freq;
+		return 0;
+	}
+
+	/* re-parent not allowed if a stream is ongoing */
+	if (dmic->active && dmic_is_enabled(dmic)) {
+		dev_err(dmic->dev, "can't re-parent when DMIC active\n");
+		return -EBUSY;
+	}
+
+	switch (clk_id) {
+	case OMAP_DMIC_SYSCLK_PAD_CLKS:
+		parent_clk_name = "pad_clks_ck";
+		break;
+	case OMAP_DMIC_SYSCLK_SLIMBLUS_CLKS:
+		parent_clk_name = "slimbus_clk";
+		break;
+	case OMAP_DMIC_SYSCLK_SYNC_MUX_CLKS:
+		parent_clk_name = "dmic_sync_mux_ck";
+		break;
+	default:
+		dev_err(dmic->dev, "fclk clk_id (%d) not supported\n", clk_id);
+		return -EINVAL;
+	}
+
+	parent_clk = clk_get(dmic->dev, parent_clk_name);
+	if (IS_ERR(parent_clk)) {
+		dev_err(dmic->dev, "can't get %s\n", parent_clk_name);
+		return -ENODEV;
+	}
+
+	mutex_lock(&dmic->mutex);
+	if (dmic->active) {
+		/* disable clock while reparenting */
+		pm_runtime_put_sync(dmic->dev);
+		ret = clk_set_parent(dmic->fclk, parent_clk);
+		pm_runtime_get_sync(dmic->dev);
+	} else {
+		ret = clk_set_parent(dmic->fclk, parent_clk);
+	}
+	mutex_unlock(&dmic->mutex);
+
+	if (ret < 0) {
+		dev_err(dmic->dev, "re-parent failed\n");
+		goto err_busy;
+	}
+
+	dmic->sysclk = clk_id;
+	dmic->fclk_freq = freq;
+
+err_busy:
+	clk_put(parent_clk);
+
+	return ret;
+}
+
+static int omap_dmic_select_outclk(struct omap_dmic *dmic, int clk_id,
+				    unsigned int freq)
+{
+	int ret = 0;
+
+	if (clk_id != OMAP_DMIC_ABE_DMIC_CLK) {
+		dev_err(dmic->dev, "output clk_id (%d) not supported\n",
+			clk_id);
+		return -EINVAL;
+	}
+
+	switch (freq) {
+	case 1536000:
+	case 2400000:
+	case 3072000:
+	case 3840000:
+		dmic->out_freq = freq;
+		break;
+	default:
+		dev_err(dmic->dev, "invalid out frequency: %dHz\n", freq);
+		dmic->out_freq = 0;
+		ret = -EINVAL;
+	}
+
+	return ret;
+}
+
+static int omap_dmic_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
+				    unsigned int freq, int dir)
+{
+	struct omap_dmic *dmic = snd_soc_dai_get_drvdata(dai);
+
+	if (dir == SND_SOC_CLOCK_IN)
+		return omap_dmic_select_fclk(dmic, clk_id, freq);
+	else if (dir == SND_SOC_CLOCK_OUT)
+		return omap_dmic_select_outclk(dmic, clk_id, freq);
+
+	dev_err(dmic->dev, "invalid clock direction (%d)\n", dir);
+	return -EINVAL;
+}
+
+static const struct snd_soc_dai_ops omap_dmic_dai_ops = {
+	.startup	= omap_dmic_dai_startup,
+	.shutdown	= omap_dmic_dai_shutdown,
+	.hw_params	= omap_dmic_dai_hw_params,
+	.prepare	= omap_dmic_dai_prepare,
+	.trigger	= omap_dmic_dai_trigger,
+	.set_sysclk	= omap_dmic_set_dai_sysclk,
+};
+
+static int omap_dmic_probe(struct snd_soc_dai *dai)
+{
+	struct omap_dmic *dmic = snd_soc_dai_get_drvdata(dai);
+
+	pm_runtime_enable(dmic->dev);
+
+	/* Disable lines while request is ongoing */
+	pm_runtime_get_sync(dmic->dev);
+	omap_dmic_write(dmic, OMAP_DMIC_CTRL_REG, 0x00);
+	pm_runtime_put_sync(dmic->dev);
+
+	/* Configure DMIC threshold value */
+	dmic->threshold = OMAP_DMIC_THRES_MAX - 3;
+	return 0;
+}
+
+static int omap_dmic_remove(struct snd_soc_dai *dai)
+{
+	struct omap_dmic *dmic = snd_soc_dai_get_drvdata(dai);
+
+	pm_runtime_disable(dmic->dev);
+
+	return 0;
+}
+
+static struct snd_soc_dai_driver omap_dmic_dai = {
+	.name = "omap-dmic",
+	.probe = omap_dmic_probe,
+	.remove = omap_dmic_remove,
+	.capture = {
+		.channels_min = 2,
+		.channels_max = 6,
+		.rates = SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000,
+		.formats = SNDRV_PCM_FMTBIT_S32_LE,
+	},
+	.ops = &omap_dmic_dai_ops,
+};
+
+static __devinit int asoc_dmic_probe(struct platform_device *pdev)
+{
+	struct omap_dmic *dmic;
+	struct resource *res;
+	int ret;
+
+	dmic = devm_kzalloc(&pdev->dev, sizeof(struct omap_dmic), GFP_KERNEL);
+	if (!dmic)
+		return -ENOMEM;
+
+	platform_set_drvdata(pdev, dmic);
+	dmic->dev = &pdev->dev;
+	dmic->sysclk = OMAP_DMIC_SYSCLK_SYNC_MUX_CLKS;
+
+	mutex_init(&dmic->mutex);
+
+	dmic->fclk = clk_get(dmic->dev, "dmic_fck");
+	if (IS_ERR(dmic->fclk)) {
+		dev_err(dmic->dev, "cant get dmic_fck\n");
+		return -ENODEV;
+	}
+
+	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma");
+	if (!res) {
+		dev_err(dmic->dev, "invalid dma memory resource\n");
+		ret = -ENODEV;
+		goto err_put_clk;
+	}
+	omap_dmic_dai_dma_params.port_addr = res->start + OMAP_DMIC_DATA_REG;
+
+	res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
+	if (!res) {
+		dev_err(dmic->dev, "invalid dma resource\n");
+		ret = -ENODEV;
+		goto err_put_clk;
+	}
+	omap_dmic_dai_dma_params.dma_req = res->start;
+
+	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu");
+	if (!res) {
+		dev_err(dmic->dev, "invalid memory resource\n");
+		ret = -ENODEV;
+		goto err_put_clk;
+	}
+
+	if (!devm_request_mem_region(&pdev->dev, res->start,
+				     resource_size(res), pdev->name)) {
+		dev_err(dmic->dev, "memory region already claimed\n");
+		ret = -ENODEV;
+		goto err_put_clk;
+	}
+
+	dmic->io_base = devm_ioremap(&pdev->dev, res->start,
+				     resource_size(res));
+	if (!dmic->io_base) {
+		ret = -ENOMEM;
+		goto err_put_clk;
+	}
+
+	ret = snd_soc_register_dai(&pdev->dev, &omap_dmic_dai);
+	if (ret)
+		goto err_put_clk;
+
+	return 0;
+
+err_put_clk:
+	clk_put(dmic->fclk);
+	return ret;
+}
+
+static int __devexit asoc_dmic_remove(struct platform_device *pdev)
+{
+	struct omap_dmic *dmic = platform_get_drvdata(pdev);
+
+	snd_soc_unregister_dai(&pdev->dev);
+	clk_put(dmic->fclk);
+
+	return 0;
+}
+
+static struct platform_driver asoc_dmic_driver = {
+	.driver = {
+		.name = "omap-dmic",
+		.owner = THIS_MODULE,
+	},
+	.probe = asoc_dmic_probe,
+	.remove = __devexit_p(asoc_dmic_remove),
+};
+
+module_platform_driver(asoc_dmic_driver);
+
+MODULE_ALIAS("platform:omap-dmic");
+MODULE_AUTHOR("Peter Ujfalusi <peter.ujfalusi@ti.com>");
+MODULE_DESCRIPTION("OMAP DMIC ASoC Interface");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/omap/omap-dmic.h b/sound/soc/omap/omap-dmic.h
new file mode 100644
index 0000000..231e728
--- /dev/null
+++ b/sound/soc/omap/omap-dmic.h
@@ -0,0 +1,69 @@
+/*
+ * omap-dmic.h  --  OMAP Digital Microphone Controller
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _OMAP_DMIC_H
+#define _OMAP_DMIC_H
+
+#define OMAP_DMIC_REVISION_REG		0x00
+#define OMAP_DMIC_SYSCONFIG_REG		0x10
+#define OMAP_DMIC_IRQSTATUS_RAW_REG	0x24
+#define OMAP_DMIC_IRQSTATUS_REG		0x28
+#define OMAP_DMIC_IRQENABLE_SET_REG	0x2C
+#define OMAP_DMIC_IRQENABLE_CLR_REG	0x30
+#define OMAP_DMIC_IRQWAKE_EN_REG	0x34
+#define OMAP_DMIC_DMAENABLE_SET_REG	0x38
+#define OMAP_DMIC_DMAENABLE_CLR_REG	0x3C
+#define OMAP_DMIC_DMAWAKEEN_REG		0x40
+#define OMAP_DMIC_CTRL_REG		0x44
+#define OMAP_DMIC_DATA_REG		0x48
+#define OMAP_DMIC_FIFO_CTRL_REG		0x4C
+#define OMAP_DMIC_FIFO_DMIC1R_DATA_REG	0x50
+#define OMAP_DMIC_FIFO_DMIC1L_DATA_REG	0x54
+#define OMAP_DMIC_FIFO_DMIC2R_DATA_REG	0x58
+#define OMAP_DMIC_FIFO_DMIC2L_DATA_REG	0x5C
+#define OMAP_DMIC_FIFO_DMIC3R_DATA_REG	0x60
+#define OMAP_DMIC_FIFO_DMIC3L_DATA_REG	0x64
+
+/* IRQSTATUS_RAW, IRQSTATUS, IRQENABLE_SET, IRQENABLE_CLR bit fields */
+#define OMAP_DMIC_IRQ			(1 << 0)
+#define OMAP_DMIC_IRQ_FULL		(1 << 1)
+#define OMAP_DMIC_IRQ_ALMST_EMPTY	(1 << 2)
+#define OMAP_DMIC_IRQ_EMPTY		(1 << 3)
+#define OMAP_DMIC_IRQ_MASK		0x07
+
+/* DMIC_DMAENABLE bit fields */
+#define OMAP_DMIC_DMA_ENABLE		0x1
+
+/* DMIC_CTRL bit fields */
+#define OMAP_DMIC_UP1_ENABLE		(1 << 0)
+#define OMAP_DMIC_UP2_ENABLE		(1 << 1)
+#define OMAP_DMIC_UP3_ENABLE		(1 << 2)
+#define OMAP_DMIC_UP_ENABLE_MASK	0x7
+#define OMAP_DMIC_FORMAT		(1 << 3)
+#define OMAP_DMIC_POLAR1		(1 << 4)
+#define OMAP_DMIC_POLAR2		(1 << 5)
+#define OMAP_DMIC_POLAR3		(1 << 6)
+#define OMAP_DMIC_POLAR_MASK		(0x7 << 4)
+#define OMAP_DMIC_CLK_DIV(x)		(((x) & 0x7) << 7)
+#define OMAP_DMIC_CLK_DIV_MASK		(0x7 << 7)
+#define	OMAP_DMIC_RESET			(1 << 10)
+
+#define OMAP_DMICOUTFORMAT_LJUST	(0 << 3)
+#define OMAP_DMICOUTFORMAT_RJUST	(1 << 3)
+
+/* DMIC_FIFO_CTRL bit fields */
+#define OMAP_DMIC_THRES_MAX		0xF
+
+enum omap_dmic_clk {
+	OMAP_DMIC_SYSCLK_PAD_CLKS,		/* PAD_CLKS */
+	OMAP_DMIC_SYSCLK_SLIMBLUS_CLKS,		/* SLIMBUS_CLK */
+	OMAP_DMIC_SYSCLK_SYNC_MUX_CLKS,		/* DMIC_SYNC_MUX_CLK */
+	OMAP_DMIC_ABE_DMIC_CLK,			/* abe_dmic_clk */
+};
+
+#endif
-- 
1.7.8.rc3


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

* [PATCH v4 3/5] OMAP4: devices: Register OMAP4 DMIC platform device
  2011-11-28 13:45 [PATCH v4 0/5] Support for OMAP4 Digital Microphone interface Peter Ujfalusi
  2011-11-28 13:45 ` [PATCH v4 1/5] OMAP4: hwmod: Add names for DMIC memory address space Peter Ujfalusi
  2011-11-28 13:45 ` [PATCH v4 2/5] ASoC: OMAP4: omap-dmic: Initial support for OMAP DMIC Peter Ujfalusi
@ 2011-11-28 13:45 ` Peter Ujfalusi
  2011-12-09 21:03   ` Tony Lindgren
  2011-11-28 13:45 ` [PATCH v4 4/5] OMAP4: board-4430sdp: Register platform device for digimic codec Peter Ujfalusi
  2011-11-28 13:45 ` [PATCH v4 5/5] ASoC: sdp4430: Add support for digital microphones Peter Ujfalusi
  4 siblings, 1 reply; 19+ messages in thread
From: Peter Ujfalusi @ 2011-11-28 13:45 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, Tony Lindgren
  Cc: alsa-devel, linux-omap, Benoit Cousson

Add platform device registration for OMAP4 DMIC.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 arch/arm/mach-omap2/devices.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index c15cfad..35d5dff 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -336,6 +336,27 @@ static void omap_init_mcpdm(void)
 static inline void omap_init_mcpdm(void) {}
 #endif
 
+#if defined(CONFIG_SND_OMAP_SOC_DMIC) || \
+		defined(CONFIG_SND_OMAP_SOC_DMIC_MODULE)
+
+static void omap_init_dmic(void)
+{
+	struct omap_hwmod *oh;
+	struct platform_device *pdev;
+
+	oh = omap_hwmod_lookup("dmic");
+	if (!oh) {
+		printk(KERN_ERR "Could not look up mcpdm hw_mod\n");
+		return;
+	}
+
+	pdev = omap_device_build("omap-dmic", -1, oh, NULL, 0, NULL, 0, 0);
+	WARN(IS_ERR(pdev), "Can't build omap_device for omap-dmic.\n");
+}
+#else
+static inline void omap_init_dmic(void) {}
+#endif
+
 #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
 
 #include <plat/mcspi.h>
@@ -681,6 +702,7 @@ static int __init omap2_init_devices(void)
 	 */
 	omap_init_audio();
 	omap_init_mcpdm();
+	omap_init_dmic();
 	omap_init_camera();
 	omap_init_mbox();
 	omap_init_mcspi();
-- 
1.7.8.rc3


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

* [PATCH v4 4/5] OMAP4: board-4430sdp: Register platform device for digimic codec
  2011-11-28 13:45 [PATCH v4 0/5] Support for OMAP4 Digital Microphone interface Peter Ujfalusi
                   ` (2 preceding siblings ...)
  2011-11-28 13:45 ` [PATCH v4 3/5] OMAP4: devices: Register OMAP4 DMIC platform device Peter Ujfalusi
@ 2011-11-28 13:45 ` Peter Ujfalusi
  2011-11-28 13:45 ` [PATCH v4 5/5] ASoC: sdp4430: Add support for digital microphones Peter Ujfalusi
  4 siblings, 0 replies; 19+ messages in thread
From: Peter Ujfalusi @ 2011-11-28 13:45 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, Tony Lindgren
  Cc: alsa-devel, linux-omap, Benoit Cousson

OMAP4 SDP/Blaze boards have onboard digital microphones.
Register the platform device for the dmic-codec to be
able to use the microphones.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 arch/arm/mach-omap2/board-4430sdp.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 5156468..503bf28 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -372,11 +372,17 @@ static struct platform_device sdp4430_vbat = {
 	},
 };
 
+static struct platform_device sdp4430_dmic_codec = {
+	.name	= "dmic-codec",
+	.id	= -1,
+};
+
 static struct platform_device *sdp4430_devices[] __initdata = {
 	&sdp4430_gpio_keys_device,
 	&sdp4430_leds_gpio,
 	&sdp4430_leds_pwm,
 	&sdp4430_vbat,
+	&sdp4430_dmic_codec,
 };
 
 static struct omap_musb_board_data musb_board_data = {
-- 
1.7.8.rc3


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

* [PATCH v4 5/5] ASoC: sdp4430: Add support for digital microphones
  2011-11-28 13:45 [PATCH v4 0/5] Support for OMAP4 Digital Microphone interface Peter Ujfalusi
                   ` (3 preceding siblings ...)
  2011-11-28 13:45 ` [PATCH v4 4/5] OMAP4: board-4430sdp: Register platform device for digimic codec Peter Ujfalusi
@ 2011-11-28 13:45 ` Peter Ujfalusi
  2011-11-28 17:22   ` Mark Brown
  4 siblings, 1 reply; 19+ messages in thread
From: Peter Ujfalusi @ 2011-11-28 13:45 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, Tony Lindgren
  Cc: alsa-devel, linux-omap, Benoit Cousson

OMAP4 SDP/Blaze boards have digital microphones.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/Kconfig   |    2 +
 sound/soc/omap/sdp4430.c |   85 ++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 76 insertions(+), 11 deletions(-)

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 052254a..fb1bf25 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -100,8 +100,10 @@ config SND_OMAP_SOC_SDP3430
 config SND_OMAP_SOC_SDP4430
 	tristate "SoC Audio support for Texas Instruments SDP4430"
 	depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_4430SDP
+	select SND_OMAP_SOC_DMIC
 	select SND_OMAP_SOC_MCPDM
 	select SND_SOC_TWL6040
+	select SND_SOC_DMIC
 	help
 	  Say Y if you want to add support for SoC audio on Texas Instruments
 	  SDP4430.
diff --git a/sound/soc/omap/sdp4430.c b/sound/soc/omap/sdp4430.c
index 03d9fa4..2735fa0 100644
--- a/sound/soc/omap/sdp4430.c
+++ b/sound/soc/omap/sdp4430.c
@@ -33,6 +33,7 @@
 #include <plat/hardware.h>
 #include <plat/mux.h>
 
+#include "omap-dmic.h"
 #include "omap-mcpdm.h"
 #include "omap-pcm.h"
 #include "../codecs/twl6040.h"
@@ -67,6 +68,32 @@ static struct snd_soc_ops sdp4430_ops = {
 	.hw_params = sdp4430_hw_params,
 };
 
+static int sdp4430_dmic_hw_params(struct snd_pcm_substream *substream,
+	struct snd_pcm_hw_params *params)
+{
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
+	int ret = 0;
+
+	ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_DMIC_SYSCLK_PAD_CLKS,
+				     19200000, SND_SOC_CLOCK_IN);
+	if (ret < 0) {
+		printk(KERN_ERR "can't set DMIC cpu system clock\n");
+		return ret;
+	}
+	ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_DMIC_ABE_DMIC_CLK, 2400000,
+				     SND_SOC_CLOCK_OUT);
+	if (ret < 0) {
+		printk(KERN_ERR "can't set DMIC output clock\n");
+		return ret;
+	}
+	return 0;
+}
+
+static struct snd_soc_ops sdp4430_dmic_ops = {
+	.hw_params = sdp4430_dmic_hw_params,
+};
+
 /* Headset jack */
 static struct snd_soc_jack hs_jack;
 
@@ -148,23 +175,59 @@ static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd)
 	return ret;
 }
 
+static const struct snd_soc_dapm_widget sdp4430_dmic_dapm_widgets[] = {
+	SND_SOC_DAPM_MIC("Digital Mic", NULL),
+};
+
+static const struct snd_soc_dapm_route dmic_audio_map[] = {
+	{"DMic", NULL, "Digital Mic1 Bias"},
+	{"Digital Mic1 Bias", NULL, "Digital Mic"},
+};
+
+static int sdp4430_dmic_init(struct snd_soc_pcm_runtime *rtd)
+{
+	struct snd_soc_codec *codec = rtd->codec;
+	struct snd_soc_dapm_context *dapm = &codec->dapm;
+	int ret;
+
+	ret = snd_soc_dapm_new_controls(dapm, sdp4430_dmic_dapm_widgets,
+				ARRAY_SIZE(sdp4430_dmic_dapm_widgets));
+	if (ret)
+		return ret;
+
+	return snd_soc_dapm_add_routes(dapm, dmic_audio_map,
+				ARRAY_SIZE(dmic_audio_map));
+}
+
 /* Digital audio interface glue - connects codec <--> CPU */
-static struct snd_soc_dai_link sdp4430_dai = {
-	.name = "TWL6040",
-	.stream_name = "TWL6040",
-	.cpu_dai_name = "omap-mcpdm",
-	.codec_dai_name = "twl6040-legacy",
-	.platform_name = "omap-pcm-audio",
-	.codec_name = "twl6040-codec",
-	.init = sdp4430_twl6040_init,
-	.ops = &sdp4430_ops,
+static struct snd_soc_dai_link sdp4430_dai[] = {
+	{
+		.name = "TWL6040",
+		.stream_name = "TWL6040",
+		.cpu_dai_name = "omap-mcpdm",
+		.codec_dai_name = "twl6040-legacy",
+		.platform_name = "omap-pcm-audio",
+		.codec_name = "twl6040-codec",
+		.init = sdp4430_twl6040_init,
+		.ops = &sdp4430_ops,
+	},
+	{
+		.name = "DMIC",
+		.stream_name = "DMIC Capture",
+		.cpu_dai_name = "omap-dmic",
+		.codec_dai_name = "dmic-hifi",
+		.platform_name = "omap-pcm-audio",
+		.codec_name = "dmic-codec",
+		.init = sdp4430_dmic_init,
+		.ops = &sdp4430_dmic_ops,
+	},
 };
 
 /* Audio machine driver */
 static struct snd_soc_card snd_soc_sdp4430 = {
 	.name = "SDP4430",
-	.dai_link = &sdp4430_dai,
-	.num_links = 1,
+	.dai_link = sdp4430_dai,
+	.num_links = ARRAY_SIZE(sdp4430_dai),
 
 	.dapm_widgets = sdp4430_twl6040_dapm_widgets,
 	.num_dapm_widgets = ARRAY_SIZE(sdp4430_twl6040_dapm_widgets),
-- 
1.7.8.rc3


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

* Re: [PATCH v4 2/5] ASoC: OMAP4: omap-dmic: Initial support for OMAP DMIC
  2011-11-28 13:45 ` [PATCH v4 2/5] ASoC: OMAP4: omap-dmic: Initial support for OMAP DMIC Peter Ujfalusi
@ 2011-11-28 17:21   ` Mark Brown
  0 siblings, 0 replies; 19+ messages in thread
From: Mark Brown @ 2011-11-28 17:21 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Liam Girdwood, Tony Lindgren, alsa-devel, linux-omap, Benoit Cousson

On Mon, Nov 28, 2011 at 03:45:40PM +0200, Peter Ujfalusi wrote:
> Add support for OMAP4 Digital Microphone interface.

Looks good - applied, thanks.

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

* Re: [PATCH v4 5/5] ASoC: sdp4430: Add support for digital microphones
  2011-11-28 13:45 ` [PATCH v4 5/5] ASoC: sdp4430: Add support for digital microphones Peter Ujfalusi
@ 2011-11-28 17:22   ` Mark Brown
  0 siblings, 0 replies; 19+ messages in thread
From: Mark Brown @ 2011-11-28 17:22 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Liam Girdwood, Tony Lindgren, alsa-devel, linux-omap, Benoit Cousson

On Mon, Nov 28, 2011 at 03:45:43PM +0200, Peter Ujfalusi wrote:
> OMAP4 SDP/Blaze boards have digital microphones.
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

Applied, thanks.

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

* Re: [PATCH v4 3/5] OMAP4: devices: Register OMAP4 DMIC platform device
  2011-11-28 13:45 ` [PATCH v4 3/5] OMAP4: devices: Register OMAP4 DMIC platform device Peter Ujfalusi
@ 2011-12-09 21:03   ` Tony Lindgren
  0 siblings, 0 replies; 19+ messages in thread
From: Tony Lindgren @ 2011-12-09 21:03 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Mark Brown, Liam Girdwood, alsa-devel, linux-omap, Benoit Cousson

* Peter Ujfalusi <peter.ujfalusi@ti.com> [111128 05:11]:
> Add platform device registration for OMAP4 DMIC.

Thanks applying patches 3 & 4 into omap board branch.
Paul will be queuing hwmod related changes separately.

Regards,

Tony

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

* Re: [PATCH v4 1/5] OMAP4: hwmod: Add names for DMIC memory address space
  2011-11-28 13:45 ` [PATCH v4 1/5] OMAP4: hwmod: Add names for DMIC memory address space Peter Ujfalusi
@ 2011-12-16  6:28   ` Paul Walmsley
  2011-12-16 14:43     ` Cousson, Benoit
  0 siblings, 1 reply; 19+ messages in thread
From: Paul Walmsley @ 2011-12-16  6:28 UTC (permalink / raw)
  Cc: Peter Ujfalusi, Mark Brown, Liam Girdwood, Tony Lindgren,
	alsa-devel, linux-omap, Benoit Cousson

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1237 bytes --]

Hi Benoît

On Mon, 28 Nov 2011, Peter Ujfalusi wrote:

> To be able to get the memory resources by name from
> the DMIC driver (for MPU and for DMA).

Any comments on this one?  Looks like we'd need to add these names as 
hints in the script.

> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
>  arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
> index 7695e5d..8b75c60 100644
> --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
> +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
> @@ -1028,6 +1028,7 @@ static struct omap_hwmod_dma_info omap44xx_dmic_sdma_reqs[] = {
>  
>  static struct omap_hwmod_addr_space omap44xx_dmic_addrs[] = {
>  	{
> +		.name		= "mpu",
>  		.pa_start	= 0x4012e000,
>  		.pa_end		= 0x4012e07f,
>  		.flags		= ADDR_TYPE_RT
> @@ -1046,6 +1047,7 @@ static struct omap_hwmod_ocp_if omap44xx_l4_abe__dmic = {
>  
>  static struct omap_hwmod_addr_space omap44xx_dmic_dma_addrs[] = {
>  	{
> +		.name		= "dma",
>  		.pa_start	= 0x4902e000,
>  		.pa_end		= 0x4902e07f,
>  		.flags		= ADDR_TYPE_RT



- Paul

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

* Re: [PATCH v4 1/5] OMAP4: hwmod: Add names for DMIC memory address space
  2011-12-16  6:28   ` Paul Walmsley
@ 2011-12-16 14:43     ` Cousson, Benoit
  2011-12-19 21:51       ` Paul Walmsley
  0 siblings, 1 reply; 19+ messages in thread
From: Cousson, Benoit @ 2011-12-16 14:43 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: Peter Ujfalusi, Mark Brown, Liam Girdwood, Tony Lindgren,
	alsa-devel, linux-omap

On 12/16/2011 7:28 AM, Paul Walmsley wrote:
> Hi Benoît
>
> On Mon, 28 Nov 2011, Peter Ujfalusi wrote:
>
>> To be able to get the memory resources by name from
>> the DMIC driver (for MPU and for DMA).
>
> Any comments on this one?  Looks like we'd need to add these names as
> hints in the script.

Maybe not, in theory we should be able to detect the dual mapping and 
add the proper name. I did that for some other IP in the ABE domain, so 
it should be doable for that one too.

>> Signed-off-by: Peter Ujfalusi<peter.ujfalusi@ti.com>

Acked-by: Benoit Cousson <b-cousson@ti.com>

Benoit

>> ---
>>   arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    2 ++
>>   1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
>> index 7695e5d..8b75c60 100644
>> --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
>> +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
>> @@ -1028,6 +1028,7 @@ static struct omap_hwmod_dma_info omap44xx_dmic_sdma_reqs[] = {
>>
>>   static struct omap_hwmod_addr_space omap44xx_dmic_addrs[] = {
>>   	{
>> +		.name		= "mpu",
>>   		.pa_start	= 0x4012e000,
>>   		.pa_end		= 0x4012e07f,
>>   		.flags		= ADDR_TYPE_RT
>> @@ -1046,6 +1047,7 @@ static struct omap_hwmod_ocp_if omap44xx_l4_abe__dmic = {
>>
>>   static struct omap_hwmod_addr_space omap44xx_dmic_dma_addrs[] = {
>>   	{
>> +		.name		= "dma",
>>   		.pa_start	= 0x4902e000,
>>   		.pa_end		= 0x4902e07f,
>>   		.flags		= ADDR_TYPE_RT
>
>
>
> - Paul

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v4 1/5] OMAP4: hwmod: Add names for DMIC memory address space
  2011-12-16 14:43     ` Cousson, Benoit
@ 2011-12-19 21:51       ` Paul Walmsley
  2012-01-23 11:52         ` Peter Ujfalusi
  0 siblings, 1 reply; 19+ messages in thread
From: Paul Walmsley @ 2011-12-19 21:51 UTC (permalink / raw)
  To: Cousson, Benoit
  Cc: Peter Ujfalusi, Mark Brown, Liam Girdwood, Tony Lindgren,
	alsa-devel, linux-omap

Hi

On Fri, 16 Dec 2011, Cousson, Benoit wrote:

> On 12/16/2011 7:28 AM, Paul Walmsley wrote:
> > On Mon, 28 Nov 2011, Peter Ujfalusi wrote:
> > 
> > > To be able to get the memory resources by name from
> > > the DMIC driver (for MPU and for DMA).
> > 
> > Any comments on this one?  Looks like we'd need to add these names as
> > hints in the script.
> 
> Maybe not, in theory we should be able to detect the dual mapping and add the
> proper name. I did that for some other IP in the ABE domain, so it should be
> doable for that one too.
> 
> > > Signed-off-by: Peter Ujfalusi<peter.ujfalusi@ti.com>
> 
> Acked-by: Benoit Cousson <b-cousson@ti.com>

Cool.  Queued for when Tony wants to pull it.


- Paul

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

* Re: [PATCH v4 1/5] OMAP4: hwmod: Add names for DMIC memory address space
  2011-12-19 21:51       ` Paul Walmsley
@ 2012-01-23 11:52         ` Peter Ujfalusi
  2012-01-24  8:36           ` Paul Walmsley
  0 siblings, 1 reply; 19+ messages in thread
From: Peter Ujfalusi @ 2012-01-23 11:52 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: Cousson, Benoit, Mark Brown, Liam Girdwood, Tony Lindgren,
	alsa-devel, linux-omap

Hi Paul, Tony,

On 12/19/2011 11:51 PM, Paul Walmsley wrote:
> Hi
> 
> On Fri, 16 Dec 2011, Cousson, Benoit wrote:
> 
>> On 12/16/2011 7:28 AM, Paul Walmsley wrote:
>>> On Mon, 28 Nov 2011, Peter Ujfalusi wrote:
>>>
>>>> To be able to get the memory resources by name from
>>>> the DMIC driver (for MPU and for DMA).
>>>
>>> Any comments on this one?  Looks like we'd need to add these names as
>>> hints in the script.
>>
>> Maybe not, in theory we should be able to detect the dual mapping and add the
>> proper name. I did that for some other IP in the ABE domain, so it should be
>> doable for that one too.
>>
>>>> Signed-off-by: Peter Ujfalusi<peter.ujfalusi@ti.com>
>>
>> Acked-by: Benoit Cousson <b-cousson@ti.com>
> 
> Cool.  Queued for when Tony wants to pull it.

This patch seams to be missing from 3.3-rc1. The rest of the series is
there, but because of the missing patch audio does not probe on
4430SDP/Blaze.
Can you queue this as a fix for Linus?

Thanks,
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v4 1/5] OMAP4: hwmod: Add names for DMIC memory address space
  2012-01-23 11:52         ` Peter Ujfalusi
@ 2012-01-24  8:36           ` Paul Walmsley
  2012-01-24 10:01             ` Peter Ujfalusi
  0 siblings, 1 reply; 19+ messages in thread
From: Paul Walmsley @ 2012-01-24  8:36 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Cousson, Benoit, Mark Brown, Liam Girdwood, Tony Lindgren,
	alsa-devel, linux-omap

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1203 bytes --]

Hi Péter

On Mon, 23 Jan 2012, Peter Ujfalusi wrote:

> On 12/19/2011 11:51 PM, Paul Walmsley wrote:
> > On Fri, 16 Dec 2011, Cousson, Benoit wrote:
> > 
> >> On 12/16/2011 7:28 AM, Paul Walmsley wrote:
> >>> On Mon, 28 Nov 2011, Peter Ujfalusi wrote:
> >>>
> >>>> To be able to get the memory resources by name from
> >>>> the DMIC driver (for MPU and for DMA).
> >>>
> >>> Any comments on this one?  Looks like we'd need to add these names as
> >>> hints in the script.
> >>
> >> Maybe not, in theory we should be able to detect the dual mapping and add the
> >> proper name. I did that for some other IP in the ABE domain, so it should be
> >> doable for that one too.
> >>
> >>>> Signed-off-by: Peter Ujfalusi<peter.ujfalusi@ti.com>
> >>
> >> Acked-by: Benoit Cousson <b-cousson@ti.com>
> > 
> > Cool.  Queued for when Tony wants to pull it.
> 
> This patch seams to be missing from 3.3-rc1. The rest of the series is
> there, but because of the missing patch audio does not probe on
> 4430SDP/Blaze.
> Can you queue this as a fix for Linus?

Doh, not sure what happened here.  A brief triage question.  Did audio 
probe correctly on 4430SDP/Blaze on 3.2?


- Paul

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

* Re: [PATCH v4 1/5] OMAP4: hwmod: Add names for DMIC memory address space
  2012-01-24  8:36           ` Paul Walmsley
@ 2012-01-24 10:01             ` Peter Ujfalusi
  2012-01-25 21:23               ` Paul Walmsley
  0 siblings, 1 reply; 19+ messages in thread
From: Peter Ujfalusi @ 2012-01-24 10:01 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: Cousson, Benoit, Mark Brown, Liam Girdwood, Tony Lindgren,
	alsa-devel, linux-omap

On 01/24/2012 10:36 AM, Paul Walmsley wrote:
>> This patch seams to be missing from 3.3-rc1. The rest of the series is
>> there, but because of the missing patch audio does not probe on
>> 4430SDP/Blaze.
>> Can you queue this as a fix for Linus?
> 
> Doh, not sure what happened here.  A brief triage question.  Did audio 
> probe correctly on 4430SDP/Blaze on 3.2?

Yes, it did.
I have added the DMIC support for 3.3. Without this patch the DMIC
driver is not probing (can't get the resources) which prevents the audio
to work (the DMIC dai is missing, so the card does not come up).

-- 
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v4 1/5] OMAP4: hwmod: Add names for DMIC memory address space
  2012-01-24 10:01             ` Peter Ujfalusi
@ 2012-01-25 21:23               ` Paul Walmsley
  2012-02-01  7:40                 ` Peter Ujfalusi
  0 siblings, 1 reply; 19+ messages in thread
From: Paul Walmsley @ 2012-01-25 21:23 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Cousson, Benoit, Mark Brown, Liam Girdwood, Tony Lindgren,
	alsa-devel, linux-omap

On Tue, 24 Jan 2012, Peter Ujfalusi wrote:

> On 01/24/2012 10:36 AM, Paul Walmsley wrote:
> >> This patch seams to be missing from 3.3-rc1. The rest of the series is
> >> there, but because of the missing patch audio does not probe on
> >> 4430SDP/Blaze.
> >> Can you queue this as a fix for Linus?
> > 
> > Doh, not sure what happened here.  A brief triage question.  Did audio 
> > probe correctly on 4430SDP/Blaze on 3.2?
> 
> Yes, it did.
> I have added the DMIC support for 3.3. Without this patch the DMIC
> driver is not probing (can't get the resources) which prevents the audio
> to work (the DMIC dai is missing, so the card does not come up).

Okay, thanks, queued for 3.3-rc.


- Paul

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

* Re: [PATCH v4 1/5] OMAP4: hwmod: Add names for DMIC memory address space
  2012-01-25 21:23               ` Paul Walmsley
@ 2012-02-01  7:40                 ` Peter Ujfalusi
  2012-02-01 19:08                   ` Paul Walmsley
  0 siblings, 1 reply; 19+ messages in thread
From: Peter Ujfalusi @ 2012-02-01  7:40 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: Cousson, Benoit, Mark Brown, Liam Girdwood, Tony Lindgren,
	alsa-devel, linux-omap

Hi Paul,

On 01/25/2012 11:23 PM, Paul Walmsley wrote:
> Okay, thanks, queued for 3.3-rc.

It seams this patch did not made it to 3.3-rc2.
We still have broken audio out of box on SDP4430/Blaze.
Can you make sure that this will be queued for rc3?

Thank you,
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v4 1/5] OMAP4: hwmod: Add names for DMIC memory address space
  2012-02-01  7:40                 ` Peter Ujfalusi
@ 2012-02-01 19:08                   ` Paul Walmsley
  2012-02-02  8:32                     ` Peter Ujfalusi
  0 siblings, 1 reply; 19+ messages in thread
From: Paul Walmsley @ 2012-02-01 19:08 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Cousson, Benoit, Mark Brown, Liam Girdwood, Tony Lindgren,
	alsa-devel, linux-omap

[-- Attachment #1: Type: TEXT/PLAIN, Size: 603 bytes --]

Hi Péter,

On Wed, 1 Feb 2012, Peter Ujfalusi wrote:

> On 01/25/2012 11:23 PM, Paul Walmsley wrote:
> > Okay, thanks, queued for 3.3-rc.
> 
> It seams this patch did not made it to 3.3-rc2.
> We still have broken audio out of box on SDP4430/Blaze.
> Can you make sure that this will be queued for rc3?

No sadly I can't.  There are at least three levels of maintainers above me 
in my mainline submission path.  As you may have seen, I've sent the patch 
to Tony and he has pulled the series:

http://www.spinics.net/lists/linux-omap/msg63525.html

so I've done what I can.


- Paul

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

* Re: [PATCH v4 1/5] OMAP4: hwmod: Add names for DMIC memory address space
  2012-02-01 19:08                   ` Paul Walmsley
@ 2012-02-02  8:32                     ` Peter Ujfalusi
  0 siblings, 0 replies; 19+ messages in thread
From: Peter Ujfalusi @ 2012-02-02  8:32 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: Cousson, Benoit, Mark Brown, Liam Girdwood, Tony Lindgren,
	alsa-devel, linux-omap

Hi Paul,

On 02/01/2012 09:08 PM, Paul Walmsley wrote:
> No sadly I can't.  There are at least three levels of maintainers above me 
> in my mainline submission path.  As you may have seen, I've sent the patch 
> to Tony and he has pulled the series:
> 
> http://www.spinics.net/lists/linux-omap/msg63525.html

I have missed this.

> so I've done what I can.

Thanks, it is enough if it is on it's way. Will end up in the correct
place at some point.

Regards,
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2012-02-02  8:32 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-28 13:45 [PATCH v4 0/5] Support for OMAP4 Digital Microphone interface Peter Ujfalusi
2011-11-28 13:45 ` [PATCH v4 1/5] OMAP4: hwmod: Add names for DMIC memory address space Peter Ujfalusi
2011-12-16  6:28   ` Paul Walmsley
2011-12-16 14:43     ` Cousson, Benoit
2011-12-19 21:51       ` Paul Walmsley
2012-01-23 11:52         ` Peter Ujfalusi
2012-01-24  8:36           ` Paul Walmsley
2012-01-24 10:01             ` Peter Ujfalusi
2012-01-25 21:23               ` Paul Walmsley
2012-02-01  7:40                 ` Peter Ujfalusi
2012-02-01 19:08                   ` Paul Walmsley
2012-02-02  8:32                     ` Peter Ujfalusi
2011-11-28 13:45 ` [PATCH v4 2/5] ASoC: OMAP4: omap-dmic: Initial support for OMAP DMIC Peter Ujfalusi
2011-11-28 17:21   ` Mark Brown
2011-11-28 13:45 ` [PATCH v4 3/5] OMAP4: devices: Register OMAP4 DMIC platform device Peter Ujfalusi
2011-12-09 21:03   ` Tony Lindgren
2011-11-28 13:45 ` [PATCH v4 4/5] OMAP4: board-4430sdp: Register platform device for digimic codec Peter Ujfalusi
2011-11-28 13:45 ` [PATCH v4 5/5] ASoC: sdp4430: Add support for digital microphones Peter Ujfalusi
2011-11-28 17:22   ` Mark Brown

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.