Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db615509 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown
Browse files

ASoC: omap-mcbsp: Single macro for st channel volume set/get



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: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 8996a31c
Loading
Loading
Loading
Loading
+7 −10
Original line number Original line Diff line number Diff line
@@ -619,7 +619,7 @@ static int omap_mcbsp_st_info_volsw(struct snd_kcontrol *kcontrol,
	return 0;
	return 0;
}
}


#define OMAP_MCBSP_ST_SET_CHANNEL_VOLUME(channel)			\
#define OMAP_MCBSP_ST_CHANNEL_VOLUME(channel)				\
static int								\
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_ctl_elem_value *uc)	\
@@ -637,9 +637,8 @@ omap_mcbsp_set_st_ch##channel##_volume(struct snd_kcontrol *kc, \
									\
									\
	/* OMAP McBSP implementation uses index values 0..4 */		\
	/* OMAP McBSP implementation uses index values 0..4 */		\
	return omap_st_set_chgain(mcbsp, channel, val);			\
	return omap_st_set_chgain(mcbsp, channel, val);			\
}
}									\

									\
#define OMAP_MCBSP_ST_GET_CHANNEL_VOLUME(channel)			\
static int								\
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_ctl_elem_value *uc)	\
@@ -655,10 +654,8 @@ omap_mcbsp_get_st_ch##channel##_volume(struct snd_kcontrol *kc, \
	return 0;							\
	return 0;							\
}
}


OMAP_MCBSP_ST_SET_CHANNEL_VOLUME(0)
OMAP_MCBSP_ST_CHANNEL_VOLUME(0)
OMAP_MCBSP_ST_SET_CHANNEL_VOLUME(1)
OMAP_MCBSP_ST_CHANNEL_VOLUME(1)
OMAP_MCBSP_ST_GET_CHANNEL_VOLUME(0)
OMAP_MCBSP_ST_GET_CHANNEL_VOLUME(1)


static int omap_mcbsp_st_put_mode(struct snd_kcontrol *kcontrol,
static int omap_mcbsp_st_put_mode(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
				struct snd_ctl_elem_value *ucontrol)