linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: srinivas.kandagatla@linaro.org
Cc: andy.gross@linaro.org, linux-arm-msm@vger.kernel.org,
	alsa-devel@alsa-project.org, david.brown@linaro.org,
	robh+dt@kernel.org, mark.rutland@arm.com, lgirdwood@gmail.com,
	plai@codeaurora.org, bgoswami@codeaurora.org, perex@perex.cz,
	tiwai@suse.com, linux-soc@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, rohkumar@qti.qualcomm.com,
	spatakok@qti.qualcomm.com
Subject: Re: [PATCH v3 14/25] ASoC: qcom: qdsp6: Add support to q6afe dai driver
Date: Fri, 2 Mar 2018 12:50:54 +0000	[thread overview]
Message-ID: <20180302125054.GH6255@sirena.org.uk> (raw)
In-Reply-To: <20180213165837.1620-15-srinivas.kandagatla@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 2740 bytes --]

On Tue, Feb 13, 2018 at 04:58:26PM +0000, srinivas.kandagatla@linaro.org wrote:

> +static int q6hdmi_format_put(struct snd_kcontrol *kcontrol,
> +				struct snd_ctl_elem_value *ucontrol)
> +{
> +	struct q6afe_dai_data *dai_data = kcontrol->private_data;
> +	int value = ucontrol->value.integer.value[0];
> +
> +	dai_data->port_config[AFE_PORT_HDMI_RX].hdmi.datatype = value;
> +
> +	return 0;
> +}

No validation, and do we not need to tell a currently running stream if
the format changed on it (or block such changes if they're not going to
work, which seems more likely)?

