ASoC: tas5086: add regulator consumer support
Subsystems (3)
PATCH v3 1/1 ASoC: tas5086: add regulator consumer support
The TAS5086 has two power domains, DVDD and AVDD. Enable them both as long as the codec is in use.
Also, switch on the power to identify the chip at device probe level, and switch it off again afterwards. The codec level will take care for power handling later.
---
This has been sitting in my tree since I forgot to resend it in March.
.../devicetree/bindings/sound/ti,tas5086.txt | 5 ++ sound/soc/codecs/tas5086.c | 67 +++++++++++++++++++--- 2 files changed, 63 insertions(+), 9 deletions(-)
Documentation/devicetree/bindings/sound/ti,tas5086.txt +5 -0
@@ -31,6 +31,9 @@ Optional properties: Most systems should not set any of these properties. + - avdd-supply: Power supply for AVDD, providing 3.3V + - dvdd-supply: Power supply for DVDD, providing 3.3V + Examples: i2c_bus {
@@ -39,5 +42,7 @@ Examples: reg = <0x1b>; reset-gpio = <&gpio 23 0>; ti,charge-period = <156000>; + avdd-supply = <&vdd_3v3_reg>; + dvdd-supply = <&vdd_3v3_reg>; }; };
sound/soc/codecs/tas5086.c +58 -9
143 lines not on this page · raw message
Signature · 1 line
1.9.3
Quoted 6 lines · Daniel Mack
The TAS5086 has two power domains, DVDD and AVDD. Enable them both as long as the codec is in use.
Also, switch on the power to identify the chip at device probe level, and switch it off again afterwards. The codec level will take care for power handling later.
Applied, thanks. One small thing:
sound/soc/codecs/tas5086.c static int tas5086_i2c_probe(struct i2c_client *i2c, · line 983
Quoted 9 lines
sound/soc/codecs/tas5086.c +9
-0+/* +* The chip has been identified, so we can turn off the power +* again until the dai link is set up. +*/ +regulator_bulk_disable (ARRAY_SIZE (priv->supplies), priv->supplies); + +if (ret ==0 ) + ret =snd_soc_register_codec (&i2c->dev, &soc_codec_dev_tas5086, + &tas5086_dai,1 );
It can be slightly smoother to do the disable after registering so that if we immediately cause a card to register and that causes the device to become active again we don't bounce the power. Nobody is ever likely to notice the difference though.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 10 lines · Mark Brown
Quoted 6 lines · Daniel Mack
The TAS5086 has two power domains, DVDD and AVDD. Enable them both as long as the codec is in use.
Also, switch on the power to identify the chip at device probe level, and switch it off again afterwards. The codec level will take care for power handling later.
Applied, thanks. One small thing:
Quoted 11 lines
Quoted 6 lines
(quoted diff) +1
-0+ /* + * The chip has been identified, so we can turn off thepower + * again until the dai link is set up. + */ +
regulator_bulk_disable(ARRAY_SIZE(priv->supplies),priv->supplies); + + if (ret == 0) + ret =snd_soc_register_codec(&i2c->dev, &soc_codec_dev_tas5086, + &tas5086_dai, 1);It can be slightly smoother to do the disable after registering so that if we immediately cause a card to register and that causes the device to become active again we don't bounce the power. Nobody is ever likely to notice the difference though.
True. I'll keep an eye on that.
Thanks,
Daniel
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJTtYnpAAoJELphMRr8Y1QkEfsP/07T02vEEjN76SW8gMrabEjX KbhWTkDWJz361hqpY6JaZ3a03t0tL7TV4aMTlKSdK34Ch3WdJtMN8SvrXObWI7mw iIgjxBmkrXO6OhZqDBwMSYA4OnTepnygM+zVwFqJjUo/k/bmWBWFZVYBaezHZLk8 Qj5BxtgNqELvKneEPK2J1OSbYsrgo4UEQyAv8FLCq/wn+F49uqMx9VYas/xqXYls lCjoIS46MzhkP70mgdCRBchs5ngAXBxS4TFZByX9vmiwJJl0kyO2hQ9IEYiVUl5R bEFAGrjg7fscjwo3h1fYa2XearL9NaTcww8HdoiS3YJcvV/SMMGN8QBr4xL3rSy1 RPCY8TD1rerGAfKtEYcqRoSx01ihKdx9uwo0qLffbcxjVG1suAuxlP0lFyuK+VQB 1WsG6WLW+Emh4xNpwYzFdKe5xg5YHktc0jBweh83NjS6HTB6wySyD6a7TTq67NkO f3AxkJE39L+WklydsJHpt7Bl9oCRuWcQ2VLgnjLohoLx9VcyCik4sAZ7nfSeiZEh XXKgl1dqO2Mwa8oBkMEQM354Z3PGNSilliwBWkSGYuUpWINkpQ0VRcyz9aWsaoCG v+N+67mrCJ8kb6YZwSO4ir88dVi/pnga/U40LvJhpQ3zk9rhWLTt15B6qXqcszQq kJ4d0r2wUKGtzhHBJqqk
=OduV
-----END PGP SIGNATURE-----