From dd7b10b30c40dddb9750926d78cfe89c0cd8434d Mon Sep 17 00:00:00 2001 From: Kristoffer KARLSSON Date: Fri, 20 Apr 2012 11:32:44 +0200 Subject: ASoC: core: Add strobe control Added support for a control that strobes a bit in a register to high then back to low (or the inverse). This is typically useful for hardware that requires strobing a singe bit to trigger some functionality and where exposing the bit in a normal single control would require the user to first manually set then again unset the bit again for the strobe to trigger. Added convenience macro. SOC_SINGLE_STROBE Added accessor implementations. snd_soc_get_strobe snd_soc_put_strobe Signed-off-by: Kristoffer KARLSSON Signed-off-by: Mark Brown --- include/sound/soc.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/sound') diff --git a/include/sound/soc.h b/include/sound/soc.h index c0656b771c38..1f38aa1653c8 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -219,6 +219,10 @@ {.regbase = xregbase, .regcount = xregcount, .nbits = xnbits, \ .invert = xinvert, .min = xmin, .max = xmax} } +#define SOC_SINGLE_STROBE(xname, xreg, xshift, xinvert) \ + SOC_SINGLE_EXT(xname, xreg, xshift, 1, xinvert, \ + snd_soc_get_strobe, snd_soc_put_strobe) + /* * Simplified versions of above macros, declaring a struct and calculating * ARRAY_SIZE internally @@ -461,6 +465,10 @@ int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); +int snd_soc_get_strobe(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol); +int snd_soc_put_strobe(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol); /** * struct snd_soc_reg_access - Describes whether a given register is -- cgit v1.2.3