ASoC: tpa6130a2: Support for limiting gain
Subsystems (3)
PATCH 1/1 ASoC: tpa6130a2: Support for limiting gain
Add support for platform dependent gain limiting on the tpa6130a2 (and tpa6140a2) Headset amplifier.
--- include/sound/tpa6130a2-plat.h | 1 + sound/soc/codecs/tpa6130a2.c | 76 +++++++++++++++++++++++++++++++++++---- 2 files changed, 69 insertions(+), 8 deletions(-)
include/sound/tpa6130a2-plat.h +1 -0
@@ -31,6 +31,7 @@ enum tpa_model {struct tpa6130a2_platform_data {enum tpa_model id;int power_gpio; +int limit_gain; };#endif
sound/soc/codecs/tpa6130a2.c +68 -8
128 lines not on this page · raw message
Signature · 1 line
1.7.1
Quoted 4 lines · Peter Ujfalusi
Add support for platform dependent gain limiting on the tpa6130a2 (and tpa6140a2) Headset amplifier.
Signed-off-by Peter Ujfalusi <[email protected]>
but we should really provide a generic implementation of this.
Quoted 7 lines · On Thursday 06 May 2010 12:49:42 ext Mark Brown wrote:
Quoted 4 lines · Peter Ujfalusi
Add support for platform dependent gain limiting on the tpa6130a2 (and tpa6140a2) Headset amplifier.
Signed-off-by Peter Ujfalusi <[email protected]>Acked-by Mark Brown <[email protected]>
Thanks,
Quoted 1 line
but we should really provide a generic implementation of this.
Yeah, would be really useful.
What I was wondering about is the cases when you have a codec + amp in a system..
If we take for example twl4030 and the tpa6130 connected together:
than we have 4 levels of gain control inside of twl, than one additional level on the tpa side.
What would be nice is to somehow limit the whole chain, but it seams really complicated thing because of the big amount of combinations that you can actually achieve the same level at the output.
So the gain-chain limitation is really holistic problem IMHO.
But I guess the core could gain support for limiting individual volume controls. Some soc-limit-gain("kcontrol name", min, max)
Than it goes through the controls on the card, finds the kcontrol, and fixers up the limits..
So machine drivers can fix up the gain limits on their cards with ease, and no additional support from the codec/amp drivers are going to be needed Hmm, this would be neat!
Sounds interesting, I might look at this ;)
Signature · 1 line
Péter
Liam Girdwood
AppliedQuoted 33 lines · Peter Ujfalusi
Quoted 7 lines · On Thursday 06 May 2010 12:49:42 ext Mark Brown wrote:
Quoted 4 lines · Peter Ujfalusi
Add support for platform dependent gain limiting on the tpa6130a2 (and tpa6140a2) Headset amplifier.
Signed-off-by Peter Ujfalusi <[email protected]>Acked-by Mark Brown <[email protected]>Thanks,
Quoted 1 line
but we should really provide a generic implementation of this.
Yeah, would be really useful.
What I was wondering about is the cases when you have a codec + amp in a system..
If we take for example twl4030 and the tpa6130 connected together:
than we have 4 levels of gain control inside of twl, than one additional level on the tpa side.
What would be nice is to somehow limit the whole chain, but it seams really complicated thing because of the big amount of combinations that you can actually achieve the same level at the output.So the gain-chain limitation is really holistic problem IMHO.
But I guess the core could gain support for limiting individual volume controls. Some soc-limit-gain("kcontrol name", min, max)
Than it goes through the controls on the card, finds the kcontrol, and fixers up the limits..
So machine drivers can fix up the gain limits on their cards with ease, and no additional support from the codec/amp drivers are going to be needed Hmm, this would be neat!
Quoted 1 line
Sounds interesting, I might look at this ;)
Applied. We can always update this when core has this feature.
Thanks
Liam
Quoted 8 lines · Peter Ujfalusi
What I was wondering about is the cases when you have a codec + amp in a system..
If we take for example twl4030 and the tpa6130 connected together:
than we have 4 levels of gain control inside of twl, than one additional level on the tpa side.
What would be nice is to somehow limit the whole chain, but it seams really complicated thing because of the big amount of combinations that you can actually achieve the same level at the output.
Well, normally you'd only really vary one or possibly two gains in the path at runtime - everything else would be fixed by the scenario - so it's not so urgent to enforce anything over the full path, you can just deal with the controls that actually get updated dynamically.
One of the bigger use cases here is to prevent physical damage if you've got a speaker driver that can produce more power than the speaker attached to it is rated for.