From 186ab1f13c76b0a42545aef070d109b5b7c4d8c7 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Wed, 5 Oct 2011 10:29:22 +0300 Subject: [PATCH] --- yaml --- r: 270781 b: refs/heads/master c: 30d86ba47f79d566fffe9ba577caf247d06a3796 h: refs/heads/master i: 270779: ea082645c0d156f651b07fa5f4cf4a18cd0c03b5 v: v3 --- [refs] | 2 +- trunk/include/sound/soc.h | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index ad544a4f3ea9..d9b0e460e116 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 08a1ed76f5cf94bef07cb370b079760553a87b4b +refs/heads/master: 30d86ba47f79d566fffe9ba577caf247d06a3796 diff --git a/trunk/include/sound/soc.h b/trunk/include/sound/soc.h index 8ab1cfed1067..88ff2d899a4d 100644 --- a/trunk/include/sound/soc.h +++ b/trunk/include/sound/soc.h @@ -30,8 +30,9 @@ */ #define SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, xmax, xinvert) \ ((unsigned long)&(struct soc_mixer_control) \ - {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ - .max = xmax, .platform_max = xmax, .invert = xinvert}) + {.reg = xreg, .rreg = xreg, .shift = shift_left, \ + .rshift = shift_right, .max = xmax, .platform_max = xmax, \ + .invert = xinvert}) #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ SOC_DOUBLE_VALUE(xreg, xshift, xshift, xmax, xinvert) #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ @@ -947,6 +948,18 @@ static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card) INIT_LIST_HEAD(&card->dapm_list); } +static inline bool snd_soc_volsw_is_stereo(struct soc_mixer_control *mc) +{ + if (mc->reg == mc->rreg && mc->shift == mc->rshift) + return 0; + /* + * mc->reg == mc->rreg && mc->shift != mc->rshift, or + * mc->reg != mc->rreg means that the control is + * stereo (bits in one register or in two registers) + */ + return 1; +} + int snd_soc_util_init(void); void snd_soc_util_exit(void);