devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Patrick Lai <plai-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Banajit Goswami
	<bgoswami-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Liam Girdwood <lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Jaroslav Kysela <perex-/Fr2/VpizcU@public.gmane.org>,
	Takashi Iwai <tiwai-l3A5Bk7waGM@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org
Subject: Re: [alsa-devel] [RFC PATCH 00/14] ASoC: qcom: add support to apq8016 audio
Date: Tue, 12 May 2015 11:21:42 +0100	[thread overview]
Message-ID: <5551D436.2070600@linaro.org> (raw)
In-Reply-To: <20150512040600.GA24087-VfhoOQ2zEbNBVvN7MMdr1KRtKmQZhJ7pQQ4Iyu8u01E@public.gmane.org>

+ adding Lars

On 12/05/15 05:06, Kenneth Westfield wrote:
> Srinivas,
>
> I was able to get audio working on the Storm board.  There were several
> issues.  First, the I2S control port was saved in the DAI driver id field
> (which was 4), but the DAI id field was used by the macro (which was 0).
> The patch below fixed it:

Ah, I did not expect that to happen, dai->id and dai->driver->id should 
be same. Surprisingly this is not true for IPQ806x platform only because 
dais count == 1. Which results in dai->id not getting assigned to 
dai->driver->id due to below code snippet in  sound/soc/soc-core.c

--------------------><------------------------------------------
/*
  * Back in the old days when we still had component-less DAIs,
  * instead of having a static name, component-less DAIs would
  * inherit the name of the parent device so it is possible to
  * register multiple instances of the DAI. We still need to keep
  * the same naming style even though those DAIs are not
  * component-less anymore.
  */
if (count == 1 && legacy_dai_naming) {
	dai->name = fmt_single_name(dev, &dai->id);
} else {
	dai->name = fmt_multiple_name(dev, &dai_drv[i]);
	if (dai_drv[i].id)
		dai->id = dai_drv[i].id;
	else
		dai->id = i;
}
--------------------><------------------------------------------

Its not clear from code, why should we enter to legacy naming if the 
dais count == 1 even-though the dai_drv has has valid name and id 
information.

Mark/Lars,

I can workaround this by using dai->driver->id in the driver, But do you 
think that dai name and id should be assigned from dai drv if present?

--srini

