Skip to contentSkip to conversation

ASoC: Support !REGULATOR build for sgtl5000

PATCH In review Mark Brown 2 participants 2 messages Mar 22, 2011

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: Support !REGULATOR build for sgtl5000

The regulator is optional depending on board design.

---
 sound/soc/codecs/sgtl5000.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
sound/soc/codecs/sgtl5000.c +14 -0
index 1f7217f..ff29380 100644
@@ -772,6 +772,7 @@ static int sgtl5000_pcm_hw_params(struct snd_pcm_substream *substream,
 	return 0;
 }
 
+#ifdef CONFIG_REGULATOR
 static int ldo_regulator_is_enabled(struct regulator_dev *dev)
 {
 	struct ldo_regulator *ldo = rdev_get_drvdata(dev);
@@ -901,6 +902,19 @@ static int ldo_regulator_remove(struct snd_soc_codec *codec)
 
 	return 0;
 }
+#else
+static int ldo_regulator_register(struct snd_soc_codec *codec,
+				struct regulator_init_data *init_data,
+				int voltage)
+{
+	return -EINVAL;
+}
+
+static int ldo_regulator_remove(struct snd_soc_codec *codec)
+{
+	return 0;
+}
+#endif
 
 /*
  * set dac bias
Signature · 1 line
1.7.4.1