linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Vitaly Rodionov <vitalyr@opensource.cirrus.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Cc: kbuild-all@01.org, patches@opensource.cirrus.com,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/4] ALSA: hda/cirrus: Add jack detect interrupt support from CS42L42 companion codec.
Date: Fri, 5 Mar 2021 11:43:49 +0800	[thread overview]
Message-ID: <202103051145.hdx88t3y-lkp@intel.com> (raw)
In-Reply-To: <20210304190241.5363-4-vitalyr@opensource.cirrus.com>

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

Hi Vitaly,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on sound/for-next]
[also build test WARNING on v5.12-rc1 next-20210304]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Vitaly-Rodionov/ALSA-hda-cirrus-Add-support-for-CS8409-HDA-bridge-and-CS42L42-companion-codec/20210305-030714
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
config: alpha-randconfig-r035-20210305 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/9d4c2aa0fd6872aa8b866929c1537ce2905a6dba
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Vitaly-Rodionov/ALSA-hda-cirrus-Add-support-for-CS8409-HDA-bridge-and-CS42L42-companion-codec/20210305-030714
        git checkout 9d4c2aa0fd6872aa8b866929c1537ce2905a6dba
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> sound/pci/hda/patch_cirrus.c:1686:6: warning: no previous prototype for 'cs8409_jack_unsol_event' [-Wmissing-prototypes]
    1686 | void cs8409_jack_unsol_event(struct hda_codec *codec, unsigned int res)
         |      ^~~~~~~~~~~~~~~~~~~~~~~


vim +/cs8409_jack_unsol_event +1686 sound/pci/hda/patch_cirrus.c

  1678	
  1679	/*
  1680	 * In the case of CS8409 we do not have unsolicited events from NID's 0x24
  1681	 * and 0x34 where hs mic and hp are connected. Companion codec CS42L42 will
  1682	 * generate interrupt via gpio 4 to notify jack events. We have to overwrite
  1683	 * generic snd_hda_jack_unsol_event(), read CS42L42 jack detect status registers
  1684	 * and then notify status via generic snd_hda_jack_unsol_event() call.
  1685	 */
> 1686	void cs8409_jack_unsol_event(struct hda_codec *codec, unsigned int res)
  1687	{
  1688		struct cs_spec *spec = codec->spec;
  1689		int status_changed = 0;
  1690		unsigned int reg_cdc_status = 0;
  1691		unsigned int reg_hs_status = 0;
  1692		unsigned int reg_ts_status = 0;
  1693		int type = 0;
  1694		struct hda_jack_tbl *jk;
  1695	
  1696		/* jack_unsol_event() will be called every time gpio line changing state.
  1697		 * In this case gpio4 line goes up as a result of reading interrupt status
  1698		 * registers in previous cs8409_jack_unsol_event() call.
  1699		 * We don't need to handle this event, ignoring...
  1700		 */
  1701		if ((res & (1 << 4)))
  1702			return;
  1703	
  1704		mutex_lock(&spec->cs8409_i2c_mux);
  1705	
  1706		/* Read jack detect status registers */
  1707		reg_cdc_status = cs8409_i2c_read(codec, CS42L42_I2C_ADDR, 0x1308, 1);
  1708		reg_hs_status = cs8409_i2c_read(codec, CS42L42_I2C_ADDR, 0x1124, 1);
  1709		reg_ts_status = cs8409_i2c_read(codec, CS42L42_I2C_ADDR, 0x130f, 1);
  1710	
  1711		/* Clear interrupts */
  1712		cs8409_i2c_read(codec, CS42L42_I2C_ADDR, 0x1b7b, 1);
  1713		cs8409_i2c_read(codec, CS42L42_I2C_ADDR, 0x1308, 1);
  1714		cs8409_i2c_read(codec, CS42L42_I2C_ADDR, 0x130f, 1);
  1715	
  1716		mutex_unlock(&spec->cs8409_i2c_mux);
  1717	
  1718		/* HSDET_AUTO_DONE */
  1719		if (reg_cdc_status & CS42L42_HSDET_AUTO_DONE) {
  1720	
  1721			type = ((reg_hs_status & CS42L42_HSTYPE_MASK) + 1);
  1722			/* CS42L42 reports optical jack as type 4
  1723			 * We don't handle optical jack
  1724			 */
  1725			if (type != 4) {
  1726				if (!spec->cs42l42_hp_jack_in) {
  1727					status_changed = 1;
  1728					spec->cs42l42_hp_jack_in = 1;
  1729				}
  1730				/* type = 3 has no mic */
  1731				if ((!spec->cs42l42_mic_jack_in) && (type != 3)) {
  1732					status_changed = 1;
  1733					spec->cs42l42_mic_jack_in = 1;
  1734				}
  1735			}
  1736	
  1737		} else {
  1738			/* TIP_SENSE INSERT/REMOVE */
  1739			switch (reg_ts_status) {
  1740			case CS42L42_JACK_INSERTED:
  1741				cs8409_cs42l42_run_jack_detect(codec);
  1742				break;
  1743	
  1744			case CS42L42_JACK_REMOVED:
  1745				if (spec->cs42l42_hp_jack_in || spec->cs42l42_mic_jack_in) {
  1746					status_changed = 1;
  1747					spec->cs42l42_hp_jack_in = 0;
  1748					spec->cs42l42_mic_jack_in = 0;
  1749				}
  1750				break;
  1751	
  1752			default:
  1753				/* jack in transition */
  1754				status_changed = 0;
  1755				break;
  1756			}
  1757		}
  1758	
  1759		if (status_changed) {
  1760	
  1761			snd_hda_set_pin_ctl(codec, CS8409_CS42L42_SPK_PIN_NID,
  1762					(spec->cs42l42_hp_jack_in)?0 : PIN_OUT);
  1763	
  1764			/* Report jack*/
  1765			jk = snd_hda_jack_tbl_get_mst(codec, CS8409_CS42L42_HP_PIN_NID, 0);
  1766			if (jk) {
  1767				snd_hda_jack_unsol_event(codec,
  1768					(jk->tag << AC_UNSOL_RES_TAG_SHIFT) & AC_UNSOL_RES_TAG);
  1769			}
  1770			/* Report jack*/
  1771			jk = snd_hda_jack_tbl_get_mst(codec, CS8409_CS42L42_AMIC_PIN_NID, 0);
  1772			if (jk) {
  1773				snd_hda_jack_unsol_event(codec,
  1774					(jk->tag << AC_UNSOL_RES_TAG_SHIFT) & AC_UNSOL_RES_TAG);
  1775			}
  1776		}
  1777	}
  1778	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

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

  parent reply	other threads:[~2021-03-05  3:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04 19:02 [PATCH v2 0/4] ALSA: hda/cirrus: Add support for CS8409 HDA bridge and CS42L42 companion codec Vitaly Rodionov
2021-03-04 19:02 ` [PATCH v2 1/4] ALSA: hda/cirrus: Increase AUTO_CFG_MAX_INS from 8 to 18 Vitaly Rodionov
2021-03-04 19:02 ` [PATCH v2 2/4] ALSA: hda/cirrus: Add support for CS8409 HDA bridge and CS42L42 companion codec Vitaly Rodionov
2021-03-04 22:31   ` kernel test robot
2021-03-04 19:02 ` [PATCH v2 3/4] ALSA: hda/cirrus: Add jack detect interrupt support from " Vitaly Rodionov
2021-03-04 23:13   ` kernel test robot
2021-03-05  3:43   ` kernel test robot [this message]
2021-03-04 19:02 ` [PATCH v2 4/4] ALSA: hda/cirrus: Add Headphone and Headset MIC Volume Control Vitaly Rodionov
2021-03-05  9:12 ` [PATCH v2 0/4] ALSA: hda/cirrus: Add support for CS8409 HDA bridge and CS42L42 companion codec Takashi Iwai

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=202103051145.hdx88t3y-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=vitalyr@opensource.cirrus.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).