alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Srinivas Kandagatla
	<srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	tiwai-IBi9RG/b67k@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kwestfie-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v4 2/6] ASoC: codecs: Add msm8916-wcd digital codec
Date: Tue, 6 Sep 2016 12:24:56 +0100	[thread overview]
Message-ID: <20160906112456.GN3950@sirena.org.uk> (raw)
In-Reply-To: <1473155865-13361-3-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

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

On Tue, Sep 06, 2016 at 10:57:41AM +0100, Srinivas Kandagatla wrote:

> +static const struct soc_enum rx_mix2_inp1_chain_enum =
> +SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX1_B3_CTL, 0, 3, rx_mix2_text);

Indentation again.

> +	case SND_SOC_DAPM_PRE_PMU:
> +		if (++msm8916_wcd->dmic_clk_cnt == 1) {
> +			snd_soc_update_bits(codec, dmic_clk_reg,

This looks like you're open coding a supply widget.

> +		if (dmic == 1)
> +			snd_soc_update_bits(codec, LPASS_CDC_TX1_DMIC_CTL,
> +					    TXN_DMIC_CTL_CLK_SEL_MASK,
> +					    TXN_DMIC_CTL_CLK_SEL_DIV3);
> +		if (dmic == 2)
> +			snd_soc_update_bits(codec, LPASS_CDC_TX2_DMIC_CTL,
> +					    TXN_DMIC_CTL_CLK_SEL_MASK,
> +					    TXN_DMIC_CTL_CLK_SEL_DIV3);

This looks like you want a switch statement.

> +static int msm8916_wcd_digital_enable_clock_block(struct snd_soc_codec
> +						  *codec, int enable)
> +{

> +static int msm8916_wcd_digital_codec_remove(struct snd_soc_codec *codec)
> +{
> +	return 0;
> +}

Remove empty functions.

> +static int msm8916_wcd_digital_startup(struct snd_pcm_substream *substream,
> +				       struct snd_soc_dai *dai)
> +{
> +	msm8916_wcd_digital_enable_clock_block(dai->codec, 1);
> +	return 0;
> +}
> +
> +static void msm8916_wcd_digital_shutdown(struct snd_pcm_substream *substream,
> +					 struct snd_soc_dai *dai)
> +{
> +	msm8916_wcd_digital_enable_clock_block(dai->codec, 0);
> +}

Two problems here: one is that the power management should be in DAPM,
the other is that the _enable_clock_block() function is totally
pointless - it has only these two call locations and there is absolutely
no shared code between the enable and disable paths so they should just
be inlined.

> +static int msm8916_wcd_digital_remove(struct platform_device *pdev)
> +{
> +	struct msm8916_wcd_digital_priv *priv = dev_get_drvdata(&pdev->dev);
> +
> +	clk_disable_unprepare(priv->mclk);
> +	clk_disable_unprepare(priv->ahbclk);
> +	snd_soc_unregister_codec(&pdev->dev);

This is disabling the clocks while the CODEC is still registered and
might be in use, you should unregister first.

> +static const struct of_device_id msm8916_wcd_digital_match_table[] = {
> +	{.compatible = "qcom,msm8916-wcd-digital-codec"},
> +	{}

Spaces please.

> +static struct platform_driver msm8916_wcd_digital_driver = {
> +	.driver = {
> +		   .name = "msm8916-wcd-digital-codec",
> +		   .of_match_table = msm8916_wcd_digital_match_table,
> +		   },

Please line up the }.

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

  parent reply	other threads:[~2016-09-06 11:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06  9:57 [PATCH v4 0/6] ASoC: Add support to Qualcomm msm8916-wcd multi codec Srinivas Kandagatla
2016-09-06  9:57 ` [PATCH v4 1/6] ASoC: codecs: Add msm8916-wcd analog codec Srinivas Kandagatla
     [not found]   ` <1473155865-13361-2-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-09-06 11:17     ` Mark Brown
2016-09-06 12:55       ` Srinivas Kandagatla
2016-09-06  9:57 ` [PATCH v4 2/6] ASoC: codecs: Add msm8916-wcd digital codec Srinivas Kandagatla
     [not found]   ` <1473155865-13361-3-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-09-06 11:24     ` Mark Brown [this message]
2016-09-06 12:54       ` Srinivas Kandagatla
     [not found] ` <1473155865-13361-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-09-06  9:57   ` [PATCH v4 3/6] ASoC: qcom: apq8016-sbc: add board specific dapm mic widgets Srinivas Kandagatla
2016-09-06 11:29     ` Applied "ASoC: qcom: apq8016-sbc: add board specific dapm mic widgets" to the asoc tree Mark Brown
2016-09-06  9:57 ` [PATCH v4 4/6] ASoC: qcom: apq8016-sbc: add support to routing via DT Srinivas Kandagatla
     [not found]   ` <1473155865-13361-5-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-09-06 11:29     ` Applied "ASoC: qcom: apq8016-sbc: add support to routing via DT" to the asoc tree Mark Brown
2016-09-06  9:57 ` [PATCH v4 5/6] ASoC: qcom: apq8016-sbc: Add support to multi codec Srinivas Kandagatla
     [not found]   ` <1473155865-13361-6-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-09-06 11:27     ` Mark Brown
2016-09-06 12:54       ` Srinivas Kandagatla
2016-09-06  9:57 ` [PATCH v4 6/6] arm64: dts: apq8016-sbc: add analog audio support with multicodec 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=20160906112456.GN3950@sirena.org.uk \
    --to=broonie-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=kwestfie-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=tiwai-IBi9RG/b67k@public.gmane.org \
    /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).