All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/16] ASoC: core: Add multi reg control struct & macros
@ 2012-03-13 15:11 Ola Lilja
  2012-03-13 15:11 ` [PATCH 02/16] ASoC: core: Add 8bit multi reg control accessors Ola Lilja
                   ` (15 more replies)
  0 siblings, 16 replies; 51+ messages in thread
From: Ola Lilja @ 2012-03-13 15:11 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, alsa-devel; +Cc: Linus Walleij, Kristoffer KARLSSON

From: Kristoffer KARLSSON <kristoffer.karlsson@stericsson.com>

Add support for controls that exposes a single signed value
while spanning multiple codec registers in a MSB/LSB manner.

Definition of a generic control struct added.

soc_mreg_control

Also four generic convenience macros added:

SOC_SINGLE_VALUE_S1R  One control value spans one register
SOC_SINGLE_VALUE_S2R  One control value spans two registers
SOC_SINGLE_VALUE_S4R  One control value spans four registers
SOC_SINGLE_VALUE_S8R  One control value spans eight registers

Signed-off-by: Kristoffer KARLSSON <kristoffer.karlsson@stericsson.com>
---
 include/sound/soc.h |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 0992dff..dac20e0 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -185,6 +185,29 @@
 		 .rreg = xreg_right, .shift = xshift, \
 		 .min = xmin, .max = xmax} }
 
