aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-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 5081e812c52..c54350445d0 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)
1108 struct twl6040_data *priv; 1108 struct twl6040_data *priv;
1109 int audpwron, naudint; 1109 int audpwron, naudint;
1110 int ret = 0; 1110 int ret = 0;
1111 u8 icrev;
1111 1112
1112 priv = kzalloc(sizeof(struct twl6040_data), GFP_KERNEL); 1113 priv = kzalloc(sizeof(struct twl6040_data), GFP_KERNEL);
1113 if (priv == NULL) 1114 if (priv == NULL)
@@ -1116,13 +1117,17 @@ static int twl6040_probe(struct snd_soc_codec *codec)
1116 1117
1117 priv->codec = codec; 1118 priv->codec = codec;
1118 1119
1119 if (twl_codec) { 1120 twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &icrev, TWL6040_REG_ASICREV);
1121
1122 if (twl_codec && (icrev > 0))
1120 audpwron = twl_codec->audpwron_gpio; 1123 audpwron = twl_codec->audpwron_gpio;
1121 naudint = twl_codec->naudint_irq; 1124 else
1122 } else {
1123 audpwron = -EINVAL; 1125 audpwron = -EINVAL;
1126
1127 if (twl_codec)
1128 naudint = twl_codec->naudint_irq;
1129 else
1124 naudint = 0; 1130 naudint = 0;
1125 }
1126 1131
1127 priv->audpwron = audpwron; 1132 priv->audpwron = audpwron;
1128 priv->naudint = naudint; 1133 priv->naudint = naudint;