[alsa-devel] [PATCH] ASoC: TWL4030: PM fix for output amplifiers

Peter Ujfalusi peter.ujfalusi at nokia.com
Tue Mar 23 13:29:26 CET 2010


On Tuesday 23 March 2010 12:02:10 ext Mark Brown wrote:
> On Tue, Mar 23, 2010 at 09:59:13AM +0200, Peter Ujfalusi wrote:
> > /*
> > 
> >  * Gain controls tied to outputs
> >  * -6 dB to 6 dB in 6 dB steps (mute instead of -12)
> >  */
> > 
> > static const unsigned int output_tlv[] = {
> > 
> > 	TLV_DB_RANGE_HEAD(4),
> > 	0, 0, TLV_DB_SCALE_ITEM(-1200, 0,  1),
> > 	3, 3, TLV_DB_SCALE_ITEM(-600, 0, 0),
> > 	2, 2, TLV_DB_SCALE_ITEM(0, 0, 0),
> > 	1, 1, TLV_DB_SCALE_ITEM(600, 0, 0),
> > 
> > };
> > 
> > I'm not sure about the tlv declaration, but is there a way to actually
> > map the gain/power control in the TWL in a standard way?
> 
> I'd expect that to work in that userspace will see the various values
> with the expected gains but I'd not expect that applications would
> reorder the values so it'll look odd in the UI.  But I've not actually
> tried it.

Indeed it look odd at the end:

amixer sset 'PreDriv' 0
  Front Left: Playback 0 [0%] [-99999.99dB]
  Front Right: Playback 0 [0%] [-99999.99dB]

amixer sset 'PreDriv' 1
  Front Left: Playback 1 [33%] [6.00dB]
  Front Right: Playback 1 [33%] [6.00dB]

amixer sset 'PreDriv' 2
  Front Left: Playback 2 [67%] [0.00dB]
  Front Right: Playback 2 [67%] [0.00dB]

amixer sset 'PreDriv' 3
  Front Left: Playback 3 [100%] [-6.00dB]
  Front Right: Playback 3 [100%] [-6.00dB

It worth a try anyway.

-- 
Péter


More information about the Alsa-devel mailing list