Commit 9db6f432 authored by Mark Brown's avatar Mark Brown

Merge series "ASoC: SOF: trivial code/log/comment improvements" from...

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: aafdeba5
--
2.25.1
parents 67207297 135ab457
......@@ -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
......
......@@ -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
......
......@@ -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 {
......
......@@ -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.
......
......@@ -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
......
......@@ -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);
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,7 +455,7 @@ 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",
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));
......
......@@ -446,7 +446,7 @@ 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,
dev_vdbg(component->dev,
"PCM: stream %d dir %d DMA position %lu DAI position %lu\n",
spcm->pcm.pcm_id, substream->stream, host, dai);
......@@ -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) {
......
......@@ -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;
......
......@@ -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 */
......
......@@ -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;
......
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment