alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
Cc: alsa-devel@alsa-project.org, wsd_upstream@mediatek.com,
	chipeng.chang@mediatek.com, garlic.tseng@mediatek.com,
	broonie@kernel.org, linux-mediatek@lists.infradead.org,
	kbuild-all@01.org, kaichieh.chuang@mediatek.com
Subject: Re: [PATCH 1/5] ASoC: add mt6351 codec driver
Date: Sat, 14 Apr 2018 13:47:30 +0800	[thread overview]
Message-ID: <201804141214.KHhwp7O4%fengguang.wu@intel.com> (raw)
In-Reply-To: <20180413090242.4211-2-kaichieh.chuang@mediatek.com>

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

Hi KaiChieh,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on asoc/for-next]
[also build test WARNING on v4.16 next-20180413]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/KaiChieh-Chuang/ASoC-add-mt6351-codec-driver/20180414-110824
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=sh 

All warnings (new ones prefixed by >>):

   sound/soc/codecs/mt6351.c: In function 'mt_hp_event':
>> sound/soc/codecs/mt6351.c:912:8: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
      else if (priv->hp_en_counter < 0)
           ^~
   sound/soc/codecs/mt6351.c:918:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
       hp_zcd_disable(codec);
       ^~~~~~~~~~~~~~
   sound/soc/codecs/mt6351.c:928:8: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
      else if (priv->hp_en_counter < 0)
           ^~
   sound/soc/codecs/mt6351.c:933:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
       snd_soc_update_bits(codec,
       ^~~~~~~~~~~~~~~~~~~

vim +/if +912 sound/soc/codecs/mt6351.c

   834	
   835	static int mt_hp_event(struct snd_soc_dapm_widget *w,
   836			       struct snd_kcontrol *kcontrol,
   837			       int event)
   838	{
   839		struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
   840		struct mt6351_priv *priv = snd_soc_codec_get_drvdata(codec);
   841	
   842		dev_dbg(priv->dev, "%s(), event 0x%x, hp_en_counter %d\n",
   843			__func__, event, priv->hp_en_counter);
   844	
   845		switch (event) {
   846		case SND_SOC_DAPM_PRE_PMU:
   847			priv->hp_en_counter++;
   848			if (priv->hp_en_counter > 1)
   849				break;	/* already enabled, do nothing */
   850			else if (priv->hp_en_counter <= 0)
   851				dev_err(priv->dev, "%s(), hp_en_counter %d <= 0\n",
   852					__func__,
   853					priv->hp_en_counter);
   854	
   855			hp_zcd_disable(codec);
   856	
   857			/* from yoyo HQA script */
   858			snd_soc_update_bits(codec, MT6351_AUDDEC_ANA_CON6,
   859					    0x0700, 0x0700);
   860			/* Set HPR/HPL gain as minimum (~ -40dB) */
   861			snd_soc_update_bits(codec, MT6351_ZCD_CON2, 0xffff, 0x0F9F);
   862			/* Set HS gain as minimum (~ -40dB) */
   863			snd_soc_update_bits(codec, MT6351_ZCD_CON3, 0xffff, 0x001F);
   864			/* De_OSC of HP */
   865			snd_soc_update_bits(codec, MT6351_AUDDEC_ANA_CON2,
   866					    0x0001, 0x0001);
   867			/* enable output STBENH */
   868			snd_soc_update_bits(codec, MT6351_AUDDEC_ANA_CON1,
   869					    0xffff, 0x2000);
   870			/* De_OSC of voice, enable output STBENH */
   871			snd_soc_update_bits(codec, MT6351_AUDDEC_ANA_CON1,
   872					    0xffff, 0x2100);
   873			/* Enable voice driver */
   874			snd_soc_update_bits(codec, MT6351_AUDDEC_ANA_CON0,
   875					    0x0010, 0xE090);
   876			/* Enable pre-charge buffer  */
   877			snd_soc_update_bits(codec, MT6351_AUDDEC_ANA_CON1,
   878					    0xffff, 0x2140);
   879	
   880			usleep_range(50, 60);
   881	
   882			/* Apply digital DC compensation value to DAC */
   883			set_hp_gain_zero(codec);
   884	
   885			/* Enable HPR/HPL */
   886			snd_soc_update_bits(codec, MT6351_AUDDEC_ANA_CON1,
   887					    0xffff, 0x2100);
   888			/* Disable pre-charge buffer */
   889			snd_soc_update_bits(codec, MT6351_AUDDEC_ANA_CON1,
   890					    0xffff, 0x2000);
   891			/* Disable De_OSC of voice */
   892			snd_soc_update_bits(codec, MT6351_AUDDEC_ANA_CON0,
   893					    0x0010, 0xF4EF);
   894			/* Disable voice buffer */
   895	
   896			/* from yoyo HQ */
   897			snd_soc_update_bits(codec, MT6351_AUDDEC_ANA_CON6,
   898					    0x0700, 0x0300);
   899	
   900			/* Enable ZCD, for minimize pop noise */
   901			/* when adjust gain during HP buffer on */
   902			hp_zcd_enable(codec);
   903	
   904			/* apply volume setting */
   905			hp_gain_ramp_set(codec, HP_GAIN_RESTORE);
   906	
   907			break;
   908		case SND_SOC_DAPM_PRE_PMD:
   909			priv->hp_en_counter--;
   910			if (priv->hp_en_counter > 0)
   911				break;	/* still being used, don't close */
 > 912			else if (priv->hp_en_counter < 0)
   913				dev_err(priv->dev, "%s(), hp_en_counter %d <= 0\n",
   914					__func__,
   915					priv->hp_en_counter);
   916	
   917				/* Disable AUD_ZCD */
   918				hp_zcd_disable(codec);
   919	
   920				/* Set HPR/HPL gain as -1dB, step by step */
   921				hp_gain_ramp_set(codec, HP_GAIN_SET_ZERO);
   922	
   923				set_hp_gain_zero(codec);
   924			break;
   925		case SND_SOC_DAPM_POST_PMD:
   926			if (priv->hp_en_counter > 0)
   927				break;	/* still being used, don't close */
   928			else if (priv->hp_en_counter < 0)
   929				dev_err(priv->dev, "%s(), hp_en_counter %d <= 0\n",
   930					__func__,
   931					priv->hp_en_counter);
   932				/* reset*/
   933				snd_soc_update_bits(codec,
   934						    MT6351_AUDDEC_ANA_CON6,
   935						    0x0700,
   936						    0x0000);
   937				/* De_OSC of HP */
   938				snd_soc_update_bits(codec,
   939						    MT6351_AUDDEC_ANA_CON2,
   940						    0x0001,
   941						    0x0000);
   942			break;
   943		default:
   944			break;
   945		}
   946	
   947		return 0;
   948	}
   949	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 48118 bytes --]

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2018-04-14  5:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-13  9:02 [PATCH 0/5] ASoC: mediatek: add support for mt6797 SoC KaiChieh Chuang
     [not found] ` <20180413090242.4211-1-kaichieh.chuang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-04-13  9:02   ` [PATCH 1/5] ASoC: add mt6351 codec driver KaiChieh Chuang
