alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: Intel: Check Haswell IPC process_reply/notification return value.
@ 2014-03-06 14:56 Liam Girdwood
  2014-03-06 14:56 ` [PATCH] ASoC: Intel: Use .dai_fmt for setting Haswell BE format Liam Girdwood
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Liam Girdwood @ 2014-03-06 14:56 UTC (permalink / raw)
  To: Mark Brown; +Cc: Takashi Iwai, Liam Girdwood, alsa-devel

Check the return value for error when processing replies and notifications.

The patch 22981243589c: "ASoC: Intel: Add Haswell/Broadwell IPC" from
> Feb 20, 2014, leads to the following imaginary static checker warning:
>
> 	sound/soc/intel/sst-haswell-ipc.c:898 hsw_irq_thread()
> 	warn: this is always true.
>
> sound/soc/intel/sst-haswell-ipc.c
>    895                  /* Handle Immediate reply from DSP Core */
>    896                  handled = hsw_process_reply(hsw, ipcx);
>                                   ^^^^^^^^^^^^^^^^^
> Returns 1 on success/error and -EIO on error.
>
>    897
>    898                  if (handled) {
>    899                          /* clear DONE bit - tell DSP we have completed */
>    900                          sst_dsp_shim_update_bits_unlocked(sst, SST_IPCX,
>    901                                  SST_IPCX_DONE, 0);
>    902
>    903                          /* unmask Done interrupt */
>    904                          sst_dsp_shim_update_bits_unlocked(sst, SST_IMRX,
>    905                                  SST_IMRX_DONE, 0);
>    906                  }
>

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
---
 sound/soc/intel/sst-haswell-ipc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c
index 1f1576a..f46bb4d 100644
--- a/sound/soc/intel/sst-haswell-ipc.c
+++ b/sound/soc/intel/sst-haswell-ipc.c
@@ -895,7 +895,7 @@ static irqreturn_t hsw_irq_thread(int irq, void *context)
 		/* Handle Immediate reply from DSP Core */
 		handled = hsw_process_reply(hsw, ipcx);
 
-		if (handled) {
+		if (handled > 0) {
 			/* clear DONE bit - tell DSP we have completed */
 			sst_dsp_shim_update_bits_unlocked(sst, SST_IPCX,
 				SST_IPCX_DONE, 0);
@@ -913,7 +913,7 @@ static irqreturn_t hsw_irq_thread(int irq, void *context)
 		handled = hsw_process_notification(hsw);
 
 		/* clear BUSY bit and set DONE bit - accept new messages */
-		if (handled) {
+		if (handled > 0) {
 			sst_dsp_shim_update_bits_unlocked(sst, SST_IPCD,
 				SST_IPCD_BUSY | SST_IPCD_DONE, SST_IPCD_DONE);
 
-- 
1.8.3.2

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

* [PATCH] ASoC: Intel: Use .dai_fmt for setting Haswell BE format.
  2014-03-06 14:56 [PATCH] ASoC: Intel: Check Haswell IPC process_reply/notification return value Liam Girdwood
@ 2014-03-06 14:56 ` Liam Girdwood
  2014-03-07  2:51   ` Mark Brown
  2014-03-06 14:56 ` [PATCH] ASoC: Intel: Clean up indentation for Haswell machine driver/Kconfig Liam Girdwood
  2014-03-07  2:51 ` [PATCH] ASoC: Intel: Check Haswell IPC process_reply/notification return value Mark Brown
  2 siblings, 1 reply; 6+ messages in thread
From: Liam Girdwood @ 2014-03-06 14:56 UTC (permalink / raw)
  To: Mark Brown; +Cc: Takashi Iwai, Liam Girdwood, alsa-devel

Update the Haswell driver to use .dai_fmt in DAI link to set the
format.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
---
 sound/soc/intel/haswell.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/sound/soc/intel/haswell.c b/sound/soc/intel/haswell.c
index 0d61197..54345a2 100644
--- a/sound/soc/intel/haswell.c
+++ b/sound/soc/intel/haswell.c
@@ -69,14 +69,6 @@ static int haswell_rt5640_hw_params(struct snd_pcm_substream *substream,
 	struct snd_soc_dai *codec_dai = rtd->codec_dai;
 	int ret;
 
-	/* Set codec DAI configuration */
-	ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
-			SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
-	if (ret < 0) {
-		dev_err(rtd->dev, "can't set codec DAI configuration\n");
-		return ret;
-	}
-
 	ret = snd_soc_dai_set_sysclk(codec_dai, RT5640_SCLK_S_MCLK, 12288000,
 		SND_SOC_CLOCK_IN);
 
@@ -188,6 +180,8 @@ static struct snd_soc_dai_link haswell_rt5640_dais[] = {
 		.no_pcm = 1,
 		.codec_name = "i2c-INT33CA:00",
 		.codec_dai_name = "rt5640-aif1",
+		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+			SND_SOC_DAIFMT_CBS_CFS,
 		.ignore_suspend = 1,
 		.ignore_pmdown_time = 1,
 		.be_hw_params_fixup = haswell_ssp0_fixup,
-- 
1.8.3.2

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

* [PATCH] ASoC: Intel: Clean up indentation for Haswell machine driver/Kconfig
  2014-03-06 14:56 [PATCH] ASoC: Intel: Check Haswell IPC process_reply/notification return value Liam Girdwood
  2014-03-06 14:56 ` [PATCH] ASoC: Intel: Use .dai_fmt for setting Haswell BE format Liam Girdwood
