提交 5ee0b8f8 编写于 作者: L Lars-Peter Clausen 提交者: Mark Brown

ASoC: uda1380: 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: NLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 2524911e
...@@ -269,12 +269,11 @@ static DECLARE_TLV_DB_SCALE(amix_tlv, -4950, 150, 1); ...@@ -269,12 +269,11 @@ static DECLARE_TLV_DB_SCALE(amix_tlv, -4950, 150, 1);
* from -66 dB in 0.5 dB steps (2 dB steps, really) and * from -66 dB in 0.5 dB steps (2 dB steps, really) and
* from -52 dB in 0.25 dB steps * from -52 dB in 0.25 dB steps
*/ */
static const unsigned int mvol_tlv[] = { static const DECLARE_TLV_DB_RANGE(mvol_tlv,
TLV_DB_RANGE_HEAD(3),
0, 15, TLV_DB_SCALE_ITEM(-8200, 100, 1), 0, 15, TLV_DB_SCALE_ITEM(-8200, 100, 1),
16, 43, TLV_DB_SCALE_ITEM(-6600, 50, 0), 16, 43, TLV_DB_SCALE_ITEM(-6600, 50, 0),
44, 252, TLV_DB_SCALE_ITEM(-5200, 25, 0), 44, 252, TLV_DB_SCALE_ITEM(-5200, 25, 0)
}; );
/* /*
* from -72 dB in 1.5 dB steps (6 dB steps really), * from -72 dB in 1.5 dB steps (6 dB steps really),
...@@ -282,13 +281,12 @@ static const unsigned int mvol_tlv[] = { ...@@ -282,13 +281,12 @@ static const unsigned int mvol_tlv[] = {
* from -60 dB in 0.5 dB steps (2 dB steps really) and * from -60 dB in 0.5 dB steps (2 dB steps really) and
* from -46 dB in 0.25 dB steps * from -46 dB in 0.25 dB steps
*/ */
static const unsigned int vc_tlv[] = { static const DECLARE_TLV_DB_RANGE(vc_tlv,
TLV_DB_RANGE_HEAD(4),
0, 7, TLV_DB_SCALE_ITEM(-7800, 150, 1), 0, 7, TLV_DB_SCALE_ITEM(-7800, 150, 1),
8, 15, TLV_DB_SCALE_ITEM(-6600, 75, 0), 8, 15, TLV_DB_SCALE_ITEM(-6600, 75, 0),
16, 43, TLV_DB_SCALE_ITEM(-6000, 50, 0), 16, 43, TLV_DB_SCALE_ITEM(-6000, 50, 0),
44, 228, TLV_DB_SCALE_ITEM(-4600, 25, 0), 44, 228, TLV_DB_SCALE_ITEM(-4600, 25, 0)
}; );
/* from 0 to 6 dB in 2 dB steps if SPF mode != flat */ /* from 0 to 6 dB in 2 dB steps if SPF mode != flat */
static DECLARE_TLV_DB_SCALE(tr_tlv, 0, 200, 0); static DECLARE_TLV_DB_SCALE(tr_tlv, 0, 200, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册