summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-io.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-08-10 10:24:12 +0200
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-08-10 17:35:55 +0200
commitf024d9a0854cb3f2d09603d1ed3a52f04778330d (patch)
treed309a9683fadbff398926a06b2ad7b89031d274b /sound/soc/soc-io.c
parentASoC: Specify register defaults for WM8958 MICBIAS1 and MICBIAS2 (diff)
downloadlinux-f024d9a0854cb3f2d09603d1ed3a52f04778330d.tar.xz
linux-f024d9a0854cb3f2d09603d1ed3a52f04778330d.zip
ASoC: soc-io: Add CONFIG_REGMAP_I2C/CONFIG_REGMAP_SPI guards for regmap_init_i2c/regmap_init_spi
In the case of "make da8xx_omapl_defconfig;make", the SPI support is disabled. Thus calling regmap_init_spi in soc-io.c has below build error. ERROR: "regmap_init_spi" [sound/soc/snd-soc-core.ko] undefined! make[1]: *** [__modpost] Error 1 make: *** [modules] Error 2 This patch fixes the build error by adding CONFIG_REGMAP_I2C/CONFIG_REGMAP_SPI guards for regmap_init_i2c/regmap_init_spi. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-io.c')
-rw-r--r--sound/soc/soc-io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c
index e471ed667fe9..be5aac3d7a1b 100644
--- a/sound/soc/soc-io.c
+++ b/sound/soc/soc-io.c
@@ -122,15 +122,19 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
config.val_bits = data_bits;
switch (control) {
+#ifdef CONFIG_REGMAP_I2C
case SND_SOC_I2C:
codec->control_data = regmap_init_i2c(to_i2c_client(codec->dev),
&config);
break;
+#endif
+#ifdef CONFIG_REGMAP_SPI
case SND_SOC_SPI:
codec->control_data = regmap_init_spi(to_spi_device(codec->dev),
&config);
break;
+#endif
case SND_SOC_REGMAP:
/* Device has made its own regmap arrangements */