]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: sgtl5000: check whether regulator is enabled before disabling it
authorLothar Waßmann <LW@KARO-electronics.de>
Thu, 17 Jul 2014 13:18:54 +0000 (15:18 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 27 Aug 2014 08:44:21 +0000 (10:44 +0200)
sound/soc/codecs/sgtl5000.c

index 7449438095f9458ffc48ffd797ef11e0afc89ead..c4b64da4d22fefe324a20ff678335fa7f573dbb4 100644 (file)
@@ -806,6 +806,9 @@ static int ldo_regulator_disable(struct regulator_dev *dev)
        struct ldo_regulator *ldo = rdev_get_drvdata(dev);
        struct snd_soc_codec *codec = (struct snd_soc_codec *)ldo->codec_data;
 
+       if (ldo_regulator_is_enabled(dev))
+               return 0;
+
        snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER,
                                SGTL5000_LINEREG_D_POWERUP,
                                0);