+#define SOC_SINGLE_VALUE_S1R(xreg0, xcount, xmin, xmax, xinvert) \
+	((unsigned long)&(struct soc_mreg_control) \
+	{ .reg = ((unsigned int[]){ xreg0 }), \
+	.rcount = 1, .count = xcount, \
+	.invert = xinvert, .min = xmin, .max = xmax})
+#define SOC_SINGLE_VALUE_S2R(xreg0, xreg1, xcount, xmin, xmax, xinvert) \
+	((unsigned long)&(struct soc_mreg_control) \
+	{.reg = ((unsigned int[]){ xreg0, xreg1 }), \
+	.rcount = 2, .count = xcount, \
+	.min = xmin, .max = xmax, .invert = xinvert})
+#define SOC_SINGLE_VALUE_S4R(xreg0, xreg1, xreg2, xreg3, \
+	xcount, xmin, xmax, xinvert) \
+	((unsigned long)&(struct soc_mreg_control) \
+	{.reg = ((unsigned int[]){ xreg0, xreg1, xreg2, xreg3 }), \
+	.rcount = 4, .count = xcount,  \
+	.min = xmin, .max = xmax, .invert = xinvert})
+#define SOC_SINGLE_VALUE_S8R(xreg0, xreg1, xreg2, xreg3, xreg4, \
+		xreg5, xreg6, xreg7, xcount, xmin, xmax, xinvert) \
+	((unsigned long)&(struct soc_mreg_control) \
+	{.reg = ((unsigned int[]){ xreg0, xreg1, xreg2, xreg3, \
+			xreg4, xreg5, xreg6, xreg7 }), \
+	.rcount = 8, .count = xcount, \
+	.min = xmin, .max = xmax, .invert = xinvert})
 
 /*
  * Simplified versions of above macros, declaring a struct and calculating
@@ -875,6 +898,13 @@ struct soc_mixer_control {
 	unsigned int reg, rreg, shift, rshift, invert;
 };
 
+/* multi register control */
+struct soc_mreg_control {
+	long min, max;
+	unsigned int rcount, count, invert;
+	unsigned int *reg;
+};
+
 /* enumerated kcontrol */
 struct soc_enum {
 	unsigned short reg;
-- 
1.7.8.3

^ permalink raw reply related	[flat|nested] 51+ messages in thread

end of thread, other threads:[~2012-03-22 17:28 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-13 15:11 [PATCH 01/16] ASoC: core: Add multi reg control struct & macros Ola Lilja
2012-03-13 15:11 ` [PATCH 02/16] ASoC: core: Add 8bit multi reg control accessors Ola Lilja
2012-03-13 21:25   ` Mark Brown
2012-03-22 16:58     ` Kristoffer KARLSSON
2012-03-22 17:02       ` Mark Brown
2012-03-13 15:11 ` [PATCH 03/16] ASoC: core: Add range of " Ola Lilja
2012-03-13 21:23   ` Mark Brown
2012-03-13 15:11 ` [PATCH 04/16] ASoC: core: Add info accessor for mreg control Ola Lilja
2012-03-13 15:11 ` [PATCH 05/16] ASoC: core: Add strobe control Ola Lilja
2012-03-13 21:33   ` Mark Brown
2012-03-22 16:20     ` Kristoffer KARLSSON
2012-03-22 16:33       ` Mark Brown
2012-03-22 17:09         ` Kristoffer KARLSSON
2012-03-22 17:28           ` Mark Brown
2012-03-13 15:11 ` [PATCH 06/16] ASoC: core: Add macros for 8bit hwdep multi reg cntrl Ola Lilja
2012-03-13 21:36   ` Mark Brown
2012-03-13 15:11 ` [PATCH 07/16] ASoC: core: Add macro for hwdep range of regs control Ola Lilja
2012-03-13 15:11 ` [PATCH 08/16] ARM: ux500: Add DMA-channels for MSP Ola Lilja
2012-03-13 15:11 ` [PATCH 09/16] arm: ux500: Add audio-regulators Ola Lilja
2012-03-14 10:42   ` Linus Walleij
2012-03-13 15:11 ` [PATCH 10/16] arm: ux500: Add support for MSP I2S-devices Ola Lilja
2012-03-13 21:40   ` Mark Brown
2012-03-14  9:39     ` Linus Walleij
2012-03-14 11:44       ` Mark Brown
2012-03-13 15:11 ` [PATCH 11/16] ARM: ux500: Add placeholder for clk_set_parent Ola Lilja
2012-03-14 10:43   ` Linus Walleij
2012-03-13 15:11 ` [PATCH 14/16] ASoC: Ux500: Add platform-driver Ola Lilja
2012-03-13 22:48   ` Mark Brown
2012-03-14 10:50     ` Linus Walleij
2012-03-14 12:31       ` Mark Brown
2012-03-13 15:11 ` [PATCH 15/16] ASoC: Ux500: Activate the Ux500 ASoC-driver Ola Lilja
2012-03-13 15:11 ` [PATCH 16/16] ASoC: Ux500: Add machine-driver Ola Lilja
2012-03-13 23:03   ` Mark Brown
2012-03-13 21:39 ` [PATCH 01/16] ASoC: core: Add multi reg control struct & macros Mark Brown
2012-03-21 12:07   ` Kristoffer KARLSSON
2012-03-21 12:40     ` Mark Brown
2012-03-22 15:46       ` Kristoffer KARLSSON
2012-03-22 15:56         ` Mark Brown
     [not found] ` <1331651503-16917-13-git-send-email-ola.o.lilja@stericsson.com>
2012-03-13 22:11   ` [PATCH 12/16] ASoC: Ux500: Add MSP I2S-driver Mark Brown
     [not found] ` <1331651503-16917-14-git-send-email-ola.o.lilja@stericsson.com>
2012-03-13 22:45   ` [PATCH 13/16] ASoC: codecs: Add AB8500 codec-driver Mark Brown
2012-03-14 13:27     ` Ola LILJA2
2012-03-14 13:45       ` Mark Brown
2012-03-15 14:50         ` Ola Lilja
2012-03-15 15:29           ` Mark Brown
2012-03-16 13:09             ` Ola Lilja
2012-03-17 22:31               ` Mark Brown
2012-03-19  8:07                 ` Ola Lilja
2012-03-19  8:23                   ` Linus Walleij
2012-03-19 12:09                   ` Mark Brown
2012-03-19 14:54                     ` Ola Lilja
2012-03-19 15:43                       ` Mark Brown

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.