diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2011-10-04 07:39:39 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-10-04 11:27:05 -0400 |
commit | cdffa775e72de3a3d3ddccd04eb4eb94d58e84e6 (patch) | |
tree | 6063cb34f85e1121715129d770611aa0f9acd525 /include/sound | |
parent | 460acbec1e7ba727519689902f51a6257279bbae (diff) |
ASoC: core: Introduce SOC_DOUBLE_R_VALUE macro
With the new macro we can remove duplicated code
for the SOC_DOUBLE_R type of controls.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/soc.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 3d7c7f7cda6c..9d0524a3a7f8 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -37,6 +37,10 @@ | |||
37 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ | 37 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ |
38 | ((unsigned long)&(struct soc_mixer_control) \ | 38 | ((unsigned long)&(struct soc_mixer_control) \ |
39 | {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert}) | 39 | {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert}) |
40 | #define SOC_DOUBLE_R_VALUE(xlreg, xrreg, xshift, xmax, xinvert) \ | ||
41 | ((unsigned long)&(struct soc_mixer_control) \ | ||
42 | {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ | ||
43 | .max = xmax, .platform_max = xmax, .invert = xinvert}) | ||
40 | #define SOC_SINGLE(xname, reg, shift, max, invert) \ | 44 | #define SOC_SINGLE(xname, reg, shift, max, invert) \ |
41 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 45 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
42 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ | 46 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ |
@@ -60,9 +64,8 @@ | |||
60 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 64 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
61 | .info = snd_soc_info_volsw_2r, \ | 65 | .info = snd_soc_info_volsw_2r, \ |
62 | .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ | 66 | .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ |
63 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 67 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ |
64 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | 68 | xmax, xinvert) } |
65 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
66 | #define SOC_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, tlv_array) \ | 69 | #define SOC_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, tlv_array) \ |
67 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 70 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
68 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | 71 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ |
@@ -79,9 +82,8 @@ | |||
79 | .tlv.p = (tlv_array), \ | 82 | .tlv.p = (tlv_array), \ |
80 | .info = snd_soc_info_volsw_2r, \ | 83 | .info = snd_soc_info_volsw_2r, \ |
81 | .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ | 84 | .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ |
82 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 85 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ |
83 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | 86 | xmax, xinvert) } |
84 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
85 | #define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ | 87 | #define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ |
86 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 88 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
87 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | 89 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ |
@@ -155,9 +157,8 @@ | |||
155 | .tlv.p = (tlv_array), \ | 157 | .tlv.p = (tlv_array), \ |
156 | .info = snd_soc_info_volsw_2r, \ | 158 | .info = snd_soc_info_volsw_2r, \ |
157 | .get = xhandler_get, .put = xhandler_put, \ | 159 | .get = xhandler_get, .put = xhandler_put, \ |
158 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 160 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ |
159 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | 161 | xmax, xinvert) } |
160 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
161 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ | 162 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ |
162 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 163 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
163 | .info = snd_soc_info_bool_ext, \ | 164 | .info = snd_soc_info_bool_ext, \ |