diff mbox series

[1/2] ASoC: soc.h: Introduce SOC_DOUBLE_R_S_EXT_TLV() macro

Message ID 20220422160112.3026542-2-rf@opensource.cirrus.com
State Superseded
Headers show
Series ASoC: Add macros for signed TLV controls with callbacks | expand

Commit Message

Richard Fitzgerald April 22, 2022, 4:01 p.m. UTC
From: Simon Trimmer <simont@opensource.cirrus.com>

A straightforward extension of the SOC_DOUBLE_R_S_TLV() macro that
allows the get and put functions to be customised.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
---
 include/sound/soc.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Mark Brown April 25, 2022, 12:26 p.m. UTC | #1
On Fri, Apr 22, 2022 at 05:01:11PM +0100, Richard Fitzgerald wrote:
> From: Simon Trimmer <simont@opensource.cirrus.com>
> 
> A straightforward extension of the SOC_DOUBLE_R_S_TLV() macro that
> allows the get and put functions to be customised.
> 
> Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
> ---

You've not provided a Signed-off-by for this so I can't do anything with
it, please see Documentation/process/submitting-patches.rst for details
on what this is and why it's important.
Richard Fitzgerald April 25, 2022, 12:40 p.m. UTC | #2
On 25/04/2022 13:26, Mark Brown wrote:
> On Fri, Apr 22, 2022 at 05:01:11PM +0100, Richard Fitzgerald wrote:
>> From: Simon Trimmer <simont@opensource.cirrus.com>
>>
>> A straightforward extension of the SOC_DOUBLE_R_S_TLV() macro that
>> allows the get and put functions to be customised.
>>
>> Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
>> ---
> 
> You've not provided a Signed-off-by for this so I can't do anything with
> it, please see Documentation/process/submitting-patches.rst for details
> on what this is and why it's important.
> 
Damn, sorry. Would be nice if checkpatch warned about that.
diff mbox series

Patch

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 2d3261799d2c..8368b69dfef8 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -282,6 +282,17 @@ 
 	.get = xhandler_get, .put = xhandler_put, \
 	.private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \
 					    xmax, xinvert) }
+#define SOC_DOUBLE_R_S_EXT_TLV(xname, reg_left, reg_right, xshift, xmin, xmax, \
+			       xsign_bit, 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, \
+	.get = xhandler_get, .put = xhandler_put, \
+	.private_value = SOC_DOUBLE_R_S_VALUE(reg_left, reg_right, xshift, \
+					      xmin, xmax, xsign_bit, xinvert) }
 #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \
 {	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
 	.info = snd_soc_info_bool_ext, \