[PATCH -next 1/2] ASoC: max98396: Fix build error for implicit function declaration

Hui Tang tanghui20 at huawei.com
Wed May 11 03:23:47 CEST 2022


sound/soc/codecs/max98396.c: In function ‘max98396_i2c_probe’:
sound/soc/codecs/max98396.c:1555:25: error: implicit declaration of function ‘devm_gpiod_get_optional’; did you mean ‘devm_regulator_get_optional’? [-Werror=implicit-function-declaration]
  max98396->reset_gpio = devm_gpiod_get_optional(&i2c->dev,
                         ^~~~~~~~~~~~~~~~~~~~~~~
                         devm_regulator_get_optional
sound/soc/codecs/max98396.c:1556:23: error: ‘GPIOD_OUT_HIGH’ undeclared (first use in this function); did you mean ‘GPIOF_INIT_HIGH’?
              "reset", GPIOD_OUT_HIGH);
                       ^~~~~~~~~~~~~~
                       GPIOF_INIT_HIGH
sound/soc/codecs/max98396.c:1556:23: note: each undeclared identifier is reported only once for each function it appears in
sound/soc/codecs/max98396.c:1565:3: error: implicit declaration of function ‘gpiod_set_value_cansleep’; did you mean ‘gpio_set_value_cansleep’? [-Werror=implicit-function-declaration]
   gpiod_set_value_cansleep(max98396->reset_gpio, 0);
   ^~~~~~~~~~~~~~~~~~~~~~~~
   gpio_set_value_cansleep
cc1: all warnings being treated as errors

Add depend on GPIOLIB for 'config SND_SOC_MAX98396'

Fixes: b58581136770 ("ASoC: max98396: add amplifier driver")
Signed-off-by: Hui Tang <tanghui20 at huawei.com>
---
 sound/soc/codecs/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index b106e5517090..71a7afedd0aa 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -1051,6 +1051,7 @@ config SND_SOC_MAX98390
 config SND_SOC_MAX98396
 	tristate "Analog Devices MAX98396 Speaker Amplifier"
 	depends on I2C
+	depends on GPIOLIB
 	help
 	  Enable support for Analog Devices MAX98396 audio
 	  amplifier. The device provides a PCM interface for
-- 
2.17.1



More information about the Alsa-devel mailing list