]> git.dujemihanovic.xyz Git - linux.git/commitdiff
ALSA: hda: cs35l41: Only add SPI CS GPIO if SPI is enabled in kernel
authorStefan Binding <sbinding@opensource.cirrus.com>
Tue, 19 Dec 2023 16:22:32 +0000 (16:22 +0000)
committerTakashi Iwai <tiwai@suse.de>
Thu, 21 Dec 2023 08:24:01 +0000 (09:24 +0100)
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: 8c4c216db8fb ("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>
sound/pci/hda/cs35l41_hda_property.c

index 73b304e6c83c7aa39c0b85e8a2940d9b55270a60..194e1179a253e2b64c65476b5ee4be4d1cd55bd7 100644 (file)
@@ -210,6 +210,8 @@ static int generic_dsd_config(struct cs35l41_hda *cs35l41, struct device *physde
 
        if (cfg->bus == SPI) {
                cs35l41->index = id;
+
+#if IS_ENABLED(CONFIG_SPI)
                /*
                 * Manually set the Chip Select for the second amp <cs_gpio_index> in the node.
                 * 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
                                spi_setup(spi);
                        }
                }
+#endif
        } else {
                if (cfg->num_amps > 2)
                        /*