summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/twl6040.c
diff options
context:
space:
mode:
authorOlaya, Margarita <magi.olaya@ti.com>2010-12-10 21:06:07 -0600
committerLiam Girdwood <lrg@slimlogic.co.uk>2010-12-14 20:36:47 +0000
commit99903ea23655a43ce4f75b64fef69e341fd0b7df (patch)
treeb53d2cc459efab394034af825b17b88b1cf02fd6 /sound/soc/codecs/twl6040.c
parentcb973d78f82f038c7d8d78d469fb89842d246871 (diff)
ASoC: twl6040: Enable automatic power for phoenix 1.1
Phoenix 1.1 supports automatic power on sequence, a verification is added to use it with new revision of the chip. Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc/codecs/twl6040.c')
-rw-r--r--sound/soc/codecs/twl6040.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 5081e812c528..c54350445d0c 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1108,6 +1108,7 @@ static int twl6040_probe(struct snd_soc_codec *codec)
struct twl6040_data *priv;
int audpwron, naudint;
int ret = 0;
+ u8 icrev;
priv = kzalloc(sizeof(struct twl6040_data), GFP_KERNEL);
if (priv == NULL)
@@ -1116,13 +1117,17 @@ static int twl6040_probe(struct snd_soc_codec *codec)
priv->codec = codec;
- if (twl_codec) {
+ twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &icrev, TWL6040_REG_ASICREV);
+
+ if (twl_codec && (icrev > 0))
audpwron = twl_codec->audpwron_gpio;
- naudint = twl_codec->naudint_irq;
- } else {
+ else
audpwron = -EINVAL;
+
+ if (twl_codec)
+ naudint = twl_codec->naudint_irq;
+ else
naudint = 0;
- }
priv->audpwron = audpwron;
priv->naudint = naudint;