All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
@ 2013-10-29 11:04 ` Nicolin Chen
  0 siblings, 0 replies; 12+ messages in thread
From: Nicolin Chen @ 2013-10-29 11:04 UTC (permalink / raw)
  To: broonie, timur; +Cc: alsa-devel, linuxppc-dev

This patch enables Tx-related SIER_FLAGS only when direction is PLAYBACK
and does same thing for CAPTURE. Also, after TRIGGER_STOP/PAUSE, it will
disable SIER_xFLAGS for symmetric.

[ Passed compile-test with mpc85xx_defconfig ]

Signed-off-by: Nicolin Chen <b42378@freescale.com>
---
 sound/soc/fsl/fsl_ssi.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 35e2773..3797bf0 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -107,11 +107,14 @@ static inline void write_ssi_mask(u32 __iomem *addr, u32 clear, u32 set)
 #endif
 
 /* SIER bitflag of interrupts to enable */
-#define SIER_FLAGS (CCSR_SSI_SIER_TFRC_EN | CCSR_SSI_SIER_TDMAE | \
+#define SIER_TFLAGS (CCSR_SSI_SIER_TFRC_EN | CCSR_SSI_SIER_TDMAE | \
 		    CCSR_SSI_SIER_TIE | CCSR_SSI_SIER_TUE0_EN | \
-		    CCSR_SSI_SIER_TUE1_EN | CCSR_SSI_SIER_RFRC_EN | \
-		    CCSR_SSI_SIER_RDMAE | CCSR_SSI_SIER_RIE | \
-		    CCSR_SSI_SIER_ROE0_EN | CCSR_SSI_SIER_ROE1_EN)
+		    CCSR_SSI_SIER_TUE1_EN)
+#define SIER_RFLAGS (CCSR_SSI_SIER_RFRC_EN | CCSR_SSI_SIER_RDMAE | \
+		    CCSR_SSI_SIER_RIE | CCSR_SSI_SIER_ROE0_EN | \
+		    CCSR_SSI_SIER_ROE1_EN)
+
+#define SIER_FLAGS (SIER_TFLAGS | SIER_RFLAGS)
 
 /**
  * fsl_ssi_private: per-SSI private data
@@ -560,12 +563,12 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
 
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
 		if (ssi_private->use_dma)
-			sier_bits = SIER_FLAGS;
+			sier_bits = SIER_TFLAGS;
 		else
 			sier_bits = CCSR_SSI_SIER_TIE | CCSR_SSI_SIER_TFE0_EN;
 	} else {
 		if (ssi_private->use_dma)
-			sier_bits = SIER_FLAGS;
+			sier_bits = SIER_RFLAGS;
 		else
 			sier_bits = CCSR_SSI_SIER_RIE | CCSR_SSI_SIER_RFF0_EN;
 	}
@@ -579,6 +582,8 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
 		else
 			write_ssi_mask(&ssi->scr, 0,
 				CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_RE);
+
+		write_ssi_mask(&ssi->sier, 0, sier_bits);
 		break;
 
 	case SNDRV_PCM_TRIGGER_STOP:
@@ -591,14 +596,14 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
 		if (!ssi_private->imx_ac97 && (read_ssi(&ssi->scr) &
 					(CCSR_SSI_SCR_TE | CCSR_SSI_SCR_RE)) == 0)
 			write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_SSIEN, 0);
+
+		write_ssi_mask(&ssi->sier, sier_bits, 0);
 		break;
 
 	default:
 		return -EINVAL;
 	}
 
-	write_ssi(sier_bits, &ssi->sier);
-
 	return 0;
 }
 
-- 
1.8.4

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

* [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
@ 2013-10-29 11:04 ` Nicolin Chen
  0 siblings, 0 replies; 12+ messages in thread
From: Nicolin Chen @ 2013-10-29 11:04 UTC (permalink / raw)
  To: broonie, timur; +Cc: alsa-devel, linuxppc-dev

This patch enables Tx-related SIER_FLAGS only when direction is PLAYBACK
and does same thing for CAPTURE. Also, after TRIGGER_STOP/PAUSE, it will
disable SIER_xFLAGS for symmetric.

[ Passed compile-test with mpc85xx_defconfig ]

Signed-off-by: Nicolin Chen <b42378@freescale.com>
---
 sound/soc/fsl/fsl_ssi.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 35e2773..3797bf0 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -107,11 +107,14 @@ static inline void write_ssi_mask(u32 __iomem *addr, u32 clear, u32 set)
 #endif
 
 /* SIER bitflag of interrupts to enable */
-#define SIER_FLAGS (CCSR_SSI_SIER_TFRC_EN | CCSR_SSI_SIER_TDMAE | \
+#define SIER_TFLAGS (CCSR_SSI_SIER_TFRC_EN | CCSR_SSI_SIER_TDMAE | \
 		    CCSR_SSI_SIER_TIE | CCSR_SSI_SIER_TUE0_EN | \
-		    CCSR_SSI_SIER_TUE1_EN | CCSR_SSI_SIER_RFRC_EN | \
-		    CCSR_SSI_SIER_RDMAE | CCSR_SSI_SIER_RIE | \
-		    CCSR_SSI_SIER_ROE0_EN | CCSR_SSI_SIER_ROE1_EN)
+		    CCSR_SSI_SIER_TUE1_EN)
+#define SIER_RFLAGS (CCSR_SSI_SIER_RFRC_EN | CCSR_SSI_SIER_RDMAE | \
+		    CCSR_SSI_SIER_RIE | CCSR_SSI_SIER_ROE0_EN | \
+		    CCSR_SSI_SIER_ROE1_EN)
+
+#define SIER_FLAGS (SIER_TFLAGS | SIER_RFLAGS)
 
 /**
  * fsl_ssi_private: per-SSI private data
@@ -560,12 +563,12 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
 
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
 		if (ssi_private->use_dma)
-			sier_bits = SIER_FLAGS;
+			sier_bits = SIER_TFLAGS;
 		else
 			sier_bits = CCSR_SSI_SIER_TIE | CCSR_SSI_SIER_TFE0_EN;
 	} else {
 		if (ssi_private->use_dma)
-			sier_bits = SIER_FLAGS;
+			sier_bits = SIER_RFLAGS;
 		else
 			sier_bits = CCSR_SSI_SIER_RIE | CCSR_SSI_SIER_RFF0_EN;
 	}
@@ -579,6 +582,8 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
 		else
 			write_ssi_mask(&ssi->scr, 0,
 				CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_RE);
+
+		write_ssi_mask(&ssi->sier, 0, sier_bits);
 		break;
 
 	case SNDRV_PCM_TRIGGER_STOP:
@@ -591,14 +596,14 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
 		if (!ssi_private->imx_ac97 && (read_ssi(&ssi->scr) &
 					(CCSR_SSI_SCR_TE | CCSR_SSI_SCR_RE)) == 0)
 			write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_SSIEN, 0);
+
+		write_ssi_mask(&ssi->sier, sier_bits, 0);
 		break;
 
 	default:
 		return -EINVAL;
 	}
 
-	write_ssi(sier_bits, &ssi->sier);
-
 	return 0;
 }
 
-- 
1.8.4

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

* Re: [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
  2013-10-29 11:59 ` Timur Tabi
@ 2013-10-29 11:57   ` Nicolin Chen
  2013-10-29 12:18     ` Timur Tabi
  0 siblings, 1 reply; 12+ messages in thread
From: Nicolin Chen @ 2013-10-29 11:57 UTC (permalink / raw)
  To: Timur Tabi; +Cc: alsa-devel, broonie, linuxppc-dev

On Tue, Oct 29, 2013 at 06:59:44AM -0500, Timur Tabi wrote:
> Nicolin Chen wrote:
> >This patch enables Tx-related SIER_FLAGS only when direction is PLAYBACK
> >and does same thing for CAPTURE. Also, after TRIGGER_STOP/PAUSE, it will
> >disable SIER_xFLAGS for symmetric.
> 
> I'm okay with this patch in principle, but why bother?  The sysfs
> entry is going to display all interrupts anyway, and so the result
> will be the same.
>

Well, actually I just wanted to clear T/RDMAE to disable DMA request,
but it seems to be much easier to do it like this based on current
code and disabling unused interrupts should be better right? :)

Thank you,
Nicolin Chen

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

* Re: [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
  2013-10-29 11:04 ` Nicolin Chen
  (?)
@ 2013-10-29 11:59 ` Timur Tabi
  2013-10-29 11:57   ` Nicolin Chen
  -1 siblings, 1 reply; 12+ messages in thread
From: Timur Tabi @ 2013-10-29 11:59 UTC (permalink / raw)
  To: Nicolin Chen, broonie; +Cc: alsa-devel, linuxppc-dev

Nicolin Chen wrote:
> This patch enables Tx-related SIER_FLAGS only when direction is PLAYBACK
> and does same thing for CAPTURE. Also, after TRIGGER_STOP/PAUSE, it will
> disable SIER_xFLAGS for symmetric.

I'm okay with this patch in principle, but why bother?  The sysfs entry 
is going to display all interrupts anyway, and so the result will be the 
same.

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

* Re: [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
  2013-10-29 12:18     ` Timur Tabi
@ 2013-10-29 12:13       ` Nicolin Chen
  2013-10-29 12:40         ` Timur Tabi
  0 siblings, 1 reply; 12+ messages in thread
From: Nicolin Chen @ 2013-10-29 12:13 UTC (permalink / raw)
  To: Timur Tabi; +Cc: alsa-devel, broonie, linuxppc-dev

On Tue, Oct 29, 2013 at 07:18:21AM -0500, Timur Tabi wrote:
> Nicolin Chen wrote:
> >Well, actually I just wanted to clear T/RDMAE to disable DMA request,
> >but it seems to be much easier to do it like this based on current
> >code and disabling unused interrupts should be better right?:)
> 
> It's not better if it complicates the code and has no real impact.
> The code has been running fine for years the way it is.  Unless you
> can show me that it actually makes a difference, I will have to NACK
> this patch.
>

The DMA request might be remaining high if not disabling it. This would
cause SDMA re-check this request, while it has no BD existing. For the
other interrupts, if you don't like it, I can drop it. Just modification
to the driver might not be less complicated.

Thank you,
Nicolin Chen

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

* Re: [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
  2013-10-29 11:57   ` Nicolin Chen
@ 2013-10-29 12:18     ` Timur Tabi
  2013-10-29 12:13       ` Nicolin Chen
  0 siblings, 1 reply; 12+ messages in thread
From: Timur Tabi @ 2013-10-29 12:18 UTC (permalink / raw)
  To: Nicolin Chen; +Cc: alsa-devel, broonie, linuxppc-dev

Nicolin Chen wrote:
> Well, actually I just wanted to clear T/RDMAE to disable DMA request,
> but it seems to be much easier to do it like this based on current
> code and disabling unused interrupts should be better right?:)

It's not better if it complicates the code and has no real impact.  The 
code has been running fine for years the way it is.  Unless you can show 
me that it actually makes a difference, I will have to NACK this patch.

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

* Re: [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
  2013-10-29 12:13       ` Nicolin Chen
@ 2013-10-29 12:40         ` Timur Tabi
  2013-10-29 13:00             ` Chen Guangyu-B42378
  0 siblings, 1 reply; 12+ messages in thread
From: Timur Tabi @ 2013-10-29 12:40 UTC (permalink / raw)
  To: Nicolin Chen; +Cc: alsa-devel, broonie, linuxppc-dev

Nicolin Chen wrote:
> The DMA request might be remaining high if not disabling it.

Might?  Are you just guessing?

> This would
> cause SDMA re-check this request, while it has no BD existing. For the
> other interrupts, if you don't like it, I can drop it. Just modification
> to the driver might not be less complicated.

I'm only talking about this particular patch.

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

* Re: [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
  2013-10-29 12:40         ` Timur Tabi
@ 2013-10-29 13:00             ` Chen Guangyu-B42378
  0 siblings, 0 replies; 12+ messages in thread
From: Chen Guangyu-B42378 @ 2013-10-29 13:00 UTC (permalink / raw)
  To: Timur Tabi; +Cc: alsa-devel, broonie, linuxppc-dev

I mean there is a possibility.

 I'm sorry if my patch is kinda annoying and it really bother you, sir. I also want to make things better.

If you really don't like it, we can drop it. It's all your call.

And thank you for reviewing.

Sent by Android device.

Timur Tabi <timur@tabi.org> wrote:


Nicolin Chen wrote:
> The DMA request might be remaining high if not disabling it.

Might?  Are you just guessing?

> This would
> cause SDMA re-check this request, while it has no BD existing. For the
> other interrupts, if you don't like it, I can drop it. Just modification
> to the driver might not be less complicated.

I'm only talking about this particular patch.

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

* Re: [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
@ 2013-10-29 13:00             ` Chen Guangyu-B42378
  0 siblings, 0 replies; 12+ messages in thread
From: Chen Guangyu-B42378 @ 2013-10-29 13:00 UTC (permalink / raw)
  To: Timur Tabi; +Cc: alsa-devel, broonie, linuxppc-dev

I mean there is a possibility.

 I'm sorry if my patch is kinda annoying and it really bother you, sir. I a=
lso want to make things better.

If you really don't like it, we can drop it. It's all your call.

And thank you for reviewing.

Sent by Android device.

Timur Tabi <timur@tabi.org> wrote:


Nicolin Chen wrote:
> The DMA request might be remaining high if not disabling it.

Might?  Are you just guessing?

> This would
> cause SDMA re-check this request, while it has no BD existing. For the
> other interrupts, if you don't like it, I can drop it. Just modification
> to the driver might not be less complicated.

I'm only talking about this particular patch.

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

* Re: [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
  2013-10-29 13:00             ` Chen Guangyu-B42378
  (?)
@ 2013-10-29 13:14             ` Timur Tabi
  2013-10-29 13:16                 ` Chen Guangyu-B42378
  -1 siblings, 1 reply; 12+ messages in thread
From: Timur Tabi @ 2013-10-29 13:14 UTC (permalink / raw)
  To: Chen Guangyu-B42378; +Cc: alsa-devel, broonie, linuxppc-dev

Chen Guangyu-B42378 wrote:
> I mean there is a possibility.
>
>   I'm sorry if my patch is kinda annoying and it really bother you, sir. I also want to make things better.

It does not bother me.  I'm glad people are working on my driver.  I 
just want to make sure that my driver does not get bloated.

>
> If you really don't like it, we can drop it. It's all your call.

I think this patch should be dropped, because I don't see any real 
reason for it.

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

* Re: [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
  2013-10-29 13:14             ` Timur Tabi
@ 2013-10-29 13:16                 ` Chen Guangyu-B42378
  0 siblings, 0 replies; 12+ messages in thread
From: Chen Guangyu-B42378 @ 2013-10-29 13:16 UTC (permalink / raw)
  To: Timur Tabi; +Cc: alsa-devel, broonie, linuxppc-dev

As you wish, sir.

Sent by Android device.

Timur Tabi <timur@tabi.org> wrote:


Chen Guangyu-B42378 wrote:
> I mean there is a possibility.
>
>   I'm sorry if my patch is kinda annoying and it really bother you, sir. I also want to make things better.

It does not bother me.  I'm glad people are working on my driver.  I
just want to make sure that my driver does not get bloated.

>
> If you really don't like it, we can drop it. It's all your call.

I think this patch should be dropped, because I don't see any real
reason for it.

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

* Re: [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
@ 2013-10-29 13:16                 ` Chen Guangyu-B42378
  0 siblings, 0 replies; 12+ messages in thread
From: Chen Guangyu-B42378 @ 2013-10-29 13:16 UTC (permalink / raw)
  To: Timur Tabi; +Cc: alsa-devel, broonie, linuxppc-dev

As you wish, sir.

Sent by Android device.

Timur Tabi <timur@tabi.org> wrote:


Chen Guangyu-B42378 wrote:
> I mean there is a possibility.
>
>   I'm sorry if my patch is kinda annoying and it really bother you, sir. =
I also want to make things better.

It does not bother me.  I'm glad people are working on my driver.  I
just want to make sure that my driver does not get bloated.

>
> If you really don't like it, we can drop it. It's all your call.

I think this patch should be dropped, because I don't see any real
reason for it.

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

end of thread, other threads:[~2013-10-29 13:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-29 11:04 [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger() Nicolin Chen
2013-10-29 11:04 ` Nicolin Chen
2013-10-29 11:59 ` Timur Tabi
2013-10-29 11:57   ` Nicolin Chen
2013-10-29 12:18     ` Timur Tabi
2013-10-29 12:13       ` Nicolin Chen
2013-10-29 12:40         ` Timur Tabi
2013-10-29 13:00           ` Chen Guangyu-B42378
2013-10-29 13:00             ` Chen Guangyu-B42378
2013-10-29 13:14             ` Timur Tabi
2013-10-29 13:16               ` Chen Guangyu-B42378
2013-10-29 13:16                 ` Chen Guangyu-B42378

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.