mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Ravulapati Vishnu vardhan rao  <Vishnuvardhanrao.Ravulapati@amd.com>
Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER
	MANAGEM..."  <alsa-devel@alsa-project.org>,
	Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	open list <linux-kernel@vger.kernel.org>,
	Takashi Iwai <tiwai@suse.com>, YueHaibing <yuehaibing@huawei.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Akshu.Agrawal@amd.com, Sanju R Mehta <sanju.mehta@amd.com>,
	Mark Brown <broonie@kernel.org>,
	djkurtz@google.com, Vijendar Mukunda <Vijendar.Mukunda@amd.com>,
	Alexander.Deucher@amd.com,
	Colin Ian King <colin.king@canonical.com>
Subject: Re: [alsa-devel] [RESEND PATCH v5 3/6] ASoC: amd: Enabling I2S instance in DMA and DAI
Date: Wed, 13 Nov 2019 10:29:57 -0600	[thread overview]
Message-ID: <5ca55e4b-51e5-7d1e-31a6-73f923a10078@linux.intel.com> (raw)
In-Reply-To: <1573629249-13272-4-git-send-email-Vishnuvardhanrao.Ravulapati@amd.com>


> @@ -83,9 +83,20 @@ static int acp3x_i2s_hwparams(struct snd_pcm_substream *substream,
>   		struct snd_pcm_hw_params *params,
>   		struct snd_soc_dai *dai)
>   {
> -	u32 val = 0;
> +	u32 val;
> +	u32 reg_val;

nit-pick: xmas-tree style, move the declarations below


> @@ -104,24 +115,46 @@ static int acp3x_i2s_hwparams(struct snd_pcm_substream *substream,
>   		return -EINVAL;
>   	}
>   	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
> -		val = rv_readl(rtd->acp3x_base + mmACP_BTTDM_ITER);
> -		val = val | (rtd->xfer_resolution  << 3);
> -		rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_ITER);
> +		switch (rtd->i2s_instance) {
> +		case I2S_BT_INSTANCE:
> +			reg_val = mmACP_BTTDM_ITER;
> +			break;
> +		case I2S_SP_INSTANCE:
> +		default:
> +			reg_val = mmACP_I2STDM_ITER;
> +		}
>   	} else {
> -		val = rv_readl(rtd->acp3x_base + mmACP_BTTDM_IRER);
> -		val = val | (rtd->xfer_resolution  << 3);
> -		rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_IRER);
> +		switch (rtd->i2s_instance) {
> +		case I2S_BT_INSTANCE:
> +			reg_val = mmACP_BTTDM_IRER;
> +			break;
> +		case I2S_SP_INSTANCE:
> +		default:
> +			reg_val = mmACP_I2STDM_IRER;
> +		}
>   	}
> +	val = rv_readl(rtd->acp3x_base + reg_val);
> +	val = val | (rtd->xfer_resolution  << 3);
> +	rv_writel(val, rtd->acp3x_base + reg_val);
>   	return 0;
>   }

nice cleanup, much better than previous versions!

>   
>   static int acp3x_i2s_trigger(struct snd_pcm_substream *substream,
>   		int cmd, struct snd_soc_dai *dai)
>   {
> -	int ret = 0;
> +	int ret;

move 2 lines below.

>   	struct i2s_stream_instance *rtd = substream->runtime->private_data;
> -	u32 val, period_bytes;
> -
> +	u32 val, period_bytes, reg_val, ier_val, water_val;
> +	struct snd_soc_pcm_runtime *prtd = substream->private_data;
> +	struct snd_soc_card *card = prtd->card;
> +	struct acp3x_platform_info *pinfo = snd_soc_card_get_drvdata(card);


>   static void config_acp3x_dma(struct i2s_stream_instance *rtd, int direction)
>   {
>   	u16 page_idx;
> -	u32 low, high, val, acp_fifo_addr;
> -	dma_addr_t addr = rtd->dma_addr;
> +	uint64_t low, high, val, acp_fifo_addr;
> +	uint64_t reg_ringbuf_size, reg_dma_size, reg_fifo_size, reg_fifo_addr;
> +	dma_addr_t addr;

nit-pick: xmas-tree style

> @@ -303,13 +346,24 @@ static int acp3x_dma_hw_params(struct snd_soc_component *component,
>   			       struct snd_pcm_hw_params *params)
>   {
>   	int status;
> -	u64 size;
> -	struct snd_pcm_runtime *runtime = substream->runtime;
> -	struct i2s_stream_instance *rtd = runtime->private_data;
> +	uint64_t size;
> +	struct snd_soc_pcm_runtime *prtd = substream->private_data;
> +	struct snd_soc_card *card = prtd->card;
> +	struct acp3x_platform_info *pinfo = snd_soc_card_get_drvdata(card);
>   
> +	struct i2s_stream_instance *rtd = substream->runtime->private_data;

nit pick: xmas-tree style and newlines



  reply	other threads:[~2019-11-13 17:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1573629249-13272-1-git-send-email-Vishnuvardhanrao.Ravulapati@amd.com>
2019-11-13  7:14 ` [PATCH v5 1/6] ASoC: amd:Create multiple I2S platform device Endpoint Ravulapati Vishnu vardhan rao
2019-11-13 16:11   ` [alsa-devel] " Pierre-Louis Bossart
2019-11-13  7:14 ` [RESEND PATCH v5 2/6] ASoC: amd: Refactoring of DAI from DMA driver Ravulapati Vishnu vardhan rao
2019-11-13 16:22   ` [alsa-devel] " Pierre-Louis Bossart
2019-11-13 16:36   ` kbuild test robot
2019-11-13  7:14 ` [RESEND PATCH v5 3/6] ASoC: amd: Enabling I2S instance in DMA and DAI Ravulapati Vishnu vardhan rao
2019-11-13 16:29   ` Pierre-Louis Bossart [this message]
2019-11-13  7:14 ` [RESEND PATCH v5 4/6] ASoC: amd: add ACP3x TDM mode support Ravulapati Vishnu vardhan rao
2019-11-13  7:14 ` [RESEND PATCH v5 5/6] ASoC: amd: handle ACP3x i2s-sp interrupt Ravulapati Vishnu vardhan rao
2019-11-13 16:31   ` [alsa-devel] " Pierre-Louis Bossart
2019-11-13  7:14 ` [RESEND PATCH v5 6/6] ASoC: amd: Added ACP3x system resume and runtime pm Ravulapati Vishnu vardhan rao
2019-11-13 16:39   ` [alsa-devel] " Pierre-Louis Bossart
2019-11-13 17:13   ` kbuild test robot

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=5ca55e4b-51e5-7d1e-31a6-73f923a10078@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=Akshu.Agrawal@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Vijendar.Mukunda@amd.com \
    --cc=Vishnuvardhanrao.Ravulapati@amd.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=colin.king@canonical.com \
    --cc=djkurtz@google.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maruthi.bayyavarapu@amd.com \
    --cc=sanju.mehta@amd.com \
    --cc=tiwai@suse.com \
    --cc=yuehaibing@huawei.com \
    /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

all inboxes | Powered by JetHome®