summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2020-08-25 20:53:30 +0100
committerMark Brown <broonie@kernel.org>2020-08-25 20:53:30 +0100
commit9db6f4329cd2c16499d1c165311092f1b5c45a51 (patch)
tree29b7887d0589346023e0e73c25b973299358fb74
parent672072976bf0db6e0aca5382bcf03bc90f439923 (diff)
parent135ab457e776d042c481d70d8954f6775ce35958 (diff)
Merge series "ASoC: SOF: trivial code/log/comment improvements" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Remove useless variable initialization and allocation, adjust log levels to make support easier, and fix comments. No functional changes. Guennadi Liakhovetski (2): ASoC: SOF: topology: (cosmetic) remove redundant variable initialisations ASoC: SOF: (cosmetic) use the "bool" type where it makes sense Pierre-Louis Bossart (4): ASoC: SOF: IPC: reduce verbosity of IPC pointer updates ASoC: SOF: acpi: add dev_dbg() log for probe completion ASoC: SOF: Intel: add dev_dbg log when driver is not selected ASoC: Intel: use consistent HDAudio spelling in comments/docs Ranjani Sridharan (2): ASoC: SOF: topology: remove unnecessary memory alloc for sdev->private ASoC: SOF: topology: reduce the log level for unhandled widgets include/sound/soc-acpi.h | 2 +- sound/soc/intel/Kconfig | 2 +- sound/soc/intel/skylake/skl.c | 6 +++--- sound/soc/sof/Kconfig | 2 +- sound/soc/sof/intel/Kconfig | 2 +- sound/soc/sof/ipc.c | 16 +++++++++++----- sound/soc/sof/pcm.c | 8 ++++---- sound/soc/sof/sof-acpi-dev.c | 2 ++ sound/soc/sof/sof-pci-dev.c | 6 +++--- sound/soc/sof/sof-priv.h | 10 +++++----- sound/soc/sof/topology.c | 20 ++++---------------- 11 files changed, 36 insertions(+), 40 deletions(-) base-commit: aafdeba5cbc14cecee3797e669473b70a2b3e81e -- 2.25.1
-rw-r--r--include/sound/soc-acpi.h2
-rw-r--r--sound/soc/intel/Kconfig2
-rw-r--r--sound/soc/intel/skylake/skl.c6
-rw-r--r--sound/soc/sof/Kconfig2
-rw-r--r--sound/soc/sof/intel/Kconfig2
-rw-r--r--sound/soc/sof/ipc.c16
-rw-r--r--sound/soc/sof/pcm.c8
-rw-r--r--sound/soc/sof/sof-acpi-dev.c2
-rw-r--r--sound/soc/sof/sof-pci-dev.c6
-rw-r--r--sound/soc/sof/sof-priv.h10
-rw-r--r--sound/soc/sof/topology.c20
11 files changed, 36 insertions, 40 deletions
diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h
index d2e9e3b4d7ea..b77b05c413a3 100644
--- a/include/sound/soc-acpi.h
+++ b/include/sound/soc-acpi.h
@@ -58,7 +58,7 @@ static inline struct snd_soc_acpi_mach *snd_soc_acpi_codec_list(void *arg)
* snd_soc_acpi_mach_params: interface for machine driver configuration
*
* @acpi_ipc_irq_index: used for BYT-CR detection
- * @platform: string used for HDaudio codec support
+ * @platform: string used for HDAudio codec support
* @codec_mask: used for HDAudio support
* @common_hdmi_codec_drv: use commom HDAudio HDMI codec driver
* @link_mask: links enabled on the board
diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig
index 82805a8681e5..0e48c4f532ce 100644
--- a/sound/soc/intel/Kconfig
+++ b/sound/soc/intel/Kconfig
@@ -209,7 +209,7 @@ config SND_SOC_INTEL_SKYLAKE_SSP_CLK
config SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC
bool "HDAudio codec support"
help
- If you have Intel Skylake or Kabylake with HDaudio codec
+ If you have Intel Skylake or Kabylake with HDAudio codec
and DMIC present then enable this option by saying Y.
config SND_SOC_INTEL_SKYLAKE_COMMON
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index 63182bfd7941..ea00cf61d1a8 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -925,7 +925,7 @@ static int skl_first_init(struct hdac_bus *bus)
/* check if PPCAP exists */
if (!bus->ppcap) {
- dev_err(bus->dev, "bus ppcap not set, HDaudio or DSP not present?\n");
+ dev_err(bus->dev, "bus ppcap not set, HDAudio or DSP not present?\n");
return -ENODEV;
}
@@ -986,7 +986,7 @@ static int skl_probe(struct pci_dev *pci,
return -ENODEV;
break;
case SND_SKL_PCI_BIND_LEGACY:
- dev_info(&pci->dev, "Module parameter forced binding with HDaudio legacy, aborting probe\n");
+ dev_info(&pci->dev, "Module parameter forced binding with HDAudio legacy, aborting probe\n");
return -ENODEV;
case SND_SKL_PCI_BIND_ASOC:
dev_info(&pci->dev, "Module parameter forced binding with SKL driver, bypassed detection logic\n");
@@ -1021,7 +1021,7 @@ static int skl_probe(struct pci_dev *pci,
err = -ENODEV;
goto out_free;
#else
- dev_warn(bus->dev, "no nhlt info found, continuing to try to enable HDaudio codec\n");
+ dev_warn(bus->dev, "no nhlt info found, continuing to try to enable HDAudio codec\n");
#endif
} else {
diff --git a/sound/soc/sof/Kconfig b/sound/soc/sof/Kconfig
index 4dda4b62509f..8c1f0829de40 100644
--- a/sound/soc/sof/Kconfig
+++ b/sound/soc/sof/Kconfig
@@ -73,7 +73,7 @@ config SND_SOC_SOF_NOCODEC_SUPPORT
option if no known codec is detected. This is typically only
enabled for developers or devices where the sound card is
controlled externally
- This option is mutually exclusive with the Intel HDaudio support,
+ This option is mutually exclusive with the Intel HDAudio support,
selecting it may have negative impacts and prevent e.g. microphone
functionality from being enabled on Intel CoffeeLake and later
platforms.
diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig
index f644010cc568..a066e08860cb 100644
--- a/sound/soc/sof/intel/Kconfig
+++ b/sound/soc/sof/intel/Kconfig
@@ -311,7 +311,7 @@ config SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1
bool "SOF enable DMI Link L1"
help
This option enables DMI L1 for both playback and capture
- and disables known workarounds for specific HDaudio platforms.
+ and disables known workarounds for specific HDAudio platforms.
Only use to look into power optimizations on platforms not
affected by DMI L1 issues. This option is not recommended.
Say Y if you want to enable DMI Link L1
diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c
index 36e2d4d43da4..fd2b96ae4943 100644
--- a/sound/soc/sof/ipc.c
+++ b/sound/soc/sof/ipc.c
@@ -54,6 +54,7 @@ static void ipc_log_header(struct device *dev, u8 *text, u32 cmd)
u8 *str2 = NULL;
u32 glb;
u32 type;
+ bool vdbg = false;
glb = cmd & SOF_GLB_TYPE_MASK;
type = cmd & SOF_CMD_TYPE_MASK;
@@ -146,6 +147,7 @@ static void ipc_log_header(struct device *dev, u8 *text, u32 cmd)
case SOF_IPC_STREAM_TRIG_XRUN:
str2 = "TRIG_XRUN"; break;
case SOF_IPC_STREAM_POSITION:
+ vdbg = true;
str2 = "POSITION"; break;
case SOF_IPC_STREAM_VORBIS_PARAMS:
str2 = "VORBIS_PARAMS"; break;
@@ -183,10 +185,14 @@ static void ipc_log_header(struct device *dev, u8 *text, u32 cmd)
str = "unknown GLB command"; break;
}
- if (str2)
- dev_dbg(dev, "%s: 0x%x: %s: %s\n", text, cmd, str, str2);
- else
+ if (str2) {
+ if (vdbg)
+ dev_vdbg(dev, "%s: 0x%x: %s: %s\n", text, cmd, str, str2);
+ else
+ dev_dbg(dev, "%s: 0x%x: %s: %s\n", text, cmd, str, str2);
+ } else {
dev_dbg(dev, "%s: 0x%x: %s\n", text, cmd, str);
+ }
}
#else
static inline void ipc_log_header(struct device *dev, u8 *text, u32 cmd)
@@ -449,8 +455,8 @@ static void ipc_period_elapsed(struct snd_sof_dev *sdev, u32 msg_id)
stream = &spcm->stream[direction];
snd_sof_ipc_msg_data(sdev, stream->substream, &posn, sizeof(posn));
- dev_dbg(sdev->dev, "posn : host 0x%llx dai 0x%llx wall 0x%llx\n",
- posn.host_posn, posn.dai_posn, posn.wallclock);
+ dev_vdbg(sdev->dev, "posn : host 0x%llx dai 0x%llx wall 0x%llx\n",
+ posn.host_posn, posn.dai_posn, posn.wallclock);
memcpy(&stream->posn, &posn, sizeof(posn));
diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c
index d730e437e4ba..4c5082b7eea9 100644
--- a/sound/soc/sof/pcm.c
+++ b/sound/soc/sof/pcm.c
@@ -446,9 +446,9 @@ static snd_pcm_uframes_t sof_pcm_pointer(struct snd_soc_component *component,
dai = bytes_to_frames(substream->runtime,
spcm->stream[substream->stream].posn.dai_posn);
- dev_dbg(component->dev,
- "PCM: stream %d dir %d DMA position %lu DAI position %lu\n",
- spcm->pcm.pcm_id, substream->stream, host, dai);
+ dev_vdbg(component->dev,
+ "PCM: stream %d dir %d DMA position %lu DAI position %lu\n",
+ spcm->pcm.pcm_id, substream->stream, host, dai);
return host;
}
@@ -704,7 +704,7 @@ static int sof_pcm_dai_link_fixup(struct snd_soc_pcm_runtime *rtd,
break;
case SOF_DAI_INTEL_HDA:
/*
- * HDaudio does not follow the default trigger
+ * HDAudio does not follow the default trigger
* sequence due to firmware implementation
*/
for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_PLAYBACK, dpcm) {
diff --git a/sound/soc/sof/sof-acpi-dev.c b/sound/soc/sof/sof-acpi-dev.c
index 8aecc46b3647..a78b76ef37b2 100644
--- a/sound/soc/sof/sof-acpi-dev.c
+++ b/sound/soc/sof/sof-acpi-dev.c
@@ -106,6 +106,8 @@ static const struct dev_pm_ops sof_acpi_pm = {
static void sof_acpi_probe_complete(struct device *dev)
{
+ dev_dbg(dev, "Completing SOF ACPI probe");
+
if (sof_acpi_debug & SOF_ACPI_DISABLE_PM_RUNTIME)
return;
diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c
index f3a8140773db..7b85c88cba9c 100644
--- a/sound/soc/sof/sof-pci-dev.c
+++ b/sound/soc/sof/sof-pci-dev.c
@@ -302,10 +302,10 @@ static int sof_pci_probe(struct pci_dev *pci,
int ret;
ret = snd_intel_dsp_driver_probe(pci);
- if (ret != SND_INTEL_DSP_DRIVER_ANY &&
- ret != SND_INTEL_DSP_DRIVER_SOF)
+ if (ret != SND_INTEL_DSP_DRIVER_ANY && ret != SND_INTEL_DSP_DRIVER_SOF) {
+ dev_dbg(&pci->dev, "SOF PCI driver not selected, aborting probe\n");
return -ENODEV;
-
+ }
dev_dbg(&pci->dev, "PCI DSP detected");
/* get ops for platform */
diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h
index 64f28e082049..e2070072791c 100644
--- a/sound/soc/sof/sof-priv.h
+++ b/sound/soc/sof/sof-priv.h
@@ -370,7 +370,7 @@ struct snd_sof_dev {
/* DSP firmware boot */
wait_queue_head_t boot_wait;
enum snd_sof_fw_state fw_state;
- u32 first_boot;
+ bool first_boot;
/* work queue in case the probe is implemented in two steps */
struct work_struct probe_work;
@@ -431,10 +431,10 @@ struct snd_sof_dev {
int dma_trace_pages;
wait_queue_head_t trace_sleep;
u32 host_offset;
- u32 dtrace_is_supported; /* set with Kconfig or module parameter */
- u32 dtrace_is_enabled;
- u32 dtrace_error;
- u32 dtrace_draining;
+ bool dtrace_is_supported; /* set with Kconfig or module parameter */
+ bool dtrace_is_enabled;
+ bool dtrace_error;
+ bool dtrace_draining;
bool msi_enabled;
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index 13e10a0c0b05..707fbac3e64f 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -2083,12 +2083,12 @@ static int sof_process_load(struct snd_soc_component *scomp, int index,
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
struct snd_soc_dapm_widget *widget = swidget->widget;
struct snd_soc_tplg_private *private = &tw->priv;
- struct sof_ipc_comp_process *process = NULL;
+ struct sof_ipc_comp_process *process;
struct sof_widget_data *wdata = NULL;
size_t ipc_data_size = 0;
size_t ipc_size;
int offset = 0;
- int ret = 0;
+ int ret;
int i;
if (type == SOF_COMP_NONE) {
@@ -2374,8 +2374,7 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index,
case snd_soc_dapm_dai_link:
case snd_soc_dapm_kcontrol:
default:
- dev_warn(scomp->dev, "warning: widget type %d name %s not handled\n",
- swidget->id, tw->name);
+ dev_dbg(scomp->dev, "widget type %d name %s not handled\n", swidget->id, tw->name);
break;
}
@@ -2944,14 +2943,6 @@ static int sof_link_dmic_load(struct snd_soc_component *scomp, int index,
return ret;
}
- /*
- * alloc memory for private member
- * Used to track the pdm config array index currently being parsed
- */
- sdev->private = kzalloc(sizeof(u32), GFP_KERNEL);
- if (!sdev->private)
- return -ENOMEM;
-
/* get DMIC PDM tokens */
ret = sof_parse_token_sets(scomp, &config->dmic.pdm[0], dmic_pdm_tokens,
ARRAY_SIZE(dmic_pdm_tokens), private->array,
@@ -2962,7 +2953,7 @@ static int sof_link_dmic_load(struct snd_soc_component *scomp, int index,
if (ret != 0) {
dev_err(scomp->dev, "error: parse dmic pdm tokens failed %d\n",
le32_to_cpu(private->size));
- goto err;
+ return ret;
}
/* set IPC header size */
@@ -3007,9 +2998,6 @@ static int sof_link_dmic_load(struct snd_soc_component *scomp, int index,
dev_err(scomp->dev, "error: failed to save DAI config for DMIC%d\n",
config->dai_index);
-err:
- kfree(sdev->private);
-
return ret;
}