Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: wm8991: Don't use range container for TLVs with one entry

For TLVs with only a single entry it is not necessary to use a range
container. Use DECLARE_TLV_DB_LINEAR() directly instead of a combination of
TLV_DB_RANGE_HEAD() and TLV_DB_LINEAR_ITEM().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Lars-Peter Clausen and committed by
Mark Brown
00769dbe dfd0edda

+9 -43
+9 -43
sound/soc/codecs/wm8991.c
··· 111 111 } 112 112 } 113 113 114 - static const unsigned int rec_mix_tlv[] = { 115 - TLV_DB_RANGE_HEAD(1), 116 - 0, 7, TLV_DB_LINEAR_ITEM(-1500, 600), 117 - }; 118 - 119 - static const unsigned int in_pga_tlv[] = { 120 - TLV_DB_RANGE_HEAD(1), 121 - 0, 0x1F, TLV_DB_LINEAR_ITEM(-1650, 3000), 122 - }; 123 - 124 - static const unsigned int out_mix_tlv[] = { 125 - TLV_DB_RANGE_HEAD(1), 126 - 0, 7, TLV_DB_LINEAR_ITEM(0, -2100), 127 - }; 128 - 129 - static const unsigned int out_pga_tlv[] = { 130 - TLV_DB_RANGE_HEAD(1), 131 - 0, 127, TLV_DB_LINEAR_ITEM(-7300, 600), 132 - }; 133 - 134 - static const unsigned int out_omix_tlv[] = { 135 - TLV_DB_RANGE_HEAD(1), 136 - 0, 7, TLV_DB_LINEAR_ITEM(-600, 0), 137 - }; 138 - 139 - static const unsigned int out_dac_tlv[] = { 140 - TLV_DB_RANGE_HEAD(1), 141 - 0, 255, TLV_DB_LINEAR_ITEM(-7163, 0), 142 - }; 143 - 144 - static const unsigned int in_adc_tlv[] = { 145 - TLV_DB_RANGE_HEAD(1), 146 - 0, 255, TLV_DB_LINEAR_ITEM(-7163, 1763), 147 - }; 148 - 149 - static const unsigned int out_sidetone_tlv[] = { 150 - TLV_DB_RANGE_HEAD(1), 151 - 0, 31, TLV_DB_LINEAR_ITEM(-3600, 0), 152 - }; 114 + static const DECLARE_TLV_DB_LINEAR(rec_mix_tlv, -1500, 600); 115 + static const DECLARE_TLV_DB_LINEAR(in_pga_tlv, -1650, 3000); 116 + static const DECLARE_TLV_DB_LINEAR(out_mix_tlv, 0, -2100); 117 + static const DECLARE_TLV_DB_LINEAR(out_pga_tlv, -7300, 600); 118 + static const DECLARE_TLV_DB_LINEAR(out_omix_tlv, -600, 0); 119 + static const DECLARE_TLV_DB_LINEAR(out_dac_tlv, -7163, 0); 120 + static const DECLARE_TLV_DB_LINEAR(in_adc_tlv, -7163, 1763); 121 + static const DECLARE_TLV_DB_LINEAR(out_sidetone_tlv, -3600, 0); 153 122 154 123 static int wm899x_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol, 155 124 struct snd_ctl_elem_value *ucontrol) ··· 398 429 } 399 430 400 431 /* INMIX dB values */ 401 - static const unsigned int in_mix_tlv[] = { 402 - TLV_DB_RANGE_HEAD(1), 403 - 0, 7, TLV_DB_LINEAR_ITEM(-1200, 600), 404 - }; 432 + static const DECLARE_TLV_DB_LINEAR(in_mix_tlv, -1200, 600); 405 433 406 434 /* Left In PGA Connections */ 407 435 static const struct snd_kcontrol_new wm8991_dapm_lin12_pga_controls[] = {