2018-04-14  5:47     ` kbuild test robot [this message]
2018-04-16  0:42       ` KaiChieh Chuang
2018-04-14 19:37     ` kbuild test robot
2018-04-13  9:02   ` [PATCH 2/5] ASoC: mt6797: add structure define and clock control function for 6797 KaiChieh Chuang
     [not found]     ` <20180413090242.4211-3-kaichieh.chuang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-04-27 10:53       ` Applied "ASoC: mt6797: add structure define and clock control function for 6797" to the asoc tree Mark Brown
2018-04-13  9:02   ` [PATCH 3/5] ASoC: mt6797: add mt6797 platform driver KaiChieh Chuang
2018-04-13  9:02   ` [PATCH 4/5] ASoC: add mt6797-mt6351 driver and config option KaiChieh Chuang
2018-04-13  9:02   ` [PATCH 5/5] ASoC: mediatek: add documents for mt6797 KaiChieh Chuang
     [not found]     ` <20180413090242.4211-6-kaichieh.chuang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-04-25 17:52       ` Applied "ASoC: mediatek: add documents for mt6797" to the asoc tree Mark Brown
2018-04-25 17:54     ` Mark Brown
2018-04-25 17:55     ` Mark Brown

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=201804141214.KHhwp7O4%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=chipeng.chang@mediatek.com \
    --cc=garlic.tseng@mediatek.com \
    --cc=kaichieh.chuang@mediatek.com \
    --cc=kbuild-all@01.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=wsd_upstream@mediatek.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).