Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1323354 > unrolled thread

[PATCH RFC 00/15] ASoC: qcom: Add capture support.

Started bySrinivas Kandagatla <srinivas.kandagatla@linaro.org>
First post2016-02-01 18:40 +0100
Last post2016-02-03 09:50 +0100
Articles 7 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH RFC 00/15] ASoC: qcom: Add capture support. Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-02-01 18:40 +0100
    [PATCH RFC 15/15] ASoC: qcom: add mic support Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-02-01 18:40 +0100
      Re: [alsa-devel] [PATCH RFC 15/15] ASoC: qcom: add mic support Kenneth Westfield <kwestfie@codeaurora.org> - 2016-02-03 01:40 +0100
    [PATCH RFC 14/15] ASoC: qcom: apq8016-sbc: add mic support Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-02-01 18:40 +0100
      Re: [alsa-devel] [PATCH RFC 14/15] ASoC: qcom: apq8016-sbc: add mic  support Kenneth Westfield <kwestfie@codeaurora.org> - 2016-02-03 01:40 +0100
    Re: [alsa-devel] [PATCH RFC 00/15] ASoC: qcom: Add capture support. Kenneth Westfield <kwestfie@codeaurora.org> - 2016-02-03 01:40 +0100
      Re: [alsa-devel] [PATCH RFC 00/15] ASoC: qcom: Add capture support. Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-02-03 09:50 +0100

#1323354 — [PATCH RFC 00/15] ASoC: qcom: Add capture support.

FromSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Date2016-02-01 18:40 +0100
Subject[PATCH RFC 00/15] ASoC: qcom: Add capture support.
Message-ID<qXqsy-6bL-5@gated-at.bofh.it>
LPASS IP on QCOM SOC supports both Playback and capture
via I2S, but this feature is missing in existing code. 
This patchset aims at adding capture support to lpass IP.
First few patches in this series does cleanup the driver
to make easy to add capture support.

These patches are tested on DB410C with Headset Mic.

Thanks,
srini

Srinivas Kandagatla (15):
  ASoC: qcom: use snd_dma_alloc/free* apis
  ASoC: qcom: add wrdma register details to lpass_variant
  ASoC: qcom: rename rdmactl_audif_start to dmactrl_audif_start
  ASoC: qcom: pass direction to dma allocation
  ASoC: qcom: ipq806x: add error in dma allocation.
  ASoC: qcom: ipq806x: add wrdma related register offsets
  ASoC: qcom: add mic related i2s control register defines
  ASoC: qcom: add wrdma dma channel start
  ASoC: qcom: rename rdma_ch_bit_map to dma_ch_bit_map
  ASoC: qcom: apq8016: add wrdma support
  ASoC: qcom: add wrdma register definations
  ASoC: qcom: add generic bit masks for RDMA and WRDMA
  ASoC: qcom: apq8016: set the correct max register for regmap
  ASoC: qcom: apq8016-sbc: add mic support
  ASoC: qcom: add mic support

 sound/soc/qcom/apq8016_sbc.c     |  10 +-
 sound/soc/qcom/lpass-apq8016.c   |  31 +++--
 sound/soc/qcom/lpass-cpu.c       | 146 +++++++++++++++++------
 sound/soc/qcom/lpass-ipq806x.c   |  11 +-
 sound/soc/qcom/lpass-lpaif-reg.h | 118 +++++++++++++------
 sound/soc/qcom/lpass-platform.c  | 243 +++++++++++++++++++++++----------------
 sound/soc/qcom/lpass.h           |  10 +-
 7 files changed, 392 insertions(+), 177 deletions(-)

-- 
1.9.1

[toc] | [next] | [standalone]


#1323356 — [PATCH RFC 15/15] ASoC: qcom: add mic support

FromSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Date2016-02-01 18:40 +0100
Subject[PATCH RFC 15/15] ASoC: qcom: add mic support
Message-ID<qXqCe-6ht-27@gated-at.bofh.it>
In reply to#1323354
This patch adds mic support to the lpass driver, most of the driver is
reused as it is, only the register level access is changed depending on
te direction of the stream.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 sound/soc/qcom/lpass-cpu.c      | 113 +++++++++++++++++++--------
 sound/soc/qcom/lpass-platform.c | 166 +++++++++++++++++++++++++++++-----------
 2 files changed, 204 insertions(+), 75 deletions(-)

diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 82c21b2..d8a6a53 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -120,31 +120,60 @@ static int lpass_cpu_daiops_hw_params(struct snd_pcm_substream *substream,
 		return -EINVAL;
 	}
 
-	switch (channels) {
-	case 1:
-		regval |= LPAIF_I2SCTL_SPKMODE_SD0;
-		regval |= LPAIF_I2SCTL_SPKMONO_MONO;
-		break;
-	case 2:
-		regval |= LPAIF_I2SCTL_SPKMODE_SD0;
-		regval |= LPAIF_I2SCTL_SPKMONO_STEREO;
-		break;
-	case 4:
-		regval |= LPAIF_I2SCTL_SPKMODE_QUAD01;
-		regval |= LPAIF_I2SCTL_SPKMONO_STEREO;
-		break;
-	case 6:
-		regval |= LPAIF_I2SCTL_SPKMODE_6CH;
-		regval |= LPAIF_I2SCTL_SPKMONO_STEREO;
-		break;
-	case 8:
-		regval |= LPAIF_I2SCTL_SPKMODE_8CH;
-		regval |= LPAIF_I2SCTL_SPKMONO_STEREO;
-		break;
-	default:
-		dev_err(dai->dev, "%s() invalid channels given: %u\n",
-				__func__, channels);
-		return -EINVAL;
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+		switch (channels) {
+		case 1:
+			regval |= LPAIF_I2SCTL_SPKMODE_SD0;
+			regval |= LPAIF_I2SCTL_SPKMONO_MONO;
+			break;
+		case 2:
+			regval |= LPAIF_I2SCTL_SPKMODE_SD0;
+			regval |= LPAIF_I2SCTL_SPKMONO_STEREO;
+			break;
+		case 4:
+			regval |= LPAIF_I2SCTL_SPKMODE_QUAD01;
+			regval |= LPAIF_I2SCTL_SPKMONO_STEREO;
+			break;
+		case 6:
+			regval |= LPAIF_I2SCTL_SPKMODE_6CH;
+			regval |= LPAIF_I2SCTL_SPKMONO_STEREO;
+			break;
+		case 8:
+			regval |= LPAIF_I2SCTL_SPKMODE_8CH;
+			regval |= LPAIF_I2SCTL_SPKMONO_STEREO;
+			break;
+		default:
+			dev_err(dai->dev, "%s() invalid channels given: %u\n",
+					__func__, channels);
+			return -EINVAL;
+		}
+	} else {
+		switch (channels) {
+		case 1:
+			regval |= LPAIF_I2SCTL_MICMODE_SD0;
+			regval |= LPAIF_I2SCTL_MICMONO_MONO;
+			break;
+		case 2:
+			regval |= LPAIF_I2SCTL_MICMODE_SD0;
+			regval |= LPAIF_I2SCTL_MICMONO_STEREO;
+			break;
+		case 4:
+			regval |= LPAIF_I2SCTL_MICMODE_QUAD01;
+			regval |= LPAIF_I2SCTL_MICMONO_STEREO;
+			break;
+		case 6:
+			regval |= LPAIF_I2SCTL_MICMODE_6CH;
+			regval |= LPAIF_I2SCTL_MICMONO_STEREO;
+			break;
+		case 8:
+			regval |= LPAIF_I2SCTL_MICMODE_8CH;
+			regval |= LPAIF_I2SCTL_MICMONO_STEREO;
+			break;
+		default:
+			dev_err(dai->dev, "%s() invalid channels given: %u\n",
+					__func__, channels);
+			return -EINVAL;
+		}
 	}
 
 	ret = regmap_write(drvdata->lpaif_map,
@@ -188,10 +217,19 @@ static int lpass_cpu_daiops_prepare(struct snd_pcm_substream *substream,
 {
 	struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
 	int ret;
+	unsigned int val, mask;
+
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+		val = LPAIF_I2SCTL_SPKEN_ENABLE;
+		mask = LPAIF_I2SCTL_SPKEN_MASK;
+	} else  {
+		val = LPAIF_I2SCTL_MICEN_ENABLE;
+		mask = LPAIF_I2SCTL_MICEN_MASK;
+	}
 
 	ret = regmap_update_bits(drvdata->lpaif_map,
 			LPAIF_I2SCTL_REG(drvdata->variant, dai->driver->id),
-			LPAIF_I2SCTL_SPKEN_MASK, LPAIF_I2SCTL_SPKEN_ENABLE);
+			mask, val);
 	if (ret)
 		dev_err(dai->dev, "%s() error writing to i2sctl reg: %d\n",
 				__func__, ret);
@@ -204,16 +242,24 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream,
 {
 	struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
 	int ret = -EINVAL;
+	unsigned int val, mask;
 
 	switch (cmd) {
 	case SNDRV_PCM_TRIGGER_START:
 	case SNDRV_PCM_TRIGGER_RESUME:
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+			val = LPAIF_I2SCTL_SPKEN_ENABLE;
+			mask = LPAIF_I2SCTL_SPKEN_MASK;
+		} else  {
+			val = LPAIF_I2SCTL_MICEN_ENABLE;
+			mask = LPAIF_I2SCTL_MICEN_MASK;
+		}
+
 		ret = regmap_update_bits(drvdata->lpaif_map,
 				LPAIF_I2SCTL_REG(drvdata->variant,
 						dai->driver->id),
-				LPAIF_I2SCTL_SPKEN_MASK,
-				LPAIF_I2SCTL_SPKEN_ENABLE);
+				mask, val);
 		if (ret)
 			dev_err(dai->dev, "%s() error writing to i2sctl reg: %d\n",
 					__func__, ret);
@@ -221,11 +267,18 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream,
 	case SNDRV_PCM_TRIGGER_STOP:
 	case SNDRV_PCM_TRIGGER_SUSPEND:
 	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+			val = LPAIF_I2SCTL_SPKEN_DISABLE;
+			mask = LPAIF_I2SCTL_SPKEN_MASK;
+		} else  {
+			val = LPAIF_I2SCTL_MICEN_DISABLE;
+			mask = LPAIF_I2SCTL_MICEN_MASK;
+		}
+
 		ret = regmap_update_bits(drvdata->lpaif_map,
 				LPAIF_I2SCTL_REG(drvdata->variant,
 						dai->driver->id),
-				LPAIF_I2SCTL_SPKEN_MASK,
-				LPAIF_I2SCTL_SPKEN_DISABLE);
+				mask, val);
 		if (ret)
 			dev_err(dai->dev, "%s() error writing to i2sctl reg: %d\n",
 					__func__, ret);
diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
index e611d78..574aa33 100644
--- a/sound/soc/qcom/lpass-platform.c
+++ b/sound/soc/qcom/lpass-platform.c
@@ -26,6 +26,7 @@
 
 struct lpass_pcm_data {
 	int rdma_ch;
+	int wrdma_ch;
 	int i2s_port;
 };
 
@@ -92,7 +93,13 @@ static int lpass_platform_pcmops_hw_params(struct snd_pcm_substream *substream,
 	unsigned int regval;
 	int dir = substream->stream;
 	int bitwidth;
-	int ret, rdma_port = pcm_data->i2s_port + v->dmactl_audif_start;
+	int ch, ret, dma_port = pcm_data->i2s_port + v->dmactl_audif_start;
+
+	if (dir ==  SNDRV_PCM_STREAM_PLAYBACK)
+		ch = pcm_data->rdma_ch;
+	else
+		ch = pcm_data->wrdma_ch;
+
 
 	bitwidth = snd_pcm_format_width(format);
 	if (bitwidth < 0) {
@@ -102,7 +109,7 @@ static int lpass_platform_pcmops_hw_params(struct snd_pcm_substream *substream,
 	}
 
 	regval = LPAIF_DMACTL_BURSTEN_INCR4 |
-			LPAIF_DMACTL_AUDINTF(rdma_port) |
+			LPAIF_DMACTL_AUDINTF(dma_port) |
 			LPAIF_DMACTL_FIFOWM_8;
 
 	switch (bitwidth) {
@@ -158,7 +165,7 @@ static int lpass_platform_pcmops_hw_params(struct snd_pcm_substream *substream,
 	}
 
 	ret = regmap_write(drvdata->lpaif_map,
-			LPAIF_DMACTL_REG(v, pcm_data->rdma_ch, dir), regval);
+			LPAIF_DMACTL_REG(v, ch, dir), regval);
 	if (ret) {
 		dev_err(soc_runtime->dev, "%s() error writing to rdmactl reg: %d\n",
 				__func__, ret);
@@ -175,10 +182,15 @@ static int lpass_platform_pcmops_hw_free(struct snd_pcm_substream *substream)
 	struct lpass_data *drvdata =
 		snd_soc_platform_get_drvdata(soc_runtime->platform);
 	struct lpass_variant *v = drvdata->variant;
+	unsigned int reg;
 	int ret;
 
-	ret = regmap_write(drvdata->lpaif_map,
-			LPAIF_RDMACTL_REG(v, pcm_data->rdma_ch), 0);
+	if (substream->stream ==  SNDRV_PCM_STREAM_PLAYBACK)
+		reg = LPAIF_RDMACTL_REG(v, pcm_data->rdma_ch);
+	else
+		reg = LPAIF_WRDMACTL_REG(v, pcm_data->wrdma_ch);
+
+	ret = regmap_write(drvdata->lpaif_map, reg, 0);
 	if (ret)
 		dev_err(soc_runtime->dev, "%s() error writing to rdmactl reg: %d\n",
 				__func__, ret);
@@ -194,11 +206,15 @@ static int lpass_platform_pcmops_prepare(struct snd_pcm_substream *substream)
 	struct lpass_data *drvdata =
 		snd_soc_platform_get_drvdata(soc_runtime->platform);
 	struct lpass_variant *v = drvdata->variant;
-	int ret, ch = pcm_data->rdma_ch;
-	int dir = substream->stream;
+	int ret, ch, dir = substream->stream;
+
+	if (dir ==  SNDRV_PCM_STREAM_PLAYBACK)
+		ch = pcm_data->rdma_ch;
+	else
+		ch = pcm_data->wrdma_ch;
 
 	ret = regmap_write(drvdata->lpaif_map,
-			LPAIF_RDMABASE_REG(v, ch),
+			LPAIF_DMABASE_REG(v, ch, dir),
 			runtime->dma_addr);
 	if (ret) {
 		dev_err(soc_runtime->dev, "%s() error writing to rdmabase reg: %d\n",
@@ -244,8 +260,12 @@ static int lpass_platform_pcmops_trigger(struct snd_pcm_substream *substream,
 	struct lpass_data *drvdata =
 		snd_soc_platform_get_drvdata(soc_runtime->platform);
 	struct lpass_variant *v = drvdata->variant;
-	int ret, ch = pcm_data->rdma_ch;
-	int dir = substream->stream;
+	int ret, ch, dir = substream->stream;
+
+	if (dir == SNDRV_PCM_STREAM_PLAYBACK)
+		ch = pcm_data->rdma_ch;
+	else
+		ch = pcm_data->wrdma_ch;
 
 	switch (cmd) {
 	case SNDRV_PCM_TRIGGER_START:
@@ -317,8 +337,12 @@ static snd_pcm_uframes_t lpass_platform_pcmops_pointer(
 			snd_soc_platform_get_drvdata(soc_runtime->platform);
 	struct lpass_variant *v = drvdata->variant;
 	unsigned int base_addr, curr_addr;
-	int ret, ch = pcm_data->rdma_ch;
-	int dir = substream->stream;
+	int ret, ch, dir = substream->stream;
+
+	if (dir == SNDRV_PCM_STREAM_PLAYBACK)
+		ch = pcm_data->rdma_ch;
+	else
+		ch = pcm_data->wrdma_ch;
 
 	ret = regmap_read(drvdata->lpaif_map,
 			LPAIF_DMABASE_REG(v, ch, dir), &base_addr);
@@ -446,8 +470,7 @@ static irqreturn_t lpass_platform_lpaif_irq(int irq, void *data)
 static int lpass_platform_pcm_new(struct snd_soc_pcm_runtime *soc_runtime)
 {
 	struct snd_pcm *pcm = soc_runtime->pcm;
-	struct snd_pcm_substream *substream =
-		pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
+	struct snd_pcm_substream *psubstream, *csubstream;
 	struct snd_soc_dai *cpu_dai = soc_runtime->cpu_dai;
 	struct lpass_data *drvdata =
 		snd_soc_platform_get_drvdata(soc_runtime->platform);
@@ -460,53 +483,106 @@ static int lpass_platform_pcm_new(struct snd_soc_pcm_runtime *soc_runtime)
 	if (!data)
 		return -ENOMEM;
 
-	if (v->alloc_dma_channel)
-		data->rdma_ch = v->alloc_dma_channel(drvdata);
+	data->i2s_port = cpu_dai->driver->id;
+	snd_soc_pcm_set_drvdata(soc_runtime, data);
 
-	if (IS_ERR_VALUE(data->rdma_ch))
-		return data->rdma_ch;
+	psubstream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
+	if (psubstream) {
+		if (v->alloc_dma_channel)
+			data->rdma_ch = v->alloc_dma_channel(drvdata,
+						SNDRV_PCM_STREAM_PLAYBACK);
 
-	drvdata->substream[data->rdma_ch] = substream;
-	data->i2s_port = cpu_dai->driver->id;
+		if (IS_ERR_VALUE(data->rdma_ch))
+			return data->rdma_ch;
 
-	snd_soc_pcm_set_drvdata(soc_runtime, data);
+		drvdata->substream[data->rdma_ch] = psubstream;
 
-	ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->card->dev,
-				size, &substream->dma_buffer);
-	if (ret)
-		return ret;
+		ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->card->dev,
+					size, &psubstream->dma_buffer);
+		if (ret)
+			goto playback_alloc_err;
 
-	ret = regmap_write(drvdata->lpaif_map,
+		ret = regmap_write(drvdata->lpaif_map,
 			LPAIF_RDMACTL_REG(v, data->rdma_ch), 0);
-	if (ret) {
-		dev_err(soc_runtime->dev, "%s() error writing to rdmactl reg: %d\n",
+		if (ret) {
+			dev_err(soc_runtime->dev,
+				"%s() error writing to rdmactl reg: %d\n",
 				__func__, ret);
-		goto err_buf;
+			goto capture_alloc_err;
+		}
+	}
+
+	csubstream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
+	if (csubstream) {
+		if (v->alloc_dma_channel)
+			data->wrdma_ch = v->alloc_dma_channel(drvdata,
+						SNDRV_PCM_STREAM_CAPTURE);
+
+		if (IS_ERR_VALUE(data->wrdma_ch))
+			goto capture_alloc_err;
+
+		drvdata->substream[data->wrdma_ch] = csubstream;
+
+		ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->card->dev,
+					size, &csubstream->dma_buffer);
+		if (ret)
+			goto capture_alloc_err;
+
+		ret = regmap_write(drvdata->lpaif_map,
+			LPAIF_WRDMACTL_REG(v, data->wrdma_ch), 0);
+		if (ret) {
+			dev_err(soc_runtime->dev,
+				"%s() error writing to wrdmactl reg: %d\n",
+				__func__, ret);
+			goto capture_reg_err;
+		}
 	}
 
 	return 0;
 
-err_buf:
-	snd_dma_free_pages(&substream->dma_buffer);
+capture_reg_err:
+	if (csubstream)
+		snd_dma_free_pages(&csubstream->dma_buffer);
+
+capture_alloc_err:
+	if (psubstream)
+		snd_dma_free_pages(&psubstream->dma_buffer);
+
+ playback_alloc_err:
+	dev_err(soc_runtime->dev, "Cannot allocate buffer(s)\n");
+
 	return ret;
 }
 
 static void lpass_platform_pcm_free(struct snd_pcm *pcm)
 {
-	struct snd_pcm_substream *substream =
-		pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
-	struct snd_soc_pcm_runtime *soc_runtime = substream->private_data;
-	struct lpass_data *drvdata =
-		snd_soc_platform_get_drvdata(soc_runtime->platform);
-	struct lpass_pcm_data *data = snd_soc_pcm_get_drvdata(soc_runtime);
-	struct lpass_variant *v = drvdata->variant;
-
-	drvdata->substream[data->rdma_ch] = NULL;
-
-	if (v->free_dma_channel)
-		v->free_dma_channel(drvdata, data->rdma_ch);
-
-	snd_dma_free_pages(&substream->dma_buffer);
+	struct snd_soc_pcm_runtime *rt;
+	struct lpass_data *drvdata;
+	struct lpass_pcm_data *data;
+	struct lpass_variant *v;
+	struct snd_pcm_substream *substream;
+	int ch, i;
+
+	for (i = 0; i < ARRAY_SIZE(pcm->streams); i++) {
+		substream = pcm->streams[i].substream;
+		if (substream) {
+			rt = substream->private_data;
+			data = snd_soc_pcm_get_drvdata(rt);
+			drvdata = snd_soc_platform_get_drvdata(rt->platform);
+
+			ch = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+				? data->rdma_ch
+				: data->wrdma_ch;
+			v = drvdata->variant;
+			drvdata->substream[ch] = NULL;
+			if (v->free_dma_channel)
+				v->free_dma_channel(drvdata, ch);
+
+			snd_dma_free_pages(&substream->dma_buffer);
+			substream->dma_buffer.area = NULL;
+			substream->dma_buffer.addr = 0;
+		}
+	}
 }
 
 static struct snd_soc_platform_driver lpass_platform_driver = {
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1324772 — Re: [alsa-devel] [PATCH RFC 15/15] ASoC: qcom: add mic support

FromKenneth Westfield <kwestfie@codeaurora.org>
Date2016-02-03 01:40 +0100
SubjectRe: [alsa-devel] [PATCH RFC 15/15] ASoC: qcom: add mic support
Message-ID<qXTEe-2Um-19@gated-at.bofh.it>
In reply to#1323356
On Mon, Feb 01, 2016 at 09:29:52AM -0800, Srinivas Kandagatla wrote:
> This patch adds mic support to the lpass driver, most of the driver is
> reused as it is, only the register level access is changed depending on
> te direction of the stream.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  sound/soc/qcom/lpass-cpu.c      | 113 +++++++++++++++++++--------
>  sound/soc/qcom/lpass-platform.c | 166
> +++++++++++++++++++++++++++++-----------
>  2 files changed, 204 insertions(+), 75 deletions(-)

Acked-by: Kenneth Westfield <kwestfie@codeaurora.org>

-- 
Kenneth Westfield
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, 
a Linux Foundation Collaborative Project

[toc] | [prev] | [next] | [standalone]


#1323357 — [PATCH RFC 14/15] ASoC: qcom: apq8016-sbc: add mic support

FromSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Date2016-02-01 18:40 +0100
Subject[PATCH RFC 14/15] ASoC: qcom: apq8016-sbc: add mic support
Message-ID<qXqCe-6ht-39@gated-at.bofh.it>
In reply to#1323354
This patch add mic support on apq8016-sbc board aka db410c. Tested it
with headset mic.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 sound/soc/qcom/apq8016_sbc.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c
index 1efdf00..1289543 100644
--- a/sound/soc/qcom/apq8016_sbc.c
+++ b/sound/soc/qcom/apq8016_sbc.c
@@ -30,6 +30,7 @@ struct apq8016_sbc_data {
 	struct snd_soc_dai_link dai_link[];	/* dynamically allocated */
 };
 
+#define MIC_CTRL_TER_WS_SLAVE_SEL	BIT(21)
 #define MIC_CTRL_QUA_WS_SLAVE_SEL_10	BIT(17)
 #define MIC_CTRL_TLMM_SCLK_EN		BIT(1)
 #define	SPKR_CTL_PRI_WS_SLAVE_SEL_11	(BIT(17) | BIT(16))
@@ -53,6 +54,12 @@ static int apq8016_sbc_dai_init(struct snd_soc_pcm_runtime *rtd)
 			MIC_CTRL_TLMM_SCLK_EN,
 			pdata->mic_iomux);
 		break;
+	case MI2S_TERTIARY:
+		writel(readl(pdata->mic_iomux) | MIC_CTRL_TER_WS_SLAVE_SEL |
+			MIC_CTRL_TLMM_SCLK_EN,
+			pdata->mic_iomux);
+
+		break;
 
 	default:
 		dev_err(card->dev, "unsupported cpu dai configuration\n");
@@ -126,9 +133,6 @@ static struct apq8016_sbc_data *apq8016_sbc_parse_of(struct snd_soc_card *card)
 		}
 
 		link->platform_of_node = link->cpu_of_node;
-		/* For now we only support playback */
-		link->playback_only = true;
-
 		ret = of_property_read_string(np, "link-name", &link->name);
 		if (ret) {
 			dev_err(card->dev, "error getting codec dai_link name\n");
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1324771 — Re: [alsa-devel] [PATCH RFC 14/15] ASoC: qcom: apq8016-sbc: add mic support

FromKenneth Westfield <kwestfie@codeaurora.org>
Date2016-02-03 01:40 +0100
SubjectRe: [alsa-devel] [PATCH RFC 14/15] ASoC: qcom: apq8016-sbc: add mic support
Message-ID<qXTEf-2Um-21@gated-at.bofh.it>
In reply to#1323357
On Mon, Feb 01, 2016 at 09:29:46AM -0800, Srinivas Kandagatla wrote:
> This patch add mic support on apq8016-sbc board aka db410c. Tested it
> with headset mic.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  sound/soc/qcom/apq8016_sbc.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)

Acked-by: Kenneth Westfield <kwestfie@codeaurora.org>

-- 
Kenneth Westfield
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, 
a Linux Foundation Collaborative Project

[toc] | [prev] | [next] | [standalone]


#1324777 — Re: [alsa-devel] [PATCH RFC 00/15] ASoC: qcom: Add capture support.

FromKenneth Westfield <kwestfie@codeaurora.org>
Date2016-02-03 01:40 +0100
SubjectRe: [alsa-devel] [PATCH RFC 00/15] ASoC: qcom: Add capture support.
Message-ID<qXTEf-2Um-33@gated-at.bofh.it>
In reply to#1323354
On Mon, Feb 01, 2016 at 09:27:02AM -0800, Srinivas Kandagatla wrote:
> LPASS IP on QCOM SOC supports both Playback and capture
> via I2S, but this feature is missing in existing code. 
> This patchset aims at adding capture support to lpass IP.
> First few patches in this series does cleanup the driver
> to make easy to add capture support.
> 
> These patches are tested on DB410C with Headset Mic.

Thanks for posting this.  I went through the changes, and it mostly
looks good minus some small, easy-to-fix nits.

-- 
Kenneth Westfield
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, 
a Linux Foundation Collaborative Project

[toc] | [prev] | [next] | [standalone]


#1325057 — Re: [alsa-devel] [PATCH RFC 00/15] ASoC: qcom: Add capture support.

FromSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Date2016-02-03 09:50 +0100
SubjectRe: [alsa-devel] [PATCH RFC 00/15] ASoC: qcom: Add capture support.
Message-ID<qY1iq-80l-31@gated-at.bofh.it>
In reply to#1324777
Thanks Kenneth for review comments.

On 03/02/16 00:33, Kenneth Westfield wrote:
> On Mon, Feb 01, 2016 at 09:27:02AM -0800, Srinivas Kandagatla wrote:
>> LPASS IP on QCOM SOC supports both Playback and capture
>> via I2S, but this feature is missing in existing code.
>> This patchset aims at adding capture support to lpass IP.
>> First few patches in this series does cleanup the driver
>> to make easy to add capture support.
>>
>> These patches are tested on DB410C with Headset Mic.
>
> Thanks for posting this.  I went through the changes, and it mostly
> looks good minus some small, easy-to-fix nits.
I agree with all the comments, and will send a new version with fixes.

--srini
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web