[PATCH v4 2/3] ASoC: Intel: Multiple I/O PCM format support for pipe

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Fri Apr 24 17:26:43 CEST 2020


> +static int skl_tplg_multi_config_set_get(struct snd_kcontrol *kcontrol,
> +		struct snd_ctl_elem_value *ucontrol, bool is_set)
> +{
> +	struct snd_soc_component *component =
> +		snd_soc_kcontrol_component(kcontrol);
> +	struct hdac_bus *bus = snd_soc_component_get_drvdata(component);
> +	struct skl_dev *skl = bus_to_skl(bus);
> +	struct skl_pipeline *ppl;
> +	struct skl_pipe *pipe = NULL;
> +	struct soc_enum *ec = (struct soc_enum *)kcontrol->private_value;
> +	u32 *pipe_id;
> +
> +	if (!ec)
> +		return -EINVAL;
> +
> +	if (is_set && (ucontrol->value.enumerated.item[0] > ec->items))
> +		return -EINVAL;
> +
> +	pipe_id = ec->dobj.private;
> +
> +	list_for_each_entry(ppl, &skl->ppl_list, node) {
> +		if (ppl->pipe->ppl_id == *pipe_id) {
> +			pipe = ppl->pipe;
> +			break;
> +			}
> +		}

is there an alignment issue here or just a diff illusion?

> +	if (!pipe)
> +		return -EIO;
> +
> +	if (is_set)
> +		pipe->pipe_config_idx = ucontrol->value.enumerated.item[0];
> +	else
> +		ucontrol->value.enumerated.item[0]  =  pipe->pipe_config_idx;
> +
> +	return 0;
> +}
> +

You also have a number of other alignment/style issues reported by 
checkpatch.pl

---------------------------------------------------------------
0001-ASoC-Intel-Skylake-Add-alternative-topology-binary-n.patch
---------------------------------------------------------------
CHECK: Alignment should match open parenthesis
#41: FILE: sound/soc/intel/skylake/skl-topology.c:3572:
+		snprintf(alt_tplg_name, sizeof(alt_tplg_name), "%s-tplg.bin",
+				skl->mach->drv_name);

CHECK: Alignment should match open parenthesis
#43: FILE: sound/soc/intel/skylake/skl-topology.c:3574:
+		dev_info(bus->dev, "tplg fw %s load failed with %d, trying 
alternative tplg name %s",
+				skl->tplg_name, ret, alt_tplg_name);

CHECK: Alignment should match open parenthesis
#50: FILE: sound/soc/intel/skylake/skl-topology.c:3581:
+		dev_info(bus->dev, "tplg %s failed with %d, falling back to dfw_sst.bin",
+				alt_tplg_name, ret);

--------------------------------------------------------------
0002-ASoC-Intel-Multiple-I-O-PCM-format-support-for-pipe.patch
--------------------------------------------------------------
CHECK: spaces preferred around that '+' (ctx:VxV)
#58: FILE: sound/soc/intel/skylake/skl-topology.c:597:
+			next_fmt = &pipe->configs[i+1].out_fmt;
  			                           ^

CHECK: spaces preferred around that '+' (ctx:VxV)
#61: FILE: sound/soc/intel/skylake/skl-topology.c:600:
+			next_fmt = &pipe->configs[i+1].in_fmt;
  			                           ^

CHECK: Alignment should match open parenthesis
#86: FILE: sound/soc/intel/skylake/skl-topology.c:640:
+		dev_dbg(skl->dev, "found pipe config idx:%d\n",
+				pipe->cur_config_idx);

CHECK: Alignment should match open parenthesis
#98: FILE: sound/soc/intel/skylake/skl-topology.c:1359:
+static int skl_tplg_multi_config_set_get(struct snd_kcontrol *kcontrol,
+		struct snd_ctl_elem_value *ucontrol, bool is_set)

CHECK: Unnecessary parentheses around 
'ucontrol->value.enumerated.item[0] > ec->items'
#112: FILE: sound/soc/intel/skylake/skl-topology.c:1373:
+	if (is_set && (ucontrol->value.enumerated.item[0] > ec->items))

CHECK: Alignment should match open parenthesis
#135: FILE: sound/soc/intel/skylake/skl-topology.c:1396:
+static int skl_tplg_multi_config_get(struct snd_kcontrol *kcontrol,
+			struct snd_ctl_elem_value *ucontrol)

CHECK: Alignment should match open parenthesis
#141: FILE: sound/soc/intel/skylake/skl-topology.c:1402:
+static int skl_tplg_multi_config_set(struct snd_kcontrol *kcontrol,
+			struct snd_ctl_elem_value *ucontrol)

---------------------------------------------------------------
0003-ASoC-Intel-Skylake-Automatic-DMIC-format-configurati.patch
---------------------------------------------------------------
CHECK: Alignment should match open parenthesis
#40: FILE: sound/soc/intel/skylake/skl-topology.c:1408:
+static int skl_tplg_multi_config_get_dmic(struct snd_kcontrol *kcontrol,
+		struct snd_ctl_elem_value *ucontrol)

CHECK: Alignment should match open parenthesis
#46: FILE: sound/soc/intel/skylake/skl-topology.c:1414:
+static int skl_tplg_multi_config_set_dmic(struct snd_kcontrol *kcontrol,
+		struct snd_ctl_elem_value *ucontrol)

CHECK: Alignment should match open parenthesis
#110: FILE: sound/soc/intel/skylake/skl-topology.c:3627:
+		if (dobj->type != SND_SOC_DOBJ_ENUM ||
+				dobj->control.kcontrol->put !=



More information about the Alsa-devel mailing list