Skip to content

Commit

Permalink
ASoC: Support !REGULATOR build for sgtl5000
Browse files Browse the repository at this point in the history
The regulator is optional depending on board design.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
  • Loading branch information
Mark Brown committed Mar 22, 2011
1 parent b1a56b3 commit 333802e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sound/soc/codecs/sgtl5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 333802e

Please sign in to comment.