alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: broonie@kernel.org
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
	lgirdwood@gmail.com
Subject: [PATCH 3/4] ASoC: Add SOC_SINGLE_RANGE_EXT_TLV macro
Date: Wed, 16 Sep 2015 13:59:42 +0100	[thread overview]
Message-ID: <1442408383-31682-3-git-send-email-ckeepax@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1442408383-31682-1-git-send-email-ckeepax@opensource.wolfsonmicro.com>

Add a version of the SOC_SINGLE_RANGE_TLV macro that allows a custom get
and put to be specified.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
 include/sound/soc.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 884e728..9ffa285 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -226,6 +226,18 @@
 	.info = snd_soc_info_volsw, \
 	.get = xhandler_get, .put = xhandler_put, \
 	.private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, 0) }
+#define SOC_SINGLE_RANGE_EXT_TLV(xname, xreg, xshift, xmin, xmax, xinvert, \
+				 xhandler_get, xhandler_put, tlv_array) \
+{	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
+	.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
+		 SNDRV_CTL_ELEM_ACCESS_READWRITE,\
+	.tlv.p = (tlv_array), \
+	.info = snd_soc_info_volsw_range, \
+	.get = xhandler_get, .put = xhandler_put, \
+	.private_value = (unsigned long)&(struct soc_mixer_control) \
+		{.reg = xreg, .rreg = xreg, .shift = xshift, \
+		 .rshift = xshift, .min = xmin, .max = xmax, \
+		 .platform_max = xmax, .invert = xinvert} }
 #define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\
 	 xhandler_get, xhandler_put, tlv_array) \
 {	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
-- 
1.7.2.5

  parent reply	other threads:[~2015-09-16 13:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-16 12:59 [PATCH 1/4] ASoC: arizona: Add default cases for event switches Charles Keepax
2015-09-16 12:59 ` [PATCH 2/4] ASoC: arizona: Add utility function to check if an input is analog Charles Keepax
2015-09-16 20:01   ` Applied "ASoC: arizona: Add utility function to check if an input is analog" to the asoc tree Mark Brown
2015-09-16 12:59 ` Charles Keepax [this message]
2015-09-16 20:01   ` Applied "ASoC: Add SOC_SINGLE_RANGE_EXT_TLV macro" " Mark Brown
2015-09-16 12:59 ` [PATCH 4/4] ASoC: wm5110: Add additional analogue input enable for early revs Charles Keepax
2015-09-16 20:02   ` Mark Brown
2015-09-17  8:10     ` Charles Keepax
2015-09-16 20:01 ` Applied "ASoC: arizona: Add default cases for event switches" to the asoc tree Mark Brown

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=1442408383-31682-3-git-send-email-ckeepax@opensource.wolfsonmicro.com \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=patches@opensource.wolfsonmicro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).