[linux-next:pending-fixes 174/268] sound/pci/hda/cs35l41_hda_property.c:238: undefined reference to `spi_setup'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git pending-fixes
head:   c6eb02b33bd24f8f4a60947b539db4871ef914cd
commit: b592ed2e1d78a475f781802e441c499ab446975b [174/268] ALSA: hda: cs35l41: Support additional ASUS ROG 2023 models
config: i386-randconfig-051-20231010 (https://download.01.org/0day-ci/archive/20231221/202312211413.1NkzZWqi-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231221/202312211413.1NkzZWqi-lkp@xxxxxxxxx/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 <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312211413.1NkzZWqi-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

   ld: sound/pci/hda/cs35l41_hda_property.o: in function `generic_dsd_config':
>> sound/pci/hda/cs35l41_hda_property.c:238: undefined reference to `spi_setup'


vim +238 sound/pci/hda/cs35l41_hda_property.c

8c4c216db8fb84 Stefan Binding 2023-12-18  159  
8c4c216db8fb84 Stefan Binding 2023-12-18  160  static int generic_dsd_config(struct cs35l41_hda *cs35l41, struct device *physdev, int id,
8c4c216db8fb84 Stefan Binding 2023-12-18  161  			      const char *hid)
8c4c216db8fb84 Stefan Binding 2023-12-18  162  {
8c4c216db8fb84 Stefan Binding 2023-12-18  163  	struct cs35l41_hw_cfg *hw_cfg = &cs35l41->hw_cfg;
8c4c216db8fb84 Stefan Binding 2023-12-18  164  	const struct cs35l41_config *cfg;
8c4c216db8fb84 Stefan Binding 2023-12-18  165  	struct gpio_desc *cs_gpiod;
8c4c216db8fb84 Stefan Binding 2023-12-18  166  	struct spi_device *spi;
8c4c216db8fb84 Stefan Binding 2023-12-18  167  	bool dsd_found;
8c4c216db8fb84 Stefan Binding 2023-12-18  168  	int ret;
8c4c216db8fb84 Stefan Binding 2023-12-18  169  
8c4c216db8fb84 Stefan Binding 2023-12-18  170  	for (cfg = cs35l41_config_table; cfg->ssid; cfg++) {
8c4c216db8fb84 Stefan Binding 2023-12-18  171  		if (!strcasecmp(cfg->ssid, cs35l41->acpi_subsystem_id))
8c4c216db8fb84 Stefan Binding 2023-12-18  172  			break;
8c4c216db8fb84 Stefan Binding 2023-12-18  173  	}
8c4c216db8fb84 Stefan Binding 2023-12-18  174  
8c4c216db8fb84 Stefan Binding 2023-12-18  175  	if (!cfg->ssid)
8c4c216db8fb84 Stefan Binding 2023-12-18  176  		return -ENOENT;
8c4c216db8fb84 Stefan Binding 2023-12-18  177  
8c4c216db8fb84 Stefan Binding 2023-12-18  178  	if (!cs35l41->dacpi || cs35l41->dacpi != ACPI_COMPANION(physdev)) {
8c4c216db8fb84 Stefan Binding 2023-12-18  179  		dev_err(cs35l41->dev, "ACPI Device does not match, cannot override _DSD.\n");
8c4c216db8fb84 Stefan Binding 2023-12-18  180  		return -ENODEV;
8c4c216db8fb84 Stefan Binding 2023-12-18  181  	}
8c4c216db8fb84 Stefan Binding 2023-12-18  182  
8c4c216db8fb84 Stefan Binding 2023-12-18  183  	dev_info(cs35l41->dev, "Adding DSD properties for %s\n", cs35l41->acpi_subsystem_id);
8c4c216db8fb84 Stefan Binding 2023-12-18  184  
8c4c216db8fb84 Stefan Binding 2023-12-18  185  	dsd_found = acpi_dev_has_props(cs35l41->dacpi);
8c4c216db8fb84 Stefan Binding 2023-12-18  186  
8c4c216db8fb84 Stefan Binding 2023-12-18  187  	if (!dsd_found) {
8c4c216db8fb84 Stefan Binding 2023-12-18  188  		ret = cs35l41_add_gpios(cs35l41, physdev, cfg->reset_gpio_index,
8c4c216db8fb84 Stefan Binding 2023-12-18  189  						 cfg->spkid_gpio_index, cfg->cs_gpio_index,
8c4c216db8fb84 Stefan Binding 2023-12-18  190  						 cfg->num_amps);
8c4c216db8fb84 Stefan Binding 2023-12-18  191  		if (ret) {
8c4c216db8fb84 Stefan Binding 2023-12-18  192  			dev_err(cs35l41->dev, "Error adding GPIO mapping: %d\n", ret);
8c4c216db8fb84 Stefan Binding 2023-12-18  193  			return ret;
8c4c216db8fb84 Stefan Binding 2023-12-18  194  		}
8c4c216db8fb84 Stefan Binding 2023-12-18  195  	} else if (cfg->reset_gpio_index >= 0 || cfg->spkid_gpio_index >= 0) {
8c4c216db8fb84 Stefan Binding 2023-12-18  196  		dev_warn(cs35l41->dev, "Cannot add Reset/Speaker ID/SPI CS GPIO Mapping, "
8c4c216db8fb84 Stefan Binding 2023-12-18  197  			 "_DSD already exists.\n");
8c4c216db8fb84 Stefan Binding 2023-12-18  198  	}
8c4c216db8fb84 Stefan Binding 2023-12-18  199  
8c4c216db8fb84 Stefan Binding 2023-12-18  200  	if (cfg->bus == SPI) {
8c4c216db8fb84 Stefan Binding 2023-12-18  201  		cs35l41->index = id;
8c4c216db8fb84 Stefan Binding 2023-12-18  202  		/*
8c4c216db8fb84 Stefan Binding 2023-12-18  203  		 * Manually set the Chip Select for the second amp <cs_gpio_index> in the node.
8c4c216db8fb84 Stefan Binding 2023-12-18  204  		 * This is only supported for systems with 2 amps, since we cannot expand the
8c4c216db8fb84 Stefan Binding 2023-12-18  205  		 * default number of chip selects without using cs-gpios
8c4c216db8fb84 Stefan Binding 2023-12-18  206  		 * The CS GPIO must be set high prior to communicating with the first amp (which
8c4c216db8fb84 Stefan Binding 2023-12-18  207  		 * uses a native chip select), to ensure the second amp does not clash with the
8c4c216db8fb84 Stefan Binding 2023-12-18  208  		 * first.
8c4c216db8fb84 Stefan Binding 2023-12-18  209  		 */
8c4c216db8fb84 Stefan Binding 2023-12-18  210  		if (cfg->cs_gpio_index >= 0) {
8c4c216db8fb84 Stefan Binding 2023-12-18  211  			spi = to_spi_device(cs35l41->dev);
8c4c216db8fb84 Stefan Binding 2023-12-18  212  
8c4c216db8fb84 Stefan Binding 2023-12-18  213  			if (cfg->num_amps != 2) {
8c4c216db8fb84 Stefan Binding 2023-12-18  214  				dev_warn(cs35l41->dev,
8c4c216db8fb84 Stefan Binding 2023-12-18  215  					 "Cannot update SPI CS, Number of Amps (%d) != 2\n",
8c4c216db8fb84 Stefan Binding 2023-12-18  216  					 cfg->num_amps);
8c4c216db8fb84 Stefan Binding 2023-12-18  217  			} else if (dsd_found) {
8c4c216db8fb84 Stefan Binding 2023-12-18  218  				dev_warn(cs35l41->dev,
8c4c216db8fb84 Stefan Binding 2023-12-18  219  					"Cannot update SPI CS, _DSD already exists.\n");
8c4c216db8fb84 Stefan Binding 2023-12-18  220  			} else {
8c4c216db8fb84 Stefan Binding 2023-12-18  221  				/*
8c4c216db8fb84 Stefan Binding 2023-12-18  222  				 * This is obtained using driver_gpios, since only one GPIO for CS
8c4c216db8fb84 Stefan Binding 2023-12-18  223  				 * exists, this can be obtained using index 0.
8c4c216db8fb84 Stefan Binding 2023-12-18  224  				 */
8c4c216db8fb84 Stefan Binding 2023-12-18  225  				cs_gpiod = gpiod_get_index(physdev, "cs", 0, GPIOD_OUT_LOW);
8c4c216db8fb84 Stefan Binding 2023-12-18  226  				if (IS_ERR(cs_gpiod)) {
8c4c216db8fb84 Stefan Binding 2023-12-18  227  					dev_err(cs35l41->dev,
8c4c216db8fb84 Stefan Binding 2023-12-18  228  						"Unable to get Chip Select GPIO descriptor\n");
8c4c216db8fb84 Stefan Binding 2023-12-18  229  					return PTR_ERR(cs_gpiod);
8c4c216db8fb84 Stefan Binding 2023-12-18  230  				}
8c4c216db8fb84 Stefan Binding 2023-12-18  231  				if (id == 1) {
8c4c216db8fb84 Stefan Binding 2023-12-18  232  					spi_set_csgpiod(spi, 0, cs_gpiod);
8c4c216db8fb84 Stefan Binding 2023-12-18  233  					cs35l41->cs_gpio = cs_gpiod;
8c4c216db8fb84 Stefan Binding 2023-12-18  234  				} else {
8c4c216db8fb84 Stefan Binding 2023-12-18  235  					gpiod_set_value_cansleep(cs_gpiod, true);
8c4c216db8fb84 Stefan Binding 2023-12-18  236  					gpiod_put(cs_gpiod);
8c4c216db8fb84 Stefan Binding 2023-12-18  237  				}
8c4c216db8fb84 Stefan Binding 2023-12-18 @238  				spi_setup(spi);
8c4c216db8fb84 Stefan Binding 2023-12-18  239  			}
8c4c216db8fb84 Stefan Binding 2023-12-18  240  		}
8c4c216db8fb84 Stefan Binding 2023-12-18  241  	} else {
8c4c216db8fb84 Stefan Binding 2023-12-18  242  		if (cfg->num_amps > 2)
8c4c216db8fb84 Stefan Binding 2023-12-18  243  			/*
8c4c216db8fb84 Stefan Binding 2023-12-18  244  			 * i2c addresses for 3/4 amps are used in order: 0x40, 0x41, 0x42, 0x43,
8c4c216db8fb84 Stefan Binding 2023-12-18  245  			 * subtracting 0x40 would give zero-based index
8c4c216db8fb84 Stefan Binding 2023-12-18  246  			 */
8c4c216db8fb84 Stefan Binding 2023-12-18  247  			cs35l41->index = id - 0x40;
8c4c216db8fb84 Stefan Binding 2023-12-18  248  		else
8c4c216db8fb84 Stefan Binding 2023-12-18  249  			/* i2c addr 0x40 for first amp (always), 0x41/0x42 for 2nd amp */
8c4c216db8fb84 Stefan Binding 2023-12-18  250  			cs35l41->index = id == 0x40 ? 0 : 1;
8c4c216db8fb84 Stefan Binding 2023-12-18  251  	}
8c4c216db8fb84 Stefan Binding 2023-12-18  252  
8c4c216db8fb84 Stefan Binding 2023-12-18  253  	if (cfg->num_amps == 3)
8c4c216db8fb84 Stefan Binding 2023-12-18  254  		/* 3 amps means a center channel, so no duplicate channels */
8c4c216db8fb84 Stefan Binding 2023-12-18  255  		cs35l41->channel_index = 0;
8c4c216db8fb84 Stefan Binding 2023-12-18  256  	else
8c4c216db8fb84 Stefan Binding 2023-12-18  257  		/*
8c4c216db8fb84 Stefan Binding 2023-12-18  258  		 * if 4 amps, there are duplicate channels, so they need different indexes
8c4c216db8fb84 Stefan Binding 2023-12-18  259  		 * if 2 amps, no duplicate channels, channel_index would be 0
8c4c216db8fb84 Stefan Binding 2023-12-18  260  		 */
8c4c216db8fb84 Stefan Binding 2023-12-18  261  		cs35l41->channel_index = cs35l41->index / 2;
8c4c216db8fb84 Stefan Binding 2023-12-18  262  
8c4c216db8fb84 Stefan Binding 2023-12-18  263  	cs35l41->reset_gpio = fwnode_gpiod_get_index(acpi_fwnode_handle(cs35l41->dacpi), "reset",
8c4c216db8fb84 Stefan Binding 2023-12-18  264  						     cs35l41->index, GPIOD_OUT_LOW,
8c4c216db8fb84 Stefan Binding 2023-12-18  265  						     "cs35l41-reset");
8c4c216db8fb84 Stefan Binding 2023-12-18  266  	cs35l41->speaker_id = cs35l41_get_speaker_id(physdev, cs35l41->index, cfg->num_amps, -1);
8c4c216db8fb84 Stefan Binding 2023-12-18  267  
8c4c216db8fb84 Stefan Binding 2023-12-18  268  	hw_cfg->spk_pos = cfg->channel[cs35l41->index];
8c4c216db8fb84 Stefan Binding 2023-12-18  269  
8c4c216db8fb84 Stefan Binding 2023-12-18  270  	if (cfg->boost_type == INTERNAL) {
8c4c216db8fb84 Stefan Binding 2023-12-18  271  		hw_cfg->bst_type = CS35L41_INT_BOOST;
8c4c216db8fb84 Stefan Binding 2023-12-18  272  		hw_cfg->bst_ind = cfg->boost_ind_nanohenry;
8c4c216db8fb84 Stefan Binding 2023-12-18  273  		hw_cfg->bst_ipk = cfg->boost_peak_milliamp;
8c4c216db8fb84 Stefan Binding 2023-12-18  274  		hw_cfg->bst_cap = cfg->boost_cap_microfarad;
8c4c216db8fb84 Stefan Binding 2023-12-18  275  		hw_cfg->gpio1.func = CS35L41_NOT_USED;
8c4c216db8fb84 Stefan Binding 2023-12-18  276  		hw_cfg->gpio1.valid = true;
8c4c216db8fb84 Stefan Binding 2023-12-18  277  	} else {
8c4c216db8fb84 Stefan Binding 2023-12-18  278  		hw_cfg->bst_type = CS35L41_EXT_BOOST;
8c4c216db8fb84 Stefan Binding 2023-12-18  279  		hw_cfg->bst_ind = -1;
8c4c216db8fb84 Stefan Binding 2023-12-18  280  		hw_cfg->bst_ipk = -1;
8c4c216db8fb84 Stefan Binding 2023-12-18  281  		hw_cfg->bst_cap = -1;
8c4c216db8fb84 Stefan Binding 2023-12-18  282  		hw_cfg->gpio1.func = CS35l41_VSPK_SWITCH;
8c4c216db8fb84 Stefan Binding 2023-12-18  283  		hw_cfg->gpio1.valid = true;
8c4c216db8fb84 Stefan Binding 2023-12-18  284  	}
8c4c216db8fb84 Stefan Binding 2023-12-18  285  
8c4c216db8fb84 Stefan Binding 2023-12-18  286  	hw_cfg->gpio2.func = CS35L41_INTERRUPT;
8c4c216db8fb84 Stefan Binding 2023-12-18  287  	hw_cfg->gpio2.valid = true;
8c4c216db8fb84 Stefan Binding 2023-12-18  288  	hw_cfg->valid = true;
8c4c216db8fb84 Stefan Binding 2023-12-18  289  
8c4c216db8fb84 Stefan Binding 2023-12-18  290  	return 0;
8c4c216db8fb84 Stefan Binding 2023-12-18  291  }
ef4ba63f12b035 Stefan Binding 2023-08-15  292  

:::::: The code at line 238 was first introduced by commit
:::::: 8c4c216db8fb84be9c4ca60d72b88882066cf28f ALSA: hda: cs35l41: Add config table to support many laptops without _DSD

:::::: TO: Stefan Binding <sbinding@xxxxxxxxxxxxxxxxxxxxx>
:::::: CC: Takashi Iwai <tiwai@xxxxxxx>

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux