All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>
Cc: Oder Chiou <oder_chiou@realtek.com>,
	Brian Austin <brian.austin@cirrus.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Support Opensource <support.opensource@diasemi.com>,
	Anish Kumar <yesanishhere@gmail.com>,
	patches@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org,
	Paul Handrigan <Paul.Handrigan@cirrus.com>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>,
	Bard Liao <bardliao@realtek.com>,
	Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Subject: [PATCH 11/42] ASoC: da9055: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE
Date: Sun,  2 Aug 2015 17:19:39 +0200	[thread overview]
Message-ID: <1438528810-23498-12-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1438528810-23498-1-git-send-email-lars@metafoo.de>

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>
---
 sound/soc/codecs/da9055.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/sound/soc/codecs/da9055.c b/sound/soc/codecs/da9055.c
index 04c76f3..588854d 100644
--- a/sound/soc/codecs/da9055.c
+++ b/sound/soc/codecs/da9055.c
@@ -289,26 +289,23 @@ enum clk_src {
 
 /* Gain and Volume */
 
-static const unsigned int aux_vol_tlv[] = {
-	TLV_DB_RANGE_HEAD(2),
+static const DECLARE_TLV_DB_RANGE(aux_vol_tlv,
 	0x0, 0x10, TLV_DB_SCALE_ITEM(-5400, 0, 0),
 	/* -54dB to 15dB */
 	0x11, 0x3f, TLV_DB_SCALE_ITEM(-5400, 150, 0)
-};
+);
 
-static const unsigned int digital_gain_tlv[] = {
-	TLV_DB_RANGE_HEAD(2),
+static const DECLARE_TLV_DB_RANGE(digital_gain_tlv,
 	0x0, 0x07, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 1),
 	/* -78dB to 12dB */
 	0x08, 0x7f, TLV_DB_SCALE_ITEM(-7800, 75, 0)
-};
+);
 
-static const unsigned int alc_analog_gain_tlv[] = {
-	TLV_DB_RANGE_HEAD(2),
+static const DECLARE_TLV_DB_RANGE(alc_analog_gain_tlv,
 	0x0, 0x0, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 1),
 	/* 0dB to 36dB */
 	0x01, 0x07, TLV_DB_SCALE_ITEM(0, 600, 0)
-};
+);
 
 static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, -600, 600, 0);
 static const DECLARE_TLV_DB_SCALE(mixin_gain_tlv, -450, 150, 0);
-- 
2.1.4

  parent reply	other threads:[~2015-08-02 15:20 UTC|newest]

Thread overview: 92+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-02 15:19 [PATCH 00/42] ASoC: Replace users of TLV_DB_RANGE_HEAD Lars-Peter Clausen
2015-08-02 15:19 ` [PATCH 01/42] ASoC: 88pm860x: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:32   ` Applied "ASoC: 88pm860x: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 02/42] ASoC: ab8500: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:32   ` Applied "ASoC: ab8500: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 03/42] ASoC: adau1373: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: adau1373: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 04/42] ASoC: alc5623: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: alc5623: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 05/42] ASoC: alc5632: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: alc5632: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 06/42] ASoC: cs42l52: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: cs42l52: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 07/42] ASoC: cs42l56: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: cs42l56: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 08/42] ASoC: cs42l73: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: cs42l73: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 09/42] ASoC: da7210: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-03 14:45   ` Opensource [Adam Thomson]
2015-08-05 12:31   ` Applied "ASoC: da7210: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 10/42] ASoC: da7213: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-03 14:46   ` Opensource [Adam Thomson]
2015-08-05 12:31   ` Applied "ASoC: da7213: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` Lars-Peter Clausen [this message]
2015-08-03 14:47   ` [PATCH 11/42] ASoC: da9055: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Opensource [Adam Thomson]
2015-08-05 12:31   ` Applied "ASoC: da9055: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 12/42] ASoC: jz4740: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: jz4740: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 13/42] ASoC: max9768: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: max9768: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 14/42] ASoC: max98088: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: max98088: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 15/42] ASoC: max98090: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: max98090: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 16/42] ASoC: max98095: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: max98095: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 17/42] ASoC: max9850: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: max9850: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 18/42] ASoC: max9877: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: max9877: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 19/42] ASoC: rt5631: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: rt5631: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 20/42] ASoC: rt5640: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: rt5640: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 21/42] ASoC: rt5645: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: rt5645: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 22/42] ASoC: rt5651: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: rt5651: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 23/42] ASoC: rt5670: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: rt5670: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 24/42] ASoC: rt5677: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: rt5677: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 25/42] ASoC: sgtl5000: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: sgtl5000: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 26/42] ASoC: ssm2602: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: ssm2602: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 27/42] ASoC: tpa6130a2: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-03 13:38   ` Peter Ujfalusi
2015-08-05 12:31   ` Applied "ASoC: tpa6130a2: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 28/42] ASoC: twl4030: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-03 13:38   ` Peter Ujfalusi
2015-08-05 12:31   ` Applied "ASoC: twl4030: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 29/42] ASoC: uda1380: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: uda1380: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 30/42] ASoC: wm8350: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: wm8350: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:19 ` [PATCH 31/42] ASoC: wm8400: Don't use range container for TLV with one entry Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: wm8400: Don't use range container for TLV with one entry" to the asoc tree Mark Brown
2015-08-02 15:20 ` [PATCH 32/42] ASoC: wm8737: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: wm8737: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:20 ` [PATCH 33/42] ASoC: wm8753: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: wm8753: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:20 ` [PATCH 34/42] ASoC: wm8961: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:31   ` Applied "ASoC: wm8961: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:20 ` [PATCH 35/42] ASoC: wm8962: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:30   ` Applied "ASoC: wm8962: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:20 ` [PATCH 36/42] ASoC: wm8990: Don't use range container for TLV with one entry Lars-Peter Clausen
2015-08-05 12:30   ` Applied "ASoC: wm8990: Don't use range container for TLV with one entry" to the asoc tree Mark Brown
2015-08-02 15:20 ` [PATCH 37/42] ASoC: wm8991: Don't use range container for TLVs with one entry Lars-Peter Clausen
2015-08-05 12:30   ` Applied "ASoC: wm8991: Don't use range container for TLVs with one entry" to the asoc tree Mark Brown
2015-08-02 15:20 ` [PATCH 38/42] ASoC: wm8993: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:30   ` Applied "ASoC: wm8993: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:20 ` [PATCH 39/42] ASoC: wm9081: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:30   ` Applied "ASoC: wm9081: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:20 ` [PATCH 40/42] ASoC: wm9090: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:30   ` Applied "ASoC: wm9090: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:20 ` [PATCH 41/42] ASoC: wm9713: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:30   ` Applied "ASoC: wm9713: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-02 15:20 ` [PATCH 42/42] ASoC: wm_hubs: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-05 12:30   ` Applied "ASoC: wm_hubs: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE" to the asoc tree Mark Brown
2015-08-03 12:03 ` [PATCH 00/42] ASoC: Replace users of TLV_DB_RANGE_HEAD Brian Austin
2015-08-07  8:26 ` Charles Keepax

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438528810-23498-12-git-send-email-lars@metafoo.de \
    --to=lars@metafoo.de \
    --cc=Paul.Handrigan@cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bardliao@realtek.com \
    --cc=brian.austin@cirrus.com \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.wolfsonmicro.com \
    --cc=lgirdwood@gmail.com \
    --cc=oder_chiou@realtek.com \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=support.opensource@diasemi.com \
    --cc=yesanishhere@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.