>
> -----------------------><---------------------------------------------
> diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
> index 17ad20d..58ae8af 100644
> --- a/sound/soc/qcom/lpass-cpu.c
> +++ b/sound/soc/qcom/lpass-cpu.c
> @@ -146,7 +146,7 @@ static int lpass_cpu_daiops_hw_params(struct snd_pcm_substream *substream,
>   	}
>
>   	ret = regmap_write(drvdata->lpaif_map,
> -			   LPAIF_I2SCTL_REG(drvdata->variant, dai->id),
> +			   LPAIF_I2SCTL_REG(drvdata->variant, dai->driver->id),
>   			   regval);
>   	if (ret) {
>   		dev_err(dai->dev, "%s() error writing to i2sctl reg: %d\n",
> @@ -171,7 +171,7 @@ static int lpass_cpu_daiops_hw_free(struct snd_pcm_substream *substream,
>   	int ret;
>
>   	ret = regmap_write(drvdata->lpaif_map,
> -			   LPAIF_I2SCTL_REG(drvdata->variant, dai->id), 0);
> +			   LPAIF_I2SCTL_REG(drvdata->variant, dai->driver->id), 0);
>   	if (ret)
>   		dev_err(dai->dev, "%s() error writing to i2sctl reg: %d\n",
>   				__func__, ret);
> @@ -186,7 +186,7 @@ static int lpass_cpu_daiops_prepare(struct snd_pcm_substream *substream,
>   	int ret;
>
>   	ret = regmap_update_bits(drvdata->lpaif_map,
> -			LPAIF_I2SCTL_REG(drvdata->variant, dai->id),
> +			LPAIF_I2SCTL_REG(drvdata->variant, dai->driver->id),
>   			LPAIF_I2SCTL_SPKEN_MASK, LPAIF_I2SCTL_SPKEN_ENABLE);
>   	if (ret)
>   		dev_err(dai->dev, "%s() error writing to i2sctl reg: %d\n",
> @@ -206,7 +206,7 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream,
>   	case SNDRV_PCM_TRIGGER_RESUME:
>   	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
>   		ret = regmap_update_bits(drvdata->lpaif_map,
> -				LPAIF_I2SCTL_REG(drvdata->variant, dai->id),
> +				LPAIF_I2SCTL_REG(drvdata->variant, dai->driver->id),
>   				LPAIF_I2SCTL_SPKEN_MASK,
>   				LPAIF_I2SCTL_SPKEN_ENABLE);
>   		if (ret)
> @@ -217,7 +217,7 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream,
>   	case SNDRV_PCM_TRIGGER_SUSPEND:
>   	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
>   		ret = regmap_update_bits(drvdata->lpaif_map,
> -				LPAIF_I2SCTL_REG(drvdata->variant, dai->id),
> +				LPAIF_I2SCTL_REG(drvdata->variant, dai->driver->id),
>   				LPAIF_I2SCTL_SPKEN_MASK,
>   				LPAIF_I2SCTL_SPKEN_DISABLE);
>   		if (ret)
> @@ -247,7 +247,7 @@ int lpass_cpu_dai_probe(struct snd_soc_dai *dai)
>
>   	/* ensure audio hardware is disabled */
>   	ret = regmap_write(drvdata->lpaif_map,
> -			LPAIF_I2SCTL_REG(drvdata->variant, dai->id), 0);
> +			LPAIF_I2SCTL_REG(drvdata->variant, dai->driver->id), 0);
>   	if (ret)
>   		dev_err(dai->dev, "%s() error writing to i2sctl reg: %d\n",
>   				__func__, ret);
> -----------------------><---------------------------------------------
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-05-12 10:21 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30 17:15 [RFC PATCH 00/14] ASoC: qcom: add support to apq8016 audio Srinivas Kandagatla
2015-04-30 17:16 ` [RFC PATCH 01/14] ASoC: qcom: Remove redundant error check Srinivas Kandagatla
2015-05-04 12:24   ` Mark Brown
2015-04-30 17:16 ` [RFC PATCH 02/14] ASoC: qcom: remove unnecessary header files Srinivas Kandagatla
2015-05-04 12:24   ` Mark Brown
2015-04-30 17:16 ` [RFC PATCH 03/14] ASoC: qcom: move ipq806x specific bits out of lpass driver Srinivas Kandagatla
2015-05-02 23:57   ` Kenneth Westfield
2015-05-05  5:19     ` Kenneth Westfield
2015-05-05  7:17       ` Srinivas Kandagatla
2015-05-06  5:43         ` [alsa-devel] " Kenneth Westfield
2015-05-05  7:16     ` Srinivas Kandagatla
     [not found]       ` <55486E5E.4010601-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-05-06  5:35         ` [alsa-devel] " Kenneth Westfield
2015-04-30 17:17 ` [RFC PATCH 04/14] ASoC: qcom: remove hardcoded i2s port number Srinivas Kandagatla
2015-04-30 17:17 ` [RFC PATCH 05/14] ASoC: qcom: remove hardcoded dma channel Srinivas Kandagatla
2015-04-30 17:17 ` [RFC PATCH 06/14] ASoC: qcom: support bitclk and osrclk per i2s port Srinivas Kandagatla
2015-04-30 17:17 ` [RFC PATCH 07/14] ASoC: qcom: add no osr clk flag to lpass variant Srinivas Kandagatla
     [not found]   ` <1430414244-11168-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-05-02 23:58     ` Kenneth Westfield
2015-05-05  7:17       ` Srinivas Kandagatla
2015-05-04 12:26   ` Mark Brown
2015-05-05  7:16     ` Srinivas Kandagatla
2015-04-30 17:17 ` [RFC PATCH 08/14] ASoC: qcom: add dma channel control offset to variant data Srinivas Kandagatla
     [not found]   ` <1430414252-11210-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-05-02 23:59     ` Kenneth Westfield
2015-05-05  7:16       ` Srinivas Kandagatla
2015-04-30 17:17 ` [RFC PATCH 09/14] ASoC: qcom: Add ability to handle interrupts per dma channel Srinivas Kandagatla
2015-05-03  0:00   ` Kenneth Westfield
     [not found]     ` <20150502235950.GE27804-VfhoOQ2zEbNBVvN7MMdr1KRtKmQZhJ7pQQ4Iyu8u01E@public.gmane.org>
2015-05-05  7:17       ` Srinivas Kandagatla
2015-04-30 17:17 ` [RFC PATCH 11/14] ASoC: qcom: Add apq8016 lpass driver support Srinivas Kandagatla
2015-04-30 17:18 ` [RFC PATCH 12/14] ASoC: qcom: add apq8016 sound card support Srinivas Kandagatla
2015-05-03  0:01   ` Kenneth Westfield
2015-05-05  7:17     ` Srinivas Kandagatla
2015-04-30 17:18 ` [RFC PATCH 13/14] ASoC: qcom: Document apq8016 bindings Srinivas Kandagatla
2015-04-30 17:18 ` [RFC PATCH 14/14] ASoC: qcom: document apq8016 machine driver bindings Srinivas Kandagatla
2015-05-03  0:03   ` Kenneth Westfield
2015-05-03  3:59     ` Kenneth Westfield
2015-05-05  7:17     ` Srinivas Kandagatla
     [not found]       ` <55486E6D.9010402-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-05-06  5:41         ` [alsa-devel] " Kenneth Westfield
2015-05-02 23:57 ` [RFC PATCH 00/14] ASoC: qcom: add support to apq8016 audio Kenneth Westfield
     [not found]   ` <20150502235704.GA27804-VfhoOQ2zEbNBVvN7MMdr1KRtKmQZhJ7pQQ4Iyu8u01E@public.gmane.org>
2015-05-06  5:47     ` Kenneth Westfield
     [not found]       ` <20150506054758.GD5639-VfhoOQ2zEbNBVvN7MMdr1KRtKmQZhJ7pQQ4Iyu8u01E@public.gmane.org>
2015-05-06  6:54         ` Srinivas Kandagatla
2015-05-12  4:06           ` [alsa-devel] " Kenneth Westfield
     [not found]             ` <20150512040600.GA24087-VfhoOQ2zEbNBVvN7MMdr1KRtKmQZhJ7pQQ4Iyu8u01E@public.gmane.org>
2015-05-12 10:21               ` Srinivas Kandagatla [this message]
2015-05-12 17:04                 ` Lars-Peter Clausen
2015-05-14  7:55                   ` Srinivas Kandagatla
2015-05-12 13:11             ` Srinivas Kandagatla
2015-05-13 11:58 ` [PATCH v1 00/13] " Srinivas Kandagatla
2015-05-13 12:00   ` [PATCH v1 01/13] ASoC: qcom: make lpass driver depend on OF Srinivas Kandagatla
2015-05-13 12:00   ` [PATCH v1 03/13] ASoC: qcom: remove hardcoded i2s port number Srinivas Kandagatla
2015-05-13 12:02   ` [PATCH v1 06/13] ASoC: qcom: make osr clock optional Srinivas Kandagatla
2015-05-13 12:02   ` [PATCH v1 07/13] ASoC: qcom: add dma channel control offset to variant data Srinivas Kandagatla
2015-05-13 12:02   ` [PATCH v1 08/13] ASoC: qcom: Add ability to handle interrupts per dma channel Srinivas Kandagatla
     [not found]   ` <1431518302-7139-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-05-13 12:00     ` [PATCH v1 02/13] ASoC: qcom: move ipq806x specific bits out of lpass driver Srinivas Kandagatla
2015-05-15  5:23       ` Kenneth Westfield
2015-05-15  8:48         ` Srinivas Kandagatla
2015-05-13 12:00     ` [PATCH v1 04/13] ASoC: qcom: remove hardcoded dma channel Srinivas Kandagatla
2015-05-13 12:00     ` [PATCH v1 05/13] ASoC: qcom: support bitclk and osrclk per i2s port Srinivas Kandagatla
2015-05-15  5:23       ` Kenneth Westfield
2015-05-15  8:44         ` Srinivas Kandagatla
2015-05-13 12:02     ` [PATCH v1 09/13] ASoC: qcom: add bit map to track static dma channel allocations Srinivas Kandagatla
2015-05-13 12:03   ` [PATCH v1 10/13] ASoC: qcom: Add apq8016 lpass driver support Srinivas Kandagatla
2015-05-15  5:23     ` Kenneth Westfield
2015-05-15  8:46       ` Srinivas Kandagatla
2015-05-13 12:03   ` [PATCH v1 11/13] ASoC: qcom: add apq8016 sound card support Srinivas Kandagatla
2015-05-15  5:23     ` Kenneth Westfield
     [not found]       ` <20150515052348.GC31687-VfhoOQ2zEbNBVvN7MMdr1KRtKmQZhJ7pQQ4Iyu8u01E@public.gmane.org>
2015-05-15  8:47         ` Srinivas Kandagatla
2015-05-13 12:03   ` [PATCH v1 12/13] ASoC: qcom: Document apq8016 bindings Srinivas Kandagatla
2015-05-13 12:03   ` [PATCH v1 13/13] ASoC: qcom: document apq8016 sbc machine driver bindings Srinivas Kandagatla
     [not found] ` <1430414148-10869-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-04-30 17:17   ` [RFC PATCH 10/14] ASoC: qcom: add bit map to track static dma channel allocations Srinivas Kandagatla
2015-05-16 12:31   ` [PATCH v2 00/13] ASoC: qcom: add support to apq8016 audio Srinivas Kandagatla
2015-05-16 12:32     ` [PATCH v2 01/13] ASoC: qcom: make lpass driver depend on OF Srinivas Kandagatla
2015-05-21 20:10       ` Mark Brown
2015-05-16 12:32     ` [PATCH v2 02/13] ASoC: qcom: move ipq806x specific bits out of lpass driver Srinivas Kandagatla
     [not found]       ` <1431779537-1907-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-05-21 20:11         ` Mark Brown
2015-05-16 12:32     ` [PATCH v2 03/13] ASoC: qcom: remove hardcoded i2s port number Srinivas Kandagatla
2015-05-16 12:32     ` [PATCH v2 04/13] ASoC: qcom: remove hardcoded dma channel Srinivas Kandagatla
2015-05-21 20:12       ` Mark Brown
2015-05-16 12:32     ` [PATCH v2 05/13] ASoC: qcom: support bitclk and osrclk per i2s port Srinivas Kandagatla
     [not found]       ` <1431779562-2034-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-05-17 16:14         ` Kenneth Westfield
2015-05-16 12:32     ` [PATCH v2 06/13] ASoC: qcom: make osr clock optional Srinivas Kandagatla
2015-05-17 16:15       ` Kenneth Westfield
2015-05-16 12:32     ` [PATCH v2 07/13] ASoC: qcom: add dma channel control offset to variant data Srinivas Kandagatla
2015-05-16 12:33     ` [PATCH v2 08/13] ASoC: qcom: Add ability to handle interrupts per dma channel Srinivas Kandagatla
2015-05-16 12:33     ` [PATCH v2 09/13] ASoC: qcom: add bit map to track static dma channel allocations Srinivas Kandagatla
2015-05-16 12:33     ` [PATCH v2 10/13] ASoC: qcom: Add apq8016 lpass driver support Srinivas Kandagatla
2015-05-16 12:33     ` [PATCH v2 11/13] ASoC: qcom: add apq8016 sound card support Srinivas Kandagatla
2015-05-16 12:33     ` [PATCH v2 12/13] ASoC: qcom: Document apq8016 bindings Srinivas Kandagatla
2015-05-16 12:33     ` [PATCH v2 13/13] ASoC: qcom: document apq8016 sbc machine driver bindings Srinivas Kandagatla
     [not found]     ` <1431779462-1732-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-05-17 16:15       ` [PATCH v2 00/13] ASoC: qcom: add support to apq8016 audio Kenneth Westfield
2015-05-21 17:05     ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5551D436.2070600@linaro.org \
    --to=srinivas.kandagatla-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
    --cc=bgoswami-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \
    --cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=perex-/Fr2/VpizcU@public.gmane.org \
    --cc=plai-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=tiwai-l3A5Bk7waGM@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).