ASoC: omap-mcbsp: Single macro for st channel volume set/get
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Wed, 22 Aug 2012 10:11:43 +0000 (13:11 +0300)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 25 Aug 2012 20:30:27 +0000 (13:30 -0700)
Since we always need to have set and get callbacks for McBSP sidetone it
makes sense to combine the two macro to create the two callbacks.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/omap/omap-mcbsp.c

index 1b9f5ebba44fd7eccbc2a292f767c2b302864341..9dff177cd4e2b4c2cef1281fba92bd70f2708be3 100644 (file)
@@ -619,9 +619,9 @@ static int omap_mcbsp_st_info_volsw(struct snd_kcontrol *kcontrol,
        return 0;
 }
 
-#define OMAP_MCBSP_ST_SET_CHANNEL_VOLUME(channel)                      \
+#define OMAP_MCBSP_ST_CHANNEL_VOLUME(channel)                          \
 static int                                                             \
-omap_mcbsp_set_st_ch##channel##_volume(struct snd_kcontrol *kc,        \
+omap_mcbsp_set_st_ch##channel##_volume(struct snd_kcontrol *kc,                \
                                        struct snd_ctl_elem_value *uc)  \
 {                                                                      \
        struct snd_soc_dai *cpu_dai = snd_kcontrol_chip(kc);            \
@@ -637,11 +637,10 @@ omap_mcbsp_set_st_ch##channel##_volume(struct snd_kcontrol *kc,   \
                                                                        \
        /* OMAP McBSP implementation uses index values 0..4 */          \
        return omap_st_set_chgain(mcbsp, channel, val);                 \
-}
-
-#define OMAP_MCBSP_ST_GET_CHANNEL_VOLUME(channel)                      \
+}                                                                      \
+                                                                       \
 static int                                                             \
-omap_mcbsp_get_st_ch##channel##_volume(struct snd_kcontrol *kc,        \
+omap_mcbsp_get_st_ch##channel##_volume(struct snd_kcontrol *kc,                \
                                        struct snd_ctl_elem_value *uc)  \
 {                                                                      \
        struct snd_soc_dai *cpu_dai = snd_kcontrol_chip(kc);            \
@@ -655,10 +654,8 @@ omap_mcbsp_get_st_ch##channel##_volume(struct snd_kcontrol *kc,    \
        return 0;                                                       \
 }
 
-OMAP_MCBSP_ST_SET_CHANNEL_VOLUME(0)
-OMAP_MCBSP_ST_SET_CHANNEL_VOLUME(1)
-OMAP_MCBSP_ST_GET_CHANNEL_VOLUME(0)
-OMAP_MCBSP_ST_GET_CHANNEL_VOLUME(1)
+OMAP_MCBSP_ST_CHANNEL_VOLUME(0)
+OMAP_MCBSP_ST_CHANNEL_VOLUME(1)
 
 static int omap_mcbsp_st_put_mode(struct snd_kcontrol *kcontrol,
                                struct snd_ctl_elem_value *ucontrol)