[broonie-ci:asoc-7.3 9/9] sound/soc/codecs/rt766-sdca.c:925:33: warning: variable 'direction' set but not used

kernel test robot <[email protected]> Wed, 05 Aug 2026 11:37:03 +0800
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/ci.git asoc-7.3
head:   99ddfbba9e71617494c14b95ed85b9d25bc3202c
commit: 64adc3cec7e237e8d168b8614d11b27b7f83bdb0 [9/9] ASoC: rt766: add RT766/RT767 SDCA driver
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20260805/[email protected]/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260805/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

   sound/soc/codecs/rt766-sdca.c: In function 'rt766_sdca_irq_ctl':
   sound/soc/codecs/rt766-sdca.c:240:41: error: implicit declaration of function 'sdca_irq_cleanup_late'; did you mean 'sdca_irq_cleanup'? [-Wimplicit-function-declaration]
     240 |                                         sdca_irq_cleanup_late(dev, function, info);
         |                                         ^~~~~~~~~~~~~~~~~~~~~
         |                                         sdca_irq_cleanup
   sound/soc/codecs/rt766-sdca.c: In function 'rt766_sdca_probe':
   sound/soc/codecs/rt766-sdca.c:858:35: error: implicit declaration of function 'devm_sdca_irq_allocate'; did you mean 'sdca_irq_allocate'? [-Wimplicit-function-declaration]
     858 |                 rt766->irq_info = devm_sdca_irq_allocate(dev, rt766->regmap, rt766->slave->irq);
         |                                   ^~~~~~~~~~~~~~~~~~~~~~
         |                                   sdca_irq_allocate
   sound/soc/codecs/rt766-sdca.c:858:33: error: assignment to 'struct sdca_interrupt_info *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     858 |                 rt766->irq_info = devm_sdca_irq_allocate(dev, rt766->regmap, rt766->slave->irq);
         |                                 ^
   sound/soc/codecs/rt766-sdca.c: In function 'rt766_sdca_pcm_hw_params':
>> sound/soc/codecs/rt766-sdca.c:925:33: warning: variable 'direction' set but not used [-Wunused-but-set-variable]
     925 |         enum sdw_data_direction direction;
         |                                 ^~~~~~~~~


vim +/direction +925 sound/soc/codecs/rt766-sdca.c

   916	
   917	static int rt766_sdca_pcm_hw_params(struct snd_pcm_substream *substream,
   918					struct snd_pcm_hw_params *params,
   919					struct snd_soc_dai *dai)
   920	{
   921		struct snd_soc_component *component = dai->component;
   922		struct rt766_sdca_priv *rt766 = snd_soc_component_get_drvdata(component);
   923		struct sdw_stream_config stream_config;
   924		struct sdw_port_config port_config;
 > 925		enum sdw_data_direction direction;
   926		struct sdw_stream_runtime *sdw_stream;
   927		unsigned int sampling_rate;
   928		int retval, port;
   929	
   930		dev_dbg(dai->dev, "%s %s id %d", __func__, dai->name, dai->id);
   931		sdw_stream = snd_soc_dai_get_dma_data(dai, substream);
   932	
   933		if (!sdw_stream)
   934			return -EINVAL;
   935	
   936		if (!rt766->slave)
   937			return -EINVAL;
   938	
   939		/* SoundWire specific configuration */
   940		snd_sdw_params_to_config(substream, params, &stream_config, &port_config);
   941	
   942		/* SoundWire specific configuration */
   943		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
   944			direction = SDW_DATA_DIR_RX;
   945			if (dai->id == RT766_AIF1)
   946				port = 3;
   947			else if (dai->id == RT766_AIF2)
   948				port = 1;
   949			else
   950				return -EINVAL;
   951		} else {
   952			direction = SDW_DATA_DIR_TX;
   953			if (dai->id == RT766_AIF1)
   954				port = 12;
   955			else if (dai->id == RT766_AIF3)
   956				port = 8;
   957			else
   958				return -EINVAL;
   959		}
   960	
   961		port_config.num = port;
   962		retval = sdw_stream_add_slave(rt766->slave, &stream_config,
   963						&port_config, 1, sdw_stream);
   964		if (retval) {
   965			dev_err(dai->dev, "%s: Unable to configure port\n", __func__);
   966			return retval;
   967		}
   968	
   969		if (params_channels(params) > 16) {
   970			dev_err(component->dev, "%s: Unsupported channels %d\n",
   971				__func__, params_channels(params));
   972			return -EINVAL;
   973		}
   974	
   975		/* sampling rate configuration */
   976		switch (params_rate(params)) {
   977		case 44100:
   978			sampling_rate = RT766_SDCA_RATE_44100HZ;
   979			break;
   980		case 48000:
   981			sampling_rate = RT766_SDCA_RATE_48000HZ;
   982			break;
   983		case 96000:
   984			sampling_rate = RT766_SDCA_RATE_96000HZ;
   985			break;
   986		case 192000:
   987			sampling_rate = RT766_SDCA_RATE_192000HZ;
   988			break;
   989		default:
   990			dev_err(component->dev, "%s: Rate %d is not supported\n",
   991				__func__, params_rate(params));
   992			return -EINVAL;
   993		}
   994	
   995		/* set sampling frequency */
   996		switch (dai->id) {
   997		case RT766_AIF1:
   998			regmap_write(rt766->regmap,
   999				RT766_SDCA_CTL(UAJ, CS41, SDCA_CTL_CS_SAMPLERATEINDEX),
  1000				sampling_rate);
  1001			regmap_write(rt766->regmap,
  1002				RT766_SDCA_CTL(UAJ, CS36, SDCA_CTL_CS_SAMPLERATEINDEX),
  1003				sampling_rate);
  1004			break;
  1005		case RT766_AIF2:
  1006			regmap_write(rt766->regmap,
  1007				RT766_SDCA_CTL(AMP, CS21, SDCA_CTL_CS_SAMPLERATEINDEX),
  1008				sampling_rate);
  1009			break;
  1010		case RT766_AIF3:
  1011			regmap_write(rt766->regmap,
  1012				RT766_SDCA_CTL(MIC, CS113, SDCA_CTL_CS_SAMPLERATEINDEX),
  1013				sampling_rate);
  1014			break;
  1015		default:
  1016			dev_err(component->dev, "%s: Wrong DAI id\n", __func__);
  1017			return -EINVAL;
  1018		}
  1019	
  1020		return 0;
  1021	}
  1022	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki