diff options
author | Kristoffer KARLSSON <kristoffer.karlsson@stericsson.com> | 2012-04-20 05:32:44 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-23 15:05:06 -0400 |
commit | dd7b10b30c40dddb9750926d78cfe89c0cd8434d (patch) | |
tree | 84084ba083aa317576dd37d62070fd160c6e07de /include/sound/soc.h | |
parent | 4183eed288f31c3b9142476915e842f879f36b8e (diff) |
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 <kristoffer.karlsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r-- | include/sound/soc.h | 8 |
1 files changed, 8 insertions, 0 deletions
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 @@ | |||
219 | {.regbase = xregbase, .regcount = xregcount, .nbits = xnbits, \ | 219 | {.regbase = xregbase, .regcount = xregcount, .nbits = xnbits, \ |
220 | .invert = xinvert, .min = xmin, .max = xmax} } | 220 | .invert = xinvert, .min = xmin, .max = xmax} } |
221 | 221 | ||
222 | #define SOC_SINGLE_STROBE(xname, xreg, xshift, xinvert) \ | ||
223 | SOC_SINGLE_EXT(xname, xreg, xshift, 1, xinvert, \ | ||
224 | snd_soc_get_strobe, snd_soc_put_strobe) | ||
225 | |||
222 | /* | 226 | /* |
223 | * Simplified versions of above macros, declaring a struct and calculating | 227 | * Simplified versions of above macros, declaring a struct and calculating |
224 | * ARRAY_SIZE internally | 228 | * ARRAY_SIZE internally |
@@ -461,6 +465,10 @@ int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol, | |||
461 | struct snd_ctl_elem_value *ucontrol); | 465 | struct snd_ctl_elem_value *ucontrol); |
462 | int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol, | 466 | int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol, |
463 | struct snd_ctl_elem_value *ucontrol); | 467 | struct snd_ctl_elem_value *ucontrol); |
468 | int snd_soc_get_strobe(struct snd_kcontrol *kcontrol, | ||
469 | struct snd_ctl_elem_value *ucontrol); | ||
470 | int snd_soc_put_strobe(struct snd_kcontrol *kcontrol, | ||
471 | struct snd_ctl_elem_value *ucontrol); | ||
464 | 472 | ||
465 | /** | 473 | /** |
466 | * struct snd_soc_reg_access - Describes whether a given register is | 474 | * struct snd_soc_reg_access - Describes whether a given register is |