diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2015-08-02 11:19:39 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-08-05 08:22:44 -0400 |
commit | e27c8404a4745b3efeec1457e6b72f448ab4a785 (patch) | |
tree | f01922e831b58cccd3bc7cee6e8e9512e215abb9 /sound | |
parent | 32e933be3f221723ace230fe1293eb3b3b3466ff (diff) |
ASoC: da9055: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE
DECLARE_TLV_DB_RANGE() has the advantage over using TLV_DB_RANGE_HEAD()
that it automatically calculates the number of items in the TLV and is
hence less prone to manual error.
Generate using the following coccinelle script
// <smpl>
@@
declarer name DECLARE_TLV_DB_RANGE;
identifier tlv;
constant x;
@@
-unsigned int tlv[] = {
- TLV_DB_RANGE_HEAD(x),
+DECLARE_TLV_DB_RANGE(tlv,
...
-};
+);
// </smpl>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/da9055.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sound/soc/codecs/da9055.c b/sound/soc/codecs/da9055.c index 66bb446473b8..8e6fc57eb186 100644 --- a/sound/soc/codecs/da9055.c +++ b/sound/soc/codecs/da9055.c | |||
@@ -289,26 +289,23 @@ enum clk_src { | |||
289 | 289 | ||
290 | /* Gain and Volume */ | 290 | /* Gain and Volume */ |
291 | 291 | ||
292 | static const unsigned int aux_vol_tlv[] = { | 292 | static const DECLARE_TLV_DB_RANGE(aux_vol_tlv, |
293 | TLV_DB_RANGE_HEAD(2), | ||
294 | 0x0, 0x10, TLV_DB_SCALE_ITEM(-5400, 0, 0), | 293 | 0x0, 0x10, TLV_DB_SCALE_ITEM(-5400, 0, 0), |
295 | /* -54dB to 15dB */ | 294 | /* -54dB to 15dB */ |
296 | 0x11, 0x3f, TLV_DB_SCALE_ITEM(-5400, 150, 0) | 295 | 0x11, 0x3f, TLV_DB_SCALE_ITEM(-5400, 150, 0) |
297 | }; | 296 | ); |
298 | 297 | ||
299 | static const unsigned int digital_gain_tlv[] = { | 298 | static const DECLARE_TLV_DB_RANGE(digital_gain_tlv, |
300 | TLV_DB_RANGE_HEAD(2), | ||
301 | 0x0, 0x07, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 1), | 299 | 0x0, 0x07, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 1), |
302 | /* -78dB to 12dB */ | 300 | /* -78dB to 12dB */ |
303 | 0x08, 0x7f, TLV_DB_SCALE_ITEM(-7800, 75, 0) | 301 | 0x08, 0x7f, TLV_DB_SCALE_ITEM(-7800, 75, 0) |
304 | }; | 302 | ); |
305 | 303 | ||
306 | static const unsigned int alc_analog_gain_tlv[] = { | 304 | static const DECLARE_TLV_DB_RANGE(alc_analog_gain_tlv, |
307 | TLV_DB_RANGE_HEAD(2), | ||
308 | 0x0, 0x0, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 1), | 305 | 0x0, 0x0, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 1), |
309 | /* 0dB to 36dB */ | 306 | /* 0dB to 36dB */ |
310 | 0x01, 0x07, TLV_DB_SCALE_ITEM(0, 600, 0) | 307 | 0x01, 0x07, TLV_DB_SCALE_ITEM(0, 600, 0) |
311 | }; | 308 | ); |
312 | 309 | ||
313 | static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, -600, 600, 0); | 310 | static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, -600, 600, 0); |
314 | static const DECLARE_TLV_DB_SCALE(mixin_gain_tlv, -450, 150, 0); | 311 | static const DECLARE_TLV_DB_SCALE(mixin_gain_tlv, -450, 150, 0); |