> +static int q6hdmi_hw_params(struct snd_pcm_substream *substream,
> +				struct snd_pcm_hw_params *params,
> +				struct snd_soc_dai *dai)
> +{
> +	struct q6afe_dai_data *dai_data = q6afe_get_dai_data(dai->dev);
> +	int channels = params_channels(params);
> +	struct q6afe_hdmi_cfg *hdmi = &dai_data->port_config[dai->id].hdmi;
> +
> +	hdmi->sample_rate = params_rate(params);
> +	switch (params_format(params)) {
> +	case SNDRV_PCM_FORMAT_S16_LE:
> +		hdmi->bit_width = 16;
> +		break;
> +	case SNDRV_PCM_FORMAT_S24_LE:
> +		hdmi->bit_width = 24;
> +		break;
> +	}

This silently accepts invalid values.

> +	/*refer to HDMI spec CEA-861-E: Table 28 Audio InfoFrame Data Byte 4*/

Coding style, spaces around the /* */.

> +static int q6afe_dai_startup(struct snd_pcm_substream *substream,
> +				struct snd_soc_dai *dai)
> +{
> +	struct q6afe_dai_data *dai_data = q6afe_get_dai_data(dai->dev);
> +
> +	dai_data->is_port_started[dai->id] = false;
> +
> +	return 0;
> +}

If this is needed it makes me a bit worried that we've got some kind of
bug with not shutting things down properly somewhere - what's going on
here?

> +static void q6afe_dai_shutdown(struct snd_pcm_substream *substream,
> +				struct snd_soc_dai *dai)
> +{
> +	struct q6afe_dai_data *dai_data = q6afe_get_dai_data(dai->dev);
> +	int rc;
> +
> +	rc = q6afe_port_stop(dai_data->port[dai->id]);
> +	if (rc < 0)
> +		dev_err(dai->dev, "fail to close AFE port\n");

Better to print the error code so users have more information to debug
the problem.

> +			.stream_name = "HDMI Playback",
> +			.rates = SNDRV_PCM_RATE_48000 |
> +				 SNDRV_PCM_RATE_96000 |
> +			 SNDRV_PCM_RATE_192000,

Indentation again.

> +static int q6afe_of_xlate_dai_name(struct snd_soc_component *component,
> +				   struct of_phandle_args *args,
> +				   const char **dai_name)
> +{
> +	int id = args->args[0];
> +	int i, ret = -EINVAL;

Coding style, don't mix initialization in with other variable
declarations on the same line like this.

> +int q6afe_dai_dev_remove(struct device *dev)
> +{
> +	return 0;
> +}

Remove empty functions, if they can't be removed it's probably not OK
for them to be empty either.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2018-03-02 12:51 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-13 16:58 [PATCH v3 00/25] ASoC: qcom: Add support to QDSP based Audio srinivas.kandagatla
2018-02-13 16:58 ` [PATCH v3 01/25] dt-bindings: soc: qcom: Add bindings for APR bus srinivas.kandagatla
2018-02-13 23:12   ` Rob Herring
2018-02-14  9:13     ` Srinivas Kandagatla
2018-02-18 23:04       ` Rob Herring
2018-02-20  9:33         ` Srinivas Kandagatla
2018-02-22  0:14           ` Rob Herring
2018-02-22 10:03             ` Srinivas Kandagatla
2018-02-28 18:55               ` Srinivas Kandagatla
2018-03-01 20:34               ` Mark Brown
2018-03-02 13:13                 ` Srinivas Kandagatla
2018-02-13 16:58 ` [PATCH v3 02/25] soc: qcom: add support to APR bus driver srinivas.kandagatla
2018-02-19  3:08   ` Rob Herring
2018-02-20  9:33     ` Srinivas Kandagatla
2018-02-13 16:58 ` [PATCH v3 03/25] ASoC: qcom: qdsp6: Add common qdsp6 helper functions srinivas.kandagatla
2018-03-01 21:04   ` Mark Brown
2018-02-13 16:58 ` [PATCH v3 04/25] dt-bindings: sound: qcom: Add bindings for q6afe srinivas.kandagatla
2018-03-01 20:41   ` Mark Brown
2018-02-13 16:58 ` [PATCH v3 05/25] ASoC: qcom: qdsp6: Add support to Q6AFE srinivas.kandagatla
2018-02-19 10:30   ` [alsa-devel] " Rohit Kumar
2018-02-20  9:34     ` Srinivas Kandagatla
2018-03-01 20:42     ` Mark Brown
2018-03-01 20:59   ` Mark Brown
2018-03-02 13:13     ` Srinivas Kandagatla
2018-03-02 17:54       ` Mark Brown
2018-03-02 18:51         ` Srinivas Kandagatla
2018-02-13 16:58 ` [PATCH v3 06/25] dt-bindings: sound: qcom: Add bindings for q6adm srinivas.kandagatla
2018-02-13 16:58 ` [PATCH v3 07/25] ASoC: qcom: qdsp6: Add support to Q6ADM srinivas.kandagatla
2018-03-01 21:24   ` Mark Brown
2018-03-06  9:26     ` Srinivas Kandagatla
2018-02-13 16:58 ` [PATCH v3 08/25] dt-bindings: sound: qcom: Add bindings for q6asm srinivas.kandagatla
2018-02-13 16:58 ` [PATCH v3 09/25] ASoC: qcom: qdsp6: Add support to Q6ASM srinivas.kandagatla
2018-02-13 16:58 ` [PATCH v3 10/25] ASoC: qcom: q6asm: Add support to memory map and unmap srinivas.kandagatla
2018-03-01 21:28   ` Mark Brown
2018-03-06  9:26     ` Srinivas Kandagatla
2018-02-13 16:58 ` [PATCH v3 11/25] ASoC: qcom: q6asm: add support to audio stream apis srinivas.kandagatla
2018-03-01 21:33   ` Mark Brown
2018-03-06  9:26     ` Srinivas Kandagatla
2018-02-13 16:58 ` [PATCH v3 12/25] ASoC: qcom: qdsp6: Add support to Q6CORE srinivas.kandagatla
2018-02-19 10:33   ` [alsa-devel] " Rohit Kumar
2018-02-13 16:58 ` [PATCH v3 13/25] ASoC: qcom: qdsp6: Add support to q6routing driver srinivas.kandagatla
2018-02-13 16:58 ` [PATCH v3 14/25] ASoC: qcom: qdsp6: Add support to q6afe dai driver srinivas.kandagatla
2018-02-19 10:32   ` [alsa-devel] " Rohit Kumar
2018-02-20  9:36     ` Srinivas Kandagatla
2018-03-02 12:50   ` Mark Brown [this message]
2018-03-02 13:52     ` Srinivas Kandagatla
2018-02-13 16:58 ` [PATCH v3 15/25] ASoC: qcom: qdsp6: Add support to q6asm " srinivas.kandagatla
2018-02-21 11:14   ` [alsa-devel] " Rohit Kumar
2018-02-22 11:16     ` Srinivas Kandagatla
2018-02-13 16:58 ` [PATCH v3 16/25] ASoC: qcom: q6afe: add SLIMBus port Support srinivas.kandagatla
2018-02-13 16:58 ` [PATCH v3 17/25] ASoC: qcom: q6afe-dai: add support to slim afe dais srinivas.kandagatla
2018-02-13 16:58 ` [PATCH v3 18/25] ASoC: qcom: q6routing: add support to all SLIMBus Mixers srinivas.kandagatla
2018-05-21 15:47   ` Applied "ASoC: qdsp6: q6routing: Add support to all SLIMBus Mixers" to the asoc tree Mark Brown
2018-02-13 16:58 ` [PATCH v3 19/25] ASoC: qcom: q6afe: add support to MI2S ports srinivas.kandagatla
2018-03-07  9:35   ` [alsa-devel] " Rohit Kumar
2018-02-13 16:58 ` [PATCH v3 20/25] ASoC: qcom: q6afe: add support to MI2S sysclks srinivas.kandagatla
2018-02-13 16:58 ` [PATCH v3 21/25] ASoC: qcom: q6afe-dai: add support to 4 MI2S ports srinivas.kandagatla
2018-02-13 16:58 ` [PATCH v3 22/25] ASoC: qcom: q6routing: add support to MI2S Mixers srinivas.kandagatla
2018-02-13 16:58 ` [PATCH v3 23/25] dt-bindings: sound: qcom: Add devicetree bindings for apq8096 srinivas.kandagatla
2018-02-13 16:58 ` [PATCH v3 24/25] ASoC: qcom: apq8096: Add db820c machine driver srinivas.kandagatla
2018-02-22 11:00   ` [alsa-devel] " Rohit Kumar
2018-02-22 11:13     ` Srinivas Kandagatla
2018-02-13 16:58 ` [PATCH v3 25/25] arm64: dts: msm8996: db820c: Add sound card support srinivas.kandagatla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180302125054.GH6255@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=andy.gross@linaro.org \
    --cc=bgoswami@codeaurora.org \
    --cc=david.brown@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=perex@perex.cz \
    --cc=plai@codeaurora.org \
    --cc=robh+dt@kernel.org \
    --cc=rohkumar@qti.qualcomm.com \
    --cc=spatakok@qti.qualcomm.com \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).