Skip to content

Commit 916d051

Browse files
Stefan Bindingtiwai
authored andcommitted
ALSA: hda: cs35l41: Only add SPI CS GPIO if SPI is enabled in kernel
If CONFIG_SPI is not set in the kernel, there is no point in trying to set the chip selects. We can selectively compile it. Fixes: 8c4c216 ("ALSA: hda: cs35l41: Add config table to support many laptops without _DSD") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202312192256.lJelQEoZ-lkp@intel.com/ Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20231219162232.790358-3-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent ed7326a commit 916d051

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sound/pci/hda/cs35l41_hda_property.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ static int generic_dsd_config(struct cs35l41_hda *cs35l41, struct device *physde
210210

211211
if (cfg->bus == SPI) {
212212
cs35l41->index = id;
213+
214+
#if IS_ENABLED(CONFIG_SPI)
213215
/*
214216
* Manually set the Chip Select for the second amp <cs_gpio_index> in the node.
215217
* This is only supported for systems with 2 amps, since we cannot expand the
@@ -249,6 +251,7 @@ static int generic_dsd_config(struct cs35l41_hda *cs35l41, struct device *physde
249251
spi_setup(spi);
250252
}
251253
}
254+
#endif
252255
} else {
253256
if (cfg->num_amps > 2)
254257
/*

0 commit comments

Comments
 (0)