@ 2014-03-06 14:56 ` Liam Girdwood
  2014-03-07  2:51   ` Mark Brown
  2014-03-07  2:51 ` [PATCH] ASoC: Intel: Check Haswell IPC process_reply/notification return value Mark Brown
  2 siblings, 1 reply; 6+ messages in thread
From: Liam Girdwood @ 2014-03-06 14:56 UTC (permalink / raw)
  To: Mark Brown; +Cc: Takashi Iwai, Liam Girdwood, alsa-devel

Clean up some indentation.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
---
 sound/soc/intel/Kconfig           | 10 +++++-----
 sound/soc/intel/sst-haswell-dsp.c |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig
index 274af16..4577b69 100644
--- a/sound/soc/intel/Kconfig
+++ b/sound/soc/intel/Kconfig
@@ -31,15 +31,15 @@ config SND_SOC_INTEL_BAYTRAIL
 	tristate
 
 config SND_SOC_INTEL_HASWELL_MACH
-        tristate "ASoC Audio DSP support for Intel Haswell Lynxpoint"
-        depends on SND_SOC_INTEL_SST && X86_INTEL_LPSS
+	tristate "ASoC Audio DSP support for Intel Haswell Lynxpoint"
+	depends on SND_SOC_INTEL_SST && X86_INTEL_LPSS
 	select SND_SOC_INTEL_HASWELL
 	select SND_SOC_RT5640
 	help
-          This adds support for the Lynxpoint Audio DSP on Intel(R) Haswell
+	  This adds support for the Lynxpoint Audio DSP on Intel(R) Haswell
 	  Ultrabook platforms.
-          Say Y if you have such a device
-          If unsure select "N".
+	  Say Y if you have such a device
+	  If unsure select "N".
 
 config SND_SOC_INTEL_BYT_RT5640_MACH
 	tristate "ASoC Audio driver for Intel Baytrail with RT5640 codec"
diff --git a/sound/soc/intel/sst-haswell-dsp.c b/sound/soc/intel/sst-haswell-dsp.c
index 12f7317..f5ebf36 100644
--- a/sound/soc/intel/sst-haswell-dsp.c
+++ b/sound/soc/intel/sst-haswell-dsp.c
@@ -503,7 +503,7 @@ static void hsw_free(struct sst_dsp *sst)
 
 struct sst_ops haswell_ops = {
 	.reset = hsw_reset,
-        .boot = hsw_boot,
+	.boot = hsw_boot,
 	.write = sst_shim32_write,
 	.read = sst_shim32_read,
 	.write64 = sst_shim32_write64,
-- 
1.8.3.2

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

* Re: [PATCH] ASoC: Intel: Check Haswell IPC process_reply/notification return value.
  2014-03-06 14:56 [PATCH] ASoC: Intel: Check Haswell IPC process_reply/notification return value Liam Girdwood
  2014-03-06 14:56 ` [PATCH] ASoC: Intel: Use .dai_fmt for setting Haswell BE format Liam Girdwood
  2014-03-06 14:56 ` [PATCH] ASoC: Intel: Clean up indentation for Haswell machine driver/Kconfig Liam Girdwood
@ 2014-03-07  2:51 ` Mark Brown
  2 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2014-03-07  2:51 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: Takashi Iwai, alsa-devel


[-- Attachment #1.1: Type: text/plain, Size: 160 bytes --]

On Thu, Mar 06, 2014 at 02:56:04PM +0000, Liam Girdwood wrote:

> Check the return value for error when processing replies and notifications.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] ASoC: Intel: Use .dai_fmt for setting Haswell BE format.
  2014-03-06 14:56 ` [PATCH] ASoC: Intel: Use .dai_fmt for setting Haswell BE format Liam Girdwood
@ 2014-03-07  2:51   ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2014-03-07  2:51 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: Takashi Iwai, alsa-devel


[-- Attachment #1.1: Type: text/plain, Size: 158 bytes --]

On Thu, Mar 06, 2014 at 02:56:05PM +0000, Liam Girdwood wrote:
> Update the Haswell driver to use .dai_fmt in DAI link to set the
> format.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] ASoC: Intel: Clean up indentation for Haswell machine driver/Kconfig
  2014-03-06 14:56 ` [PATCH] ASoC: Intel: Clean up indentation for Haswell machine driver/Kconfig Liam Girdwood
@ 2014-03-07  2:51   ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2014-03-07  2:51 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: Takashi Iwai, alsa-devel


[-- Attachment #1.1: Type: text/plain, Size: 110 bytes --]

On Thu, Mar 06, 2014 at 02:56:06PM +0000, Liam Girdwood wrote:
> Clean up some indentation.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

end of thread, other threads:[~2014-03-07  2:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-06 14:56 [PATCH] ASoC: Intel: Check Haswell IPC process_reply/notification return value Liam Girdwood
2014-03-06 14:56 ` [PATCH] ASoC: Intel: Use .dai_fmt for setting Haswell BE format Liam Girdwood
2014-03-07  2:51   ` Mark Brown
2014-03-06 14:56 ` [PATCH] ASoC: Intel: Clean up indentation for Haswell machine driver/Kconfig Liam Girdwood
2014-03-07  2:51   ` Mark Brown
2014-03-07  2:51 ` [PATCH] ASoC: Intel: Check Haswell IPC process_reply/notification return value Mark Brown

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).