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 37/42] ASoC: wm8991: Don't use range container for TLVs with one entry
Date: Sun,  2 Aug 2015 17:20:05 +0200	[thread overview]
Message-ID: <1438528810-23498-38-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1438528810-23498-1-git-send-email-lars@metafoo.de>

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

diff --git a/sound/soc/codecs/wm8991.c b/sound/soc/codecs/wm8991.c
index 709d16e..c9ee0ac 100644
--- a/sound/soc/codecs/wm8991.c
+++ b/sound/soc/codecs/wm8991.c
@@ -111,45 +111,14 @@ static bool wm8991_volatile(struct device *dev, unsigned int reg)
 	}
 }
 
-static const unsigned int rec_mix_tlv[] = {
-	TLV_DB_RANGE_HEAD(1),
-	0, 7, TLV_DB_LINEAR_ITEM(-1500, 600),
-};
-
-static const unsigned int in_pga_tlv[] = {
-	TLV_DB_RANGE_HEAD(1),
-	0, 0x1F, TLV_DB_LINEAR_ITEM(-1650, 3000),
-};
-
-static const unsigned int out_mix_tlv[] = {
-	TLV_DB_RANGE_HEAD(1),
-	0, 7, TLV_DB_LINEAR_ITEM(0, -2100),
-};
-
-static const unsigned int out_pga_tlv[] = {
-	TLV_DB_RANGE_HEAD(1),
-	0, 127, TLV_DB_LINEAR_ITEM(-7300, 600),
-};
-
-static const unsigned int out_omix_tlv[] = {
-	TLV_DB_RANGE_HEAD(1),
-	0, 7, TLV_DB_LINEAR_ITEM(-600, 0),
-};
-
-static const unsigned int out_dac_tlv[] = {
-	TLV_DB_RANGE_HEAD(1),
-	0, 255, TLV_DB_LINEAR_ITEM(-7163, 0),
-};
-
-static const unsigned int in_adc_tlv[] = {
-	TLV_DB_RANGE_HEAD(1),
-	0, 255, TLV_DB_LINEAR_ITEM(-7163, 1763),
-};
-
-static const unsigned int out_sidetone_tlv[] = {
-	TLV_DB_RANGE_HEAD(1),
-	0, 31, TLV_DB_LINEAR_ITEM(-3600, 0),
-};
+static const DECLARE_TLV_DB_LINEAR(rec_mix_tlv, -1500, 600);
+static const DECLARE_TLV_DB_LINEAR(in_pga_tlv, -1650, 3000);
+static const DECLARE_TLV_DB_LINEAR(out_mix_tlv, 0, -2100);
+static const DECLARE_TLV_DB_LINEAR(out_pga_tlv, -7300, 600);
+static const DECLARE_TLV_DB_LINEAR(out_omix_tlv, -600, 0);
+static const DECLARE_TLV_DB_LINEAR(out_dac_tlv, -7163, 0);
+static const DECLARE_TLV_DB_LINEAR(in_adc_tlv, -7163, 1763);
+static const DECLARE_TLV_DB_LINEAR(out_sidetone_tlv, -3600, 0);
 
 static int wm899x_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,
 				      struct snd_ctl_elem_value *ucontrol)
@@ -429,10 +398,7 @@ static int outmixer_event(struct snd_soc_dapm_widget *w,
 }
 
 /* INMIX dB values */
-static const unsigned int in_mix_tlv[] = {
-	TLV_DB_RANGE_HEAD(1),
-	0, 7, TLV_DB_LINEAR_ITEM(-1200, 600),
-};
+static const DECLARE_TLV_DB_LINEAR(in_mix_tlv, -1200, 600);
 
 /* Left In PGA Connections */
 static const struct snd_kcontrol_new wm8991_dapm_lin12_pga_controls[] = {
-- 
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 ` [PATCH 11/42] ASoC: da9055: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE Lars-Peter Clausen
2015-08-03 14:47   ` 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 ` Lars-Peter Clausen [this message]
2015-08-05 12:30   ` Applied "ASoC: wm8991: Don't use range container for TLVs " 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-38-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.