All of lore.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Liam Girdwood <lrg@ti.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	alsa-devel@alsa-project.org
Subject: [PATCH] ASoC: soc-io: Add CONFIG_REGMAP_I2C/CONFIG_REGMAP_SPI guards for regmap_init_i2c/regmap_init_spi
Date: Wed, 10 Aug 2011 16:24:12 +0800	[thread overview]
Message-ID: <1312964652.11589.1.camel@phoenix> (raw)

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>
---
 sound/soc/soc-io.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c
index e471ed6..be5aac3 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 */
-- 
1.7.4.1

             reply	other threads:[~2011-08-10  8:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-10  8:24 Axel Lin [this message]
2011-08-10 15:37 ` [PATCH] ASoC: soc-io: Add CONFIG_REGMAP_I2C/CONFIG_REGMAP_SPI guards for regmap_init_i2c/regmap_init_spi Mark Brown
2011-08-10 15:37   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1312964652.11589.1.camel@phoenix \
    --to=axel.lin@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.