[alsa-devel] [PATCH 1/2] ALSA: ASoC: add STA32X codec driver

Johannes Stezenbach js at sig21.net
Thu Jun 16 11:12:07 CEST 2011


On Thu, Jun 16, 2011 at 10:39:22AM +0200, Lars-Peter Clausen wrote:
> >> On Tue, Jun 14, 2011 at 09:27:05PM +0200, Daniel Mack wrote:
> >>
> >>> +static const char *sta32x_limiter_drc_attack_thr[] = {
> >>> +	"-31dB", "-29dB", "-27dB", "-25dB", "-23dB", "-21dB", "-19dB", "-17dB",
> >>> +	"-16dB", "-15dB", "-14dB", "-13dB", "-12dB", "-10dB", "-7dB", "-4dB" };
> 
> You can put multiple scale items each with their own min/max value into a TLV.
> For example for DRC attack in your case this would look like:
> 
> static const unsigned int drc_attack_tlv[] = {
> 	TLV_DB_RANGE_HEAD(3),
> 	0, 7, TLV_DB_SCALE_ITEM(-3100, 200, 0),
> 	8, 13, TLV_DB_SCALE_ITEM(-1600, 100, 0),
> 	14, 16, TLV_DB_SCALE_ITEM(-1000, 300, 0),
> };

That looks indeed much better than using enums.

Thanks,
Johannes


More information about the Alsa-devel mailing list