[alsa-devel] [PATCH] ASoC: Intel: Check Haswell IPC process_reply/notification return value.
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);
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,
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,
participants (2)
-
Liam Girdwood
-
Mark Brown