All of lore.kernel.org
 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: patches@opensource.cirrus.com, alsa-devel@alsa-project.org,
	kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Stefan Binding <sbinding@opensource.cirrus.com>
Subject: Re: [PATCH 4/4] ALSA: hda/cirrus: Make CS8409 driver more generic by using fixups.
Date: Sat, 13 Mar 2021 05:59:14 +0800	[thread overview]
Message-ID: <202103130544.EdST2GY6-lkp@intel.com> (raw)
In-Reply-To: <20210312184452.3288-5-vitalyr@opensource.cirrus.com>

[-- Attachment #1: Type: text/plain, Size: 8986 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 next-20210312]
[cannot apply to v5.12-rc2]
[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-Make-CS8409-driver-more-generic-by-using-fixups/20210313-024937
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
config: microblaze-randconfig-m031-20210312 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0

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

New smatch warnings:
sound/pci/hda/patch_cirrus.c:2143 cs8409_cs42l42_fixups() warn: always true condition '(caps >= 0) => (0-u32max >= 0)'

Old smatch warnings:
sound/pci/hda/patch_cirrus.c:2150 cs8409_cs42l42_fixups() warn: always true condition '(caps >= 0) => (0-u32max >= 0)'
sound/pci/hda/patch_cirrus.c:2156 cs8409_cs42l42_fixups() warn: always true condition '(caps >= 0) => (0-u32max >= 0)'
sound/pci/hda/patch_cirrus.c:2161 cs8409_cs42l42_fixups() warn: always true condition '(caps >= 0) => (0-u32max >= 0)'

vim +2143 sound/pci/hda/patch_cirrus.c

6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2098  
89b3eea4b1e18f Stefan Binding  2021-03-12  2099  static void cs8409_cs42l42_fixups(struct hda_codec *codec,
89b3eea4b1e18f Stefan Binding  2021-03-12  2100  				    const struct hda_fixup *fix, int action)
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2101  {
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2102  	struct cs_spec *spec = codec->spec;
76e2b57d1d60d1 Stefan Binding  2021-03-12  2103  	unsigned int caps;
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2104  
89b3eea4b1e18f Stefan Binding  2021-03-12  2105  	switch (action) {
89b3eea4b1e18f Stefan Binding  2021-03-12  2106  	case HDA_FIXUP_ACT_PRE_PROBE:
89b3eea4b1e18f Stefan Binding  2021-03-12  2107  		snd_hda_add_verbs(codec, cs8409_cs42l42_init_verbs);
89b3eea4b1e18f Stefan Binding  2021-03-12  2108  		/* verb exec op override */
89b3eea4b1e18f Stefan Binding  2021-03-12  2109  		spec->exec_verb = codec->core.exec_verb;
89b3eea4b1e18f Stefan Binding  2021-03-12  2110  		codec->core.exec_verb = cs8409_cs42l42_exec_verb;
89b3eea4b1e18f Stefan Binding  2021-03-12  2111  
89b3eea4b1e18f Stefan Binding  2021-03-12  2112  		mutex_init(&spec->cs8409_i2c_mux);
89b3eea4b1e18f Stefan Binding  2021-03-12  2113  
89b3eea4b1e18f Stefan Binding  2021-03-12  2114  		codec->patch_ops = cs8409_cs42l42_patch_ops;
89b3eea4b1e18f Stefan Binding  2021-03-12  2115  
89b3eea4b1e18f Stefan Binding  2021-03-12  2116  		spec->gen.suppress_auto_mute = 1;
89b3eea4b1e18f Stefan Binding  2021-03-12  2117  		spec->gen.no_primary_hp = 1;
89b3eea4b1e18f Stefan Binding  2021-03-12  2118  		spec->gen.suppress_vmaster = 1;
89b3eea4b1e18f Stefan Binding  2021-03-12  2119  
89b3eea4b1e18f Stefan Binding  2021-03-12  2120  		/* GPIO 5 out, 3,4 in */
89b3eea4b1e18f Stefan Binding  2021-03-12  2121  		spec->gpio_dir = GPIO5_INT;
89b3eea4b1e18f Stefan Binding  2021-03-12  2122  		spec->gpio_data = 0;
89b3eea4b1e18f Stefan Binding  2021-03-12  2123  		spec->gpio_mask = 0x03f;
89b3eea4b1e18f Stefan Binding  2021-03-12  2124  
89b3eea4b1e18f Stefan Binding  2021-03-12  2125  		spec->cs42l42_hp_jack_in = 0;
89b3eea4b1e18f Stefan Binding  2021-03-12  2126  		spec->cs42l42_mic_jack_in = 0;
89b3eea4b1e18f Stefan Binding  2021-03-12  2127  
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2128  		/* Basic initial sequence for specific hw configuration */
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2129  		snd_hda_sequence_write(codec, cs8409_cs42l42_init_verbs);
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2130  
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2131  		/* CS8409 is simple HDA bridge and intended to be used with a remote
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2132  		 * companion codec. Most of input/output PIN(s) have only basic
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2133  		 * capabilities. NID(s) 0x24 and 0x34 have only OUTC and INC
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2134  		 * capabilities and no presence detect capable (PDC) and call to
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2135  		 * snd_hda_gen_build_controls() will mark them as non detectable
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2136  		 * phantom jacks. However, in this configuration companion codec
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2137  		 * CS42L42 is connected to these pins and it has jack detect
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2138  		 * capabilities. We have to override pin capabilities,
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2139  		 * otherwise they will not be created as input devices.
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2140  		 */
76e2b57d1d60d1 Stefan Binding  2021-03-12  2141  		caps = snd_hdac_read_parm(&codec->core, CS8409_CS42L42_HP_PIN_NID,
76e2b57d1d60d1 Stefan Binding  2021-03-12  2142  				AC_PAR_PIN_CAP);
76e2b57d1d60d1 Stefan Binding  2021-03-12 @2143  		if (caps >= 0)
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2144  			snd_hdac_override_parm(&codec->core,
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2145  				CS8409_CS42L42_HP_PIN_NID, AC_PAR_PIN_CAP,
76e2b57d1d60d1 Stefan Binding  2021-03-12  2146  				(caps | (AC_PINCAP_IMP_SENSE | AC_PINCAP_PRES_DETECT)));
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2147  
76e2b57d1d60d1 Stefan Binding  2021-03-12  2148  		caps = snd_hdac_read_parm(&codec->core, CS8409_CS42L42_AMIC_PIN_NID,
76e2b57d1d60d1 Stefan Binding  2021-03-12  2149  				AC_PAR_PIN_CAP);
76e2b57d1d60d1 Stefan Binding  2021-03-12  2150  		if (caps >= 0)
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2151  			snd_hdac_override_parm(&codec->core,
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2152  				CS8409_CS42L42_AMIC_PIN_NID, AC_PAR_PIN_CAP,
76e2b57d1d60d1 Stefan Binding  2021-03-12  2153  				(caps | (AC_PINCAP_IMP_SENSE | AC_PINCAP_PRES_DETECT)));
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2154  
76e2b57d1d60d1 Stefan Binding  2021-03-12  2155  		caps = get_wcaps(codec, CS8409_CS42L42_HP_PIN_NID);
76e2b57d1d60d1 Stefan Binding  2021-03-12  2156  		if (caps >= 0)
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2157  			snd_hda_override_wcaps(codec, CS8409_CS42L42_HP_PIN_NID,
76e2b57d1d60d1 Stefan Binding  2021-03-12  2158  				(caps | AC_WCAP_UNSOL_CAP));
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2159  
76e2b57d1d60d1 Stefan Binding  2021-03-12  2160  		caps = get_wcaps(codec, CS8409_CS42L42_AMIC_PIN_NID);
76e2b57d1d60d1 Stefan Binding  2021-03-12  2161  		if (caps >= 0)
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2162  			snd_hda_override_wcaps(codec, CS8409_CS42L42_AMIC_PIN_NID,
76e2b57d1d60d1 Stefan Binding  2021-03-12  2163  				(caps | AC_WCAP_UNSOL_CAP));
89b3eea4b1e18f Stefan Binding  2021-03-12  2164  		break;
89b3eea4b1e18f Stefan Binding  2021-03-12  2165  	case HDA_FIXUP_ACT_PROBE:
89b3eea4b1e18f Stefan Binding  2021-03-12  2166  		snd_hda_gen_add_kctl(&spec->gen,
89b3eea4b1e18f Stefan Binding  2021-03-12  2167  			NULL, &cs8409_cs42l42_hp_volume_mixer);
89b3eea4b1e18f Stefan Binding  2021-03-12  2168  		snd_hda_gen_add_kctl(&spec->gen,
89b3eea4b1e18f Stefan Binding  2021-03-12  2169  			NULL, &cs8409_cs42l42_amic_volume_mixer);
89b3eea4b1e18f Stefan Binding  2021-03-12  2170  		cs8409_cs42l42_hw_init(codec);
89b3eea4b1e18f Stefan Binding  2021-03-12  2171  		snd_hda_codec_set_name(codec, "CS8409/CS42L42");
89b3eea4b1e18f Stefan Binding  2021-03-12  2172  		break;
89b3eea4b1e18f Stefan Binding  2021-03-12  2173  	case HDA_FIXUP_ACT_INIT:
89b3eea4b1e18f Stefan Binding  2021-03-12  2174  		cs8409_cs42l42_hw_init(codec);
89b3eea4b1e18f Stefan Binding  2021-03-12  2175  		// Fall through
89b3eea4b1e18f Stefan Binding  2021-03-12  2176  	case HDA_FIXUP_ACT_BUILD:
89b3eea4b1e18f Stefan Binding  2021-03-12  2177  		/* Run jack auto detect first time on boot
89b3eea4b1e18f Stefan Binding  2021-03-12  2178  		 * after controls have been added, to check if jack has
89b3eea4b1e18f Stefan Binding  2021-03-12  2179  		 * been already plugged in.
89b3eea4b1e18f Stefan Binding  2021-03-12  2180  		 * Run immediately after init.
89b3eea4b1e18f Stefan Binding  2021-03-12  2181  		 */
89b3eea4b1e18f Stefan Binding  2021-03-12  2182  		cs8409_cs42l42_run_jack_detect(codec);
89b3eea4b1e18f Stefan Binding  2021-03-12  2183  		usleep_range(100000, 150000);
89b3eea4b1e18f Stefan Binding  2021-03-12  2184  		break;
89b3eea4b1e18f Stefan Binding  2021-03-12  2185  	default:
89b3eea4b1e18f Stefan Binding  2021-03-12  2186  		break;
89b3eea4b1e18f Stefan Binding  2021-03-12  2187  	}
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2188  }
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2189  

---
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: 28024 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH 4/4] ALSA: hda/cirrus: Make CS8409 driver more generic by using fixups.
Date: Sat, 13 Mar 2021 05:59:14 +0800	[thread overview]
Message-ID: <202103130544.EdST2GY6-lkp@intel.com> (raw)
In-Reply-To: <20210312184452.3288-5-vitalyr@opensource.cirrus.com>

[-- Attachment #1: Type: text/plain, Size: 9113 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 next-20210312]
[cannot apply to v5.12-rc2]
[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-Make-CS8409-driver-more-generic-by-using-fixups/20210313-024937
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
config: microblaze-randconfig-m031-20210312 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0

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

New smatch warnings:
sound/pci/hda/patch_cirrus.c:2143 cs8409_cs42l42_fixups() warn: always true condition '(caps >= 0) => (0-u32max >= 0)'

Old smatch warnings:
sound/pci/hda/patch_cirrus.c:2150 cs8409_cs42l42_fixups() warn: always true condition '(caps >= 0) => (0-u32max >= 0)'
sound/pci/hda/patch_cirrus.c:2156 cs8409_cs42l42_fixups() warn: always true condition '(caps >= 0) => (0-u32max >= 0)'
sound/pci/hda/patch_cirrus.c:2161 cs8409_cs42l42_fixups() warn: always true condition '(caps >= 0) => (0-u32max >= 0)'

vim +2143 sound/pci/hda/patch_cirrus.c

6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2098  
89b3eea4b1e18f Stefan Binding  2021-03-12  2099  static void cs8409_cs42l42_fixups(struct hda_codec *codec,
89b3eea4b1e18f Stefan Binding  2021-03-12  2100  				    const struct hda_fixup *fix, int action)
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2101  {
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2102  	struct cs_spec *spec = codec->spec;
76e2b57d1d60d1 Stefan Binding  2021-03-12  2103  	unsigned int caps;
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2104  
89b3eea4b1e18f Stefan Binding  2021-03-12  2105  	switch (action) {
89b3eea4b1e18f Stefan Binding  2021-03-12  2106  	case HDA_FIXUP_ACT_PRE_PROBE:
89b3eea4b1e18f Stefan Binding  2021-03-12  2107  		snd_hda_add_verbs(codec, cs8409_cs42l42_init_verbs);
89b3eea4b1e18f Stefan Binding  2021-03-12  2108  		/* verb exec op override */
89b3eea4b1e18f Stefan Binding  2021-03-12  2109  		spec->exec_verb = codec->core.exec_verb;
89b3eea4b1e18f Stefan Binding  2021-03-12  2110  		codec->core.exec_verb = cs8409_cs42l42_exec_verb;
89b3eea4b1e18f Stefan Binding  2021-03-12  2111  
89b3eea4b1e18f Stefan Binding  2021-03-12  2112  		mutex_init(&spec->cs8409_i2c_mux);
89b3eea4b1e18f Stefan Binding  2021-03-12  2113  
89b3eea4b1e18f Stefan Binding  2021-03-12  2114  		codec->patch_ops = cs8409_cs42l42_patch_ops;
89b3eea4b1e18f Stefan Binding  2021-03-12  2115  
89b3eea4b1e18f Stefan Binding  2021-03-12  2116  		spec->gen.suppress_auto_mute = 1;
89b3eea4b1e18f Stefan Binding  2021-03-12  2117  		spec->gen.no_primary_hp = 1;
89b3eea4b1e18f Stefan Binding  2021-03-12  2118  		spec->gen.suppress_vmaster = 1;
89b3eea4b1e18f Stefan Binding  2021-03-12  2119  
89b3eea4b1e18f Stefan Binding  2021-03-12  2120  		/* GPIO 5 out, 3,4 in */
89b3eea4b1e18f Stefan Binding  2021-03-12  2121  		spec->gpio_dir = GPIO5_INT;
89b3eea4b1e18f Stefan Binding  2021-03-12  2122  		spec->gpio_data = 0;
89b3eea4b1e18f Stefan Binding  2021-03-12  2123  		spec->gpio_mask = 0x03f;
89b3eea4b1e18f Stefan Binding  2021-03-12  2124  
89b3eea4b1e18f Stefan Binding  2021-03-12  2125  		spec->cs42l42_hp_jack_in = 0;
89b3eea4b1e18f Stefan Binding  2021-03-12  2126  		spec->cs42l42_mic_jack_in = 0;
89b3eea4b1e18f Stefan Binding  2021-03-12  2127  
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2128  		/* Basic initial sequence for specific hw configuration */
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2129  		snd_hda_sequence_write(codec, cs8409_cs42l42_init_verbs);
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2130  
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2131  		/* CS8409 is simple HDA bridge and intended to be used with a remote
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2132  		 * companion codec. Most of input/output PIN(s) have only basic
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2133  		 * capabilities. NID(s) 0x24 and 0x34 have only OUTC and INC
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2134  		 * capabilities and no presence detect capable (PDC) and call to
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2135  		 * snd_hda_gen_build_controls() will mark them as non detectable
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2136  		 * phantom jacks. However, in this configuration companion codec
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2137  		 * CS42L42 is connected to these pins and it has jack detect
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2138  		 * capabilities. We have to override pin capabilities,
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2139  		 * otherwise they will not be created as input devices.
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2140  		 */
76e2b57d1d60d1 Stefan Binding  2021-03-12  2141  		caps = snd_hdac_read_parm(&codec->core, CS8409_CS42L42_HP_PIN_NID,
76e2b57d1d60d1 Stefan Binding  2021-03-12  2142  				AC_PAR_PIN_CAP);
76e2b57d1d60d1 Stefan Binding  2021-03-12 @2143  		if (caps >= 0)
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2144  			snd_hdac_override_parm(&codec->core,
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2145  				CS8409_CS42L42_HP_PIN_NID, AC_PAR_PIN_CAP,
76e2b57d1d60d1 Stefan Binding  2021-03-12  2146  				(caps | (AC_PINCAP_IMP_SENSE | AC_PINCAP_PRES_DETECT)));
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2147  
76e2b57d1d60d1 Stefan Binding  2021-03-12  2148  		caps = snd_hdac_read_parm(&codec->core, CS8409_CS42L42_AMIC_PIN_NID,
76e2b57d1d60d1 Stefan Binding  2021-03-12  2149  				AC_PAR_PIN_CAP);
76e2b57d1d60d1 Stefan Binding  2021-03-12  2150  		if (caps >= 0)
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2151  			snd_hdac_override_parm(&codec->core,
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2152  				CS8409_CS42L42_AMIC_PIN_NID, AC_PAR_PIN_CAP,
76e2b57d1d60d1 Stefan Binding  2021-03-12  2153  				(caps | (AC_PINCAP_IMP_SENSE | AC_PINCAP_PRES_DETECT)));
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2154  
76e2b57d1d60d1 Stefan Binding  2021-03-12  2155  		caps = get_wcaps(codec, CS8409_CS42L42_HP_PIN_NID);
76e2b57d1d60d1 Stefan Binding  2021-03-12  2156  		if (caps >= 0)
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2157  			snd_hda_override_wcaps(codec, CS8409_CS42L42_HP_PIN_NID,
76e2b57d1d60d1 Stefan Binding  2021-03-12  2158  				(caps | AC_WCAP_UNSOL_CAP));
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2159  
76e2b57d1d60d1 Stefan Binding  2021-03-12  2160  		caps = get_wcaps(codec, CS8409_CS42L42_AMIC_PIN_NID);
76e2b57d1d60d1 Stefan Binding  2021-03-12  2161  		if (caps >= 0)
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2162  			snd_hda_override_wcaps(codec, CS8409_CS42L42_AMIC_PIN_NID,
76e2b57d1d60d1 Stefan Binding  2021-03-12  2163  				(caps | AC_WCAP_UNSOL_CAP));
89b3eea4b1e18f Stefan Binding  2021-03-12  2164  		break;
89b3eea4b1e18f Stefan Binding  2021-03-12  2165  	case HDA_FIXUP_ACT_PROBE:
89b3eea4b1e18f Stefan Binding  2021-03-12  2166  		snd_hda_gen_add_kctl(&spec->gen,
89b3eea4b1e18f Stefan Binding  2021-03-12  2167  			NULL, &cs8409_cs42l42_hp_volume_mixer);
89b3eea4b1e18f Stefan Binding  2021-03-12  2168  		snd_hda_gen_add_kctl(&spec->gen,
89b3eea4b1e18f Stefan Binding  2021-03-12  2169  			NULL, &cs8409_cs42l42_amic_volume_mixer);
89b3eea4b1e18f Stefan Binding  2021-03-12  2170  		cs8409_cs42l42_hw_init(codec);
89b3eea4b1e18f Stefan Binding  2021-03-12  2171  		snd_hda_codec_set_name(codec, "CS8409/CS42L42");
89b3eea4b1e18f Stefan Binding  2021-03-12  2172  		break;
89b3eea4b1e18f Stefan Binding  2021-03-12  2173  	case HDA_FIXUP_ACT_INIT:
89b3eea4b1e18f Stefan Binding  2021-03-12  2174  		cs8409_cs42l42_hw_init(codec);
89b3eea4b1e18f Stefan Binding  2021-03-12  2175  		// Fall through
89b3eea4b1e18f Stefan Binding  2021-03-12  2176  	case HDA_FIXUP_ACT_BUILD:
89b3eea4b1e18f Stefan Binding  2021-03-12  2177  		/* Run jack auto detect first time on boot
89b3eea4b1e18f Stefan Binding  2021-03-12  2178  		 * after controls have been added, to check if jack has
89b3eea4b1e18f Stefan Binding  2021-03-12  2179  		 * been already plugged in.
89b3eea4b1e18f Stefan Binding  2021-03-12  2180  		 * Run immediately after init.
89b3eea4b1e18f Stefan Binding  2021-03-12  2181  		 */
89b3eea4b1e18f Stefan Binding  2021-03-12  2182  		cs8409_cs42l42_run_jack_detect(codec);
89b3eea4b1e18f Stefan Binding  2021-03-12  2183  		usleep_range(100000, 150000);
89b3eea4b1e18f Stefan Binding  2021-03-12  2184  		break;
89b3eea4b1e18f Stefan Binding  2021-03-12  2185  	default:
89b3eea4b1e18f Stefan Binding  2021-03-12  2186  		break;
89b3eea4b1e18f Stefan Binding  2021-03-12  2187  	}
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2188  }
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2189  

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

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

WARNING: multiple messages have this Message-ID (diff)
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@lists.01.org, alsa-devel@alsa-project.org,
	patches@opensource.cirrus.com, linux-kernel@vger.kernel.org,
	Stefan Binding <sbinding@opensource.cirrus.com>
Subject: Re: [PATCH 4/4] ALSA: hda/cirrus: Make CS8409 driver more generic by using fixups.
Date: Sat, 13 Mar 2021 05:59:14 +0800	[thread overview]
Message-ID: <202103130544.EdST2GY6-lkp@intel.com> (raw)
In-Reply-To: <20210312184452.3288-5-vitalyr@opensource.cirrus.com>

[-- Attachment #1: Type: text/plain, Size: 8986 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 next-20210312]
[cannot apply to v5.12-rc2]
[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-Make-CS8409-driver-more-generic-by-using-fixups/20210313-024937
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
config: microblaze-randconfig-m031-20210312 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0

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

New smatch warnings:
sound/pci/hda/patch_cirrus.c:2143 cs8409_cs42l42_fixups() warn: always true condition '(caps >= 0) => (0-u32max >= 0)'

Old smatch warnings:
sound/pci/hda/patch_cirrus.c:2150 cs8409_cs42l42_fixups() warn: always true condition '(caps >= 0) => (0-u32max >= 0)'
sound/pci/hda/patch_cirrus.c:2156 cs8409_cs42l42_fixups() warn: always true condition '(caps >= 0) => (0-u32max >= 0)'
sound/pci/hda/patch_cirrus.c:2161 cs8409_cs42l42_fixups() warn: always true condition '(caps >= 0) => (0-u32max >= 0)'

vim +2143 sound/pci/hda/patch_cirrus.c

6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2098  
89b3eea4b1e18f Stefan Binding  2021-03-12  2099  static void cs8409_cs42l42_fixups(struct hda_codec *codec,
89b3eea4b1e18f Stefan Binding  2021-03-12  2100  				    const struct hda_fixup *fix, int action)
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2101  {
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2102  	struct cs_spec *spec = codec->spec;
76e2b57d1d60d1 Stefan Binding  2021-03-12  2103  	unsigned int caps;
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2104  
89b3eea4b1e18f Stefan Binding  2021-03-12  2105  	switch (action) {
89b3eea4b1e18f Stefan Binding  2021-03-12  2106  	case HDA_FIXUP_ACT_PRE_PROBE:
89b3eea4b1e18f Stefan Binding  2021-03-12  2107  		snd_hda_add_verbs(codec, cs8409_cs42l42_init_verbs);
89b3eea4b1e18f Stefan Binding  2021-03-12  2108  		/* verb exec op override */
89b3eea4b1e18f Stefan Binding  2021-03-12  2109  		spec->exec_verb = codec->core.exec_verb;
89b3eea4b1e18f Stefan Binding  2021-03-12  2110  		codec->core.exec_verb = cs8409_cs42l42_exec_verb;
89b3eea4b1e18f Stefan Binding  2021-03-12  2111  
89b3eea4b1e18f Stefan Binding  2021-03-12  2112  		mutex_init(&spec->cs8409_i2c_mux);
89b3eea4b1e18f Stefan Binding  2021-03-12  2113  
89b3eea4b1e18f Stefan Binding  2021-03-12  2114  		codec->patch_ops = cs8409_cs42l42_patch_ops;
89b3eea4b1e18f Stefan Binding  2021-03-12  2115  
89b3eea4b1e18f Stefan Binding  2021-03-12  2116  		spec->gen.suppress_auto_mute = 1;
89b3eea4b1e18f Stefan Binding  2021-03-12  2117  		spec->gen.no_primary_hp = 1;
89b3eea4b1e18f Stefan Binding  2021-03-12  2118  		spec->gen.suppress_vmaster = 1;
89b3eea4b1e18f Stefan Binding  2021-03-12  2119  
89b3eea4b1e18f Stefan Binding  2021-03-12  2120  		/* GPIO 5 out, 3,4 in */
89b3eea4b1e18f Stefan Binding  2021-03-12  2121  		spec->gpio_dir = GPIO5_INT;
89b3eea4b1e18f Stefan Binding  2021-03-12  2122  		spec->gpio_data = 0;
89b3eea4b1e18f Stefan Binding  2021-03-12  2123  		spec->gpio_mask = 0x03f;
89b3eea4b1e18f Stefan Binding  2021-03-12  2124  
89b3eea4b1e18f Stefan Binding  2021-03-12  2125  		spec->cs42l42_hp_jack_in = 0;
89b3eea4b1e18f Stefan Binding  2021-03-12  2126  		spec->cs42l42_mic_jack_in = 0;
89b3eea4b1e18f Stefan Binding  2021-03-12  2127  
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2128  		/* Basic initial sequence for specific hw configuration */
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2129  		snd_hda_sequence_write(codec, cs8409_cs42l42_init_verbs);
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2130  
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2131  		/* CS8409 is simple HDA bridge and intended to be used with a remote
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2132  		 * companion codec. Most of input/output PIN(s) have only basic
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2133  		 * capabilities. NID(s) 0x24 and 0x34 have only OUTC and INC
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2134  		 * capabilities and no presence detect capable (PDC) and call to
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2135  		 * snd_hda_gen_build_controls() will mark them as non detectable
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2136  		 * phantom jacks. However, in this configuration companion codec
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2137  		 * CS42L42 is connected to these pins and it has jack detect
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2138  		 * capabilities. We have to override pin capabilities,
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2139  		 * otherwise they will not be created as input devices.
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2140  		 */
76e2b57d1d60d1 Stefan Binding  2021-03-12  2141  		caps = snd_hdac_read_parm(&codec->core, CS8409_CS42L42_HP_PIN_NID,
76e2b57d1d60d1 Stefan Binding  2021-03-12  2142  				AC_PAR_PIN_CAP);
76e2b57d1d60d1 Stefan Binding  2021-03-12 @2143  		if (caps >= 0)
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2144  			snd_hdac_override_parm(&codec->core,
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2145  				CS8409_CS42L42_HP_PIN_NID, AC_PAR_PIN_CAP,
76e2b57d1d60d1 Stefan Binding  2021-03-12  2146  				(caps | (AC_PINCAP_IMP_SENSE | AC_PINCAP_PRES_DETECT)));
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2147  
76e2b57d1d60d1 Stefan Binding  2021-03-12  2148  		caps = snd_hdac_read_parm(&codec->core, CS8409_CS42L42_AMIC_PIN_NID,
76e2b57d1d60d1 Stefan Binding  2021-03-12  2149  				AC_PAR_PIN_CAP);
76e2b57d1d60d1 Stefan Binding  2021-03-12  2150  		if (caps >= 0)
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2151  			snd_hdac_override_parm(&codec->core,
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2152  				CS8409_CS42L42_AMIC_PIN_NID, AC_PAR_PIN_CAP,
76e2b57d1d60d1 Stefan Binding  2021-03-12  2153  				(caps | (AC_PINCAP_IMP_SENSE | AC_PINCAP_PRES_DETECT)));
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2154  
76e2b57d1d60d1 Stefan Binding  2021-03-12  2155  		caps = get_wcaps(codec, CS8409_CS42L42_HP_PIN_NID);
76e2b57d1d60d1 Stefan Binding  2021-03-12  2156  		if (caps >= 0)
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2157  			snd_hda_override_wcaps(codec, CS8409_CS42L42_HP_PIN_NID,
76e2b57d1d60d1 Stefan Binding  2021-03-12  2158  				(caps | AC_WCAP_UNSOL_CAP));
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2159  
76e2b57d1d60d1 Stefan Binding  2021-03-12  2160  		caps = get_wcaps(codec, CS8409_CS42L42_AMIC_PIN_NID);
76e2b57d1d60d1 Stefan Binding  2021-03-12  2161  		if (caps >= 0)
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2162  			snd_hda_override_wcaps(codec, CS8409_CS42L42_AMIC_PIN_NID,
76e2b57d1d60d1 Stefan Binding  2021-03-12  2163  				(caps | AC_WCAP_UNSOL_CAP));
89b3eea4b1e18f Stefan Binding  2021-03-12  2164  		break;
89b3eea4b1e18f Stefan Binding  2021-03-12  2165  	case HDA_FIXUP_ACT_PROBE:
89b3eea4b1e18f Stefan Binding  2021-03-12  2166  		snd_hda_gen_add_kctl(&spec->gen,
89b3eea4b1e18f Stefan Binding  2021-03-12  2167  			NULL, &cs8409_cs42l42_hp_volume_mixer);
89b3eea4b1e18f Stefan Binding  2021-03-12  2168  		snd_hda_gen_add_kctl(&spec->gen,
89b3eea4b1e18f Stefan Binding  2021-03-12  2169  			NULL, &cs8409_cs42l42_amic_volume_mixer);
89b3eea4b1e18f Stefan Binding  2021-03-12  2170  		cs8409_cs42l42_hw_init(codec);
89b3eea4b1e18f Stefan Binding  2021-03-12  2171  		snd_hda_codec_set_name(codec, "CS8409/CS42L42");
89b3eea4b1e18f Stefan Binding  2021-03-12  2172  		break;
89b3eea4b1e18f Stefan Binding  2021-03-12  2173  	case HDA_FIXUP_ACT_INIT:
89b3eea4b1e18f Stefan Binding  2021-03-12  2174  		cs8409_cs42l42_hw_init(codec);
89b3eea4b1e18f Stefan Binding  2021-03-12  2175  		// Fall through
89b3eea4b1e18f Stefan Binding  2021-03-12  2176  	case HDA_FIXUP_ACT_BUILD:
89b3eea4b1e18f Stefan Binding  2021-03-12  2177  		/* Run jack auto detect first time on boot
89b3eea4b1e18f Stefan Binding  2021-03-12  2178  		 * after controls have been added, to check if jack has
89b3eea4b1e18f Stefan Binding  2021-03-12  2179  		 * been already plugged in.
89b3eea4b1e18f Stefan Binding  2021-03-12  2180  		 * Run immediately after init.
89b3eea4b1e18f Stefan Binding  2021-03-12  2181  		 */
89b3eea4b1e18f Stefan Binding  2021-03-12  2182  		cs8409_cs42l42_run_jack_detect(codec);
89b3eea4b1e18f Stefan Binding  2021-03-12  2183  		usleep_range(100000, 150000);
89b3eea4b1e18f Stefan Binding  2021-03-12  2184  		break;
89b3eea4b1e18f Stefan Binding  2021-03-12  2185  	default:
89b3eea4b1e18f Stefan Binding  2021-03-12  2186  		break;
89b3eea4b1e18f Stefan Binding  2021-03-12  2187  	}
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2188  }
6cc7e93f46a5ce Vitaly Rodionov 2021-03-06  2189  

---
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: 28024 bytes --]

  reply	other threads:[~2021-03-12 22:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 18:44 [PATCH 0/4] ALSA: hda/cirrus: Make CS8409 driver more generic by using fixups Vitaly Rodionov
2021-03-12 18:44 ` Vitaly Rodionov
2021-03-12 18:44 ` [PATCH 1/4] ALSA: hda/cirrus: Add error handling into CS8409 I2C functions Vitaly Rodionov
2021-03-12 18:44   ` Vitaly Rodionov
2021-03-12 18:44 ` [PATCH 2/4] ALSA: hda/cirrus: Cleanup patch_cirrus.c code Vitaly Rodionov
2021-03-12 18:44   ` Vitaly Rodionov
2021-03-12 18:44 ` [PATCH 3/4] ALSA: hda/cirrus: Fix CS42L42 Headset Mic volume control name Vitaly Rodionov
2021-03-12 18:44   ` Vitaly Rodionov
2021-03-12 18:44 ` [PATCH 4/4] ALSA: hda/cirrus: Make CS8409 driver more generic by using fixups Vitaly Rodionov
2021-03-12 18:44   ` Vitaly Rodionov
2021-03-12 21:59   ` kernel test robot [this message]
2021-03-12 21:59     ` kernel test robot
2021-03-12 21:59     ` kernel test robot

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=202103130544.EdST2GY6-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=sbinding@opensource.cirrus.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.