All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jose Abreu <Jose.Abreu@synopsys.com>
To: linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, alsa-devel@alsa-project.org
Cc: broonie@kernel.org, CARLOS.PALMINHA@synopsys.com,
	Alexey.Brodkin@synopsys.com, Vineet.Gupta1@synopsys.com,
	architt@codeaurora.org, airlied@linux.ie, lgirdwood@gmail.com,
	perex@perex.cz, tiwai@suse.com,
	Jose Abreu <Jose.Abreu@synopsys.com>
Subject: [PATCH 3/5 v4] ASoC: dwc: Use fifo depth to program FCR
Date: Thu,  7 Apr 2016 17:53:57 +0100	[thread overview]
Message-ID: <5aa4bcb0eba226af2e78fc530ad7d0429d2c96ca.1460047238.git.joabreu@synopsys.com> (raw)
In-Reply-To: <cover.1460047238.git.joabreu@synopsys.com>
In-Reply-To: <cover.1460047238.git.joabreu@synopsys.com>

This patch makes Designware I2S driver use the fifo
depth value to program the fifo configuration register
instead of using hardcoded values.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
---

This patch was only introduced in v4.

 sound/soc/dwc/designware_i2s.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c
index 3effcd1..0db69b7 100644
--- a/sound/soc/dwc/designware_i2s.c
+++ b/sound/soc/dwc/designware_i2s.c
@@ -100,6 +100,7 @@ struct dw_i2s_dev {
 	struct device *dev;
 	u32 ccr;
 	u32 xfer_resolution;
+	u32 fifo_th;
 
 	/* data related to DMA transfers b/w i2s and DMAC */
 	union dw_i2s_snd_dma_data play_dma_data;
@@ -232,14 +233,16 @@ static void dw_i2s_config(struct dw_i2s_dev *dev, int stream)
 		if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
 			i2s_write_reg(dev->i2s_base, TCR(ch_reg),
 				      dev->xfer_resolution);
-			i2s_write_reg(dev->i2s_base, TFCR(ch_reg), 0x02);
+			i2s_write_reg(dev->i2s_base, TFCR(ch_reg),
+				      dev->fifo_th - 1);
 			irq = i2s_read_reg(dev->i2s_base, IMR(ch_reg));
 			i2s_write_reg(dev->i2s_base, IMR(ch_reg), irq & ~0x30);
 			i2s_write_reg(dev->i2s_base, TER(ch_reg), 1);
 		} else {
 			i2s_write_reg(dev->i2s_base, RCR(ch_reg),
 				      dev->xfer_resolution);
-			i2s_write_reg(dev->i2s_base, RFCR(ch_reg), 0x07);
+			i2s_write_reg(dev->i2s_base, RFCR(ch_reg),
+				      dev->fifo_th - 1);
 			irq = i2s_read_reg(dev->i2s_base, IMR(ch_reg));
 			i2s_write_reg(dev->i2s_base, IMR(ch_reg), irq & ~0x03);
 			i2s_write_reg(dev->i2s_base, RER(ch_reg), 1);
@@ -499,6 +502,7 @@ static int dw_configure_dai(struct dw_i2s_dev *dev,
 	 */
 	u32 comp1 = i2s_read_reg(dev->i2s_base, dev->i2s_reg_comp1);
 	u32 comp2 = i2s_read_reg(dev->i2s_base, dev->i2s_reg_comp2);
+	u32 fifo_depth = 1 << (1 + COMP1_FIFO_DEPTH_GLOBAL(comp1));
 	u32 idx;
 
 	if (dev->capability & DWC_I2S_RECORD &&
@@ -537,6 +541,7 @@ static int dw_configure_dai(struct dw_i2s_dev *dev,
 		dev->capability |= DW_I2S_SLAVE;
 	}
 
+	dev->fifo_th = fifo_depth / 2;
 	return 0;
 }
 
-- 
1.9.1

WARNING: multiple messages have this Message-ID (diff)
From: Jose Abreu <Jose.Abreu@synopsys.com>
To: linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, alsa-devel@alsa-project.org
Cc: Jose Abreu <Jose.Abreu@synopsys.com>,
	architt@codeaurora.org, airlied@linux.ie,
	Vineet.Gupta1@synopsys.com, Alexey.Brodkin@synopsys.com,
	CARLOS.PALMINHA@synopsys.com, lgirdwood@gmail.com,
	broonie@kernel.org, tiwai@suse.com, perex@perex.cz
Subject: [PATCH 3/5 v4] ASoC: dwc: Use fifo depth to program FCR
Date: Thu,  7 Apr 2016 17:53:57 +0100	[thread overview]
Message-ID: <5aa4bcb0eba226af2e78fc530ad7d0429d2c96ca.1460047238.git.joabreu@synopsys.com> (raw)
In-Reply-To: <cover.1460047238.git.joabreu@synopsys.com>
In-Reply-To: <cover.1460047238.git.joabreu@synopsys.com>

This patch makes Designware I2S driver use the fifo
depth value to program the fifo configuration register
instead of using hardcoded values.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
---

This patch was only introduced in v4.

 sound/soc/dwc/designware_i2s.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c
index 3effcd1..0db69b7 100644
--- a/sound/soc/dwc/designware_i2s.c
+++ b/sound/soc/dwc/designware_i2s.c
@@ -100,6 +100,7 @@ struct dw_i2s_dev {
 	struct device *dev;
 	u32 ccr;
 	u32 xfer_resolution;
+	u32 fifo_th;
 
 	/* data related to DMA transfers b/w i2s and DMAC */
 	union dw_i2s_snd_dma_data play_dma_data;
@@ -232,14 +233,16 @@ static void dw_i2s_config(struct dw_i2s_dev *dev, int stream)
 		if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
 			i2s_write_reg(dev->i2s_base, TCR(ch_reg),
 				      dev->xfer_resolution);
-			i2s_write_reg(dev->i2s_base, TFCR(ch_reg), 0x02);
+			i2s_write_reg(dev->i2s_base, TFCR(ch_reg),
+				      dev->fifo_th - 1);
 			irq = i2s_read_reg(dev->i2s_base, IMR(ch_reg));
 			i2s_write_reg(dev->i2s_base, IMR(ch_reg), irq & ~0x30);
 			i2s_write_reg(dev->i2s_base, TER(ch_reg), 1);
 		} else {
 			i2s_write_reg(dev->i2s_base, RCR(ch_reg),
 				      dev->xfer_resolution);
-			i2s_write_reg(dev->i2s_base, RFCR(ch_reg), 0x07);
+			i2s_write_reg(dev->i2s_base, RFCR(ch_reg),
+				      dev->fifo_th - 1);
 			irq = i2s_read_reg(dev->i2s_base, IMR(ch_reg));
 			i2s_write_reg(dev->i2s_base, IMR(ch_reg), irq & ~0x03);
 			i2s_write_reg(dev->i2s_base, RER(ch_reg), 1);
@@ -499,6 +502,7 @@ static int dw_configure_dai(struct dw_i2s_dev *dev,
 	 */
 	u32 comp1 = i2s_read_reg(dev->i2s_base, dev->i2s_reg_comp1);
 	u32 comp2 = i2s_read_reg(dev->i2s_base, dev->i2s_reg_comp2);
+	u32 fifo_depth = 1 << (1 + COMP1_FIFO_DEPTH_GLOBAL(comp1));
 	u32 idx;
 
 	if (dev->capability & DWC_I2S_RECORD &&
@@ -537,6 +541,7 @@ static int dw_configure_dai(struct dw_i2s_dev *dev,
 		dev->capability |= DW_I2S_SLAVE;
 	}
 
+	dev->fifo_th = fifo_depth / 2;
 	return 0;
 }
 
-- 
1.9.1

WARNING: multiple messages have this Message-ID (diff)
From: Jose.Abreu@synopsys.com (Jose Abreu)
To: linux-snps-arc@lists.infradead.org
Subject: [PATCH 3/5 v4] ASoC: dwc: Use fifo depth to program FCR
Date: Thu,  7 Apr 2016 17:53:57 +0100	[thread overview]
Message-ID: <5aa4bcb0eba226af2e78fc530ad7d0429d2c96ca.1460047238.git.joabreu@synopsys.com> (raw)
In-Reply-To: <cover.1460047238.git.joabreu@synopsys.com>

This patch makes Designware I2S driver use the fifo
depth value to program the fifo configuration register
instead of using hardcoded values.

Signed-off-by: Jose Abreu <joabreu at synopsys.com>
---

This patch was only introduced in v4.

 sound/soc/dwc/designware_i2s.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c
index 3effcd1..0db69b7 100644
--- a/sound/soc/dwc/designware_i2s.c
+++ b/sound/soc/dwc/designware_i2s.c
@@ -100,6 +100,7 @@ struct dw_i2s_dev {
 	struct device *dev;
 	u32 ccr;
 	u32 xfer_resolution;
+	u32 fifo_th;
 
 	/* data related to DMA transfers b/w i2s and DMAC */
 	union dw_i2s_snd_dma_data play_dma_data;
@@ -232,14 +233,16 @@ static void dw_i2s_config(struct dw_i2s_dev *dev, int stream)
 		if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
 			i2s_write_reg(dev->i2s_base, TCR(ch_reg),
 				      dev->xfer_resolution);
-			i2s_write_reg(dev->i2s_base, TFCR(ch_reg), 0x02);
+			i2s_write_reg(dev->i2s_base, TFCR(ch_reg),
+				      dev->fifo_th - 1);
 			irq = i2s_read_reg(dev->i2s_base, IMR(ch_reg));
 			i2s_write_reg(dev->i2s_base, IMR(ch_reg), irq & ~0x30);
 			i2s_write_reg(dev->i2s_base, TER(ch_reg), 1);
 		} else {
 			i2s_write_reg(dev->i2s_base, RCR(ch_reg),
 				      dev->xfer_resolution);
-			i2s_write_reg(dev->i2s_base, RFCR(ch_reg), 0x07);
+			i2s_write_reg(dev->i2s_base, RFCR(ch_reg),
+				      dev->fifo_th - 1);
 			irq = i2s_read_reg(dev->i2s_base, IMR(ch_reg));
 			i2s_write_reg(dev->i2s_base, IMR(ch_reg), irq & ~0x03);
 			i2s_write_reg(dev->i2s_base, RER(ch_reg), 1);
@@ -499,6 +502,7 @@ static int dw_configure_dai(struct dw_i2s_dev *dev,
 	 */
 	u32 comp1 = i2s_read_reg(dev->i2s_base, dev->i2s_reg_comp1);
 	u32 comp2 = i2s_read_reg(dev->i2s_base, dev->i2s_reg_comp2);
+	u32 fifo_depth = 1 << (1 + COMP1_FIFO_DEPTH_GLOBAL(comp1));
 	u32 idx;
 
 	if (dev->capability & DWC_I2S_RECORD &&
@@ -537,6 +541,7 @@ static int dw_configure_dai(struct dw_i2s_dev *dev,
 		dev->capability |= DW_I2S_SLAVE;
 	}
 
+	dev->fifo_th = fifo_depth / 2;
 	return 0;
 }
 
-- 
1.9.1

  parent reply	other threads:[~2016-04-07 16:55 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-07 16:53 [PATCH 0/5 v4] Add I2S/ADV7511 audio support for ARC AXS10x boards Jose Abreu
2016-04-07 16:53 ` Jose Abreu
2016-04-07 16:53 ` Jose Abreu
2016-04-07 16:53 ` [PATCH 1/5 v4] drm/i2c/adv7511: Rename and move to separate folder Jose Abreu
2016-04-07 16:53   ` Jose Abreu
2016-04-07 16:53   ` Jose Abreu
2016-04-07 16:53 ` [PATCH 2/5 v4] drm/i2c/adv7511: Add audio support Jose Abreu
2016-04-07 16:53   ` Jose Abreu
2016-04-08 15:46   ` [alsa-devel] " Lars-Peter Clausen
2016-04-08 15:46     ` Lars-Peter Clausen
2016-04-08 16:05     ` Jose Abreu
2016-04-08 16:12     ` Jose Abreu
2016-04-08 16:12       ` Jose Abreu
2016-04-08 16:12       ` Jose Abreu
2016-04-09 15:02       ` [alsa-devel] " Lars-Peter Clausen
2016-04-09 15:02         ` Lars-Peter Clausen
2016-04-09 15:02         ` Lars-Peter Clausen
2016-04-11  9:27         ` Jose Abreu
2016-04-11  9:27           ` Jose Abreu
2016-04-11  9:27           ` Jose Abreu
2016-04-11  9:33           ` Lars-Peter Clausen
2016-04-11  9:33             ` Lars-Peter Clausen
2016-04-11  9:33             ` Lars-Peter Clausen
2016-04-11 11:32             ` Jose Abreu
2016-04-11 11:32               ` Jose Abreu
2016-04-11 11:32               ` Jose Abreu
2016-04-11 12:23               ` [alsa-devel] " Lars-Peter Clausen
2016-04-11 12:23                 ` Lars-Peter Clausen
2016-04-11 12:23                 ` Lars-Peter Clausen
2016-04-11 14:08                 ` Jose Abreu
2016-04-11 14:08                   ` Jose Abreu
2016-04-11 14:08                   ` Jose Abreu
2016-04-11 19:34                   ` [alsa-devel] " Lars-Peter Clausen
2016-04-11 19:34                     ` Lars-Peter Clausen
2016-04-11 19:34                     ` Lars-Peter Clausen
2016-04-07 16:53 ` Jose Abreu [this message]
2016-04-07 16:53   ` [PATCH 3/5 v4] ASoC: dwc: Use fifo depth to program FCR Jose Abreu
2016-04-07 16:53   ` Jose Abreu
2016-04-07 17:57   ` Applied "ASoC: dwc: Use fifo depth to program FCR" to the asoc tree Mark Brown
2016-04-07 17:57     ` Mark Brown
2016-04-07 17:57     ` Mark Brown
2016-04-07 16:53 ` [PATCH 4/5 v4] ASoC: dwc: Add custom PCM driver Jose Abreu
2016-04-07 16:53   ` Jose Abreu
2016-04-07 17:54   ` kbuild test robot
2016-04-07 17:54     ` kbuild test robot
2016-04-07 17:54     ` kbuild test robot
2016-04-07 16:53 ` [PATCH 5/5 v4] ASoC: dwc: Update DOCUMENTATION for I2S Driver Jose Abreu
2016-04-07 16:53   ` Jose Abreu
2016-04-07 17:53   ` Mark Brown
2016-04-07 17:53     ` Mark Brown
2016-04-07 17:53     ` Mark Brown
2016-04-08 10:06     ` Jose Abreu
2016-04-08 10:06       ` Jose Abreu
2016-04-08 10:06       ` Jose Abreu
2016-04-08 15:52       ` [alsa-devel] " Lars-Peter Clausen
2016-04-08 15:52         ` Lars-Peter Clausen
2016-04-08 15:52         ` Lars-Peter Clausen
2016-04-08 16:08         ` Jose Abreu
2016-04-08 16:08           ` Jose Abreu
2016-04-08 16:08           ` Jose Abreu
2016-04-09 14:55           ` Lars-Peter Clausen
2016-04-09 14:55             ` Lars-Peter Clausen
2016-04-09 14:55             ` Lars-Peter Clausen
2016-04-11  9:24             ` Jose Abreu
2016-04-11  9:24               ` Jose Abreu
2016-04-11  9:24               ` Jose Abreu

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=5aa4bcb0eba226af2e78fc530ad7d0429d2c96ca.1460047238.git.joabreu@synopsys.com \
    --to=jose.abreu@synopsys.com \
    --cc=Alexey.Brodkin@synopsys.com \
    --cc=CARLOS.PALMINHA@synopsys.com \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=airlied@linux.ie \
    --cc=alsa-devel@alsa-project.org \
    --cc=architt@codeaurora.org \
    --cc=broonie@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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 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.