aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/omap-mcbsp.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2012-08-22 06:11:43 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-08-25 16:30:27 -0400
commitdb61550931957ee6c7dba751662919424b4344f3 (patch)
tree53c9963ac18d67185fbd5ac70726072e1c2dc0b4 /sound/soc/omap/omap-mcbsp.c
parent8996a31c58374742dfb555675a8569617572d82c (diff)
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: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/omap/omap-mcbsp.c')
-rw-r--r--sound/soc/omap/omap-mcbsp.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index 1b9f5ebba44f..9dff177cd4e2 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -619,9 +619,9 @@ static int omap_mcbsp_st_info_volsw(struct snd_kcontrol *kcontrol,
619 return 0; 619 return 0;
620} 620}
621 621
622#define OMAP_MCBSP_ST_SET_CHANNEL_VOLUME(channel) \ 622#define OMAP_MCBSP_ST_CHANNEL_VOLUME(channel) \
623static int \ 623static int \
624omap_mcbsp_set_st_ch##channel##_volume(struct snd_kcontrol *kc, \ 624omap_mcbsp_set_st_ch##channel##_volume(struct snd_kcontrol *kc, \
625 struct snd_ctl_elem_value *uc) \ 625 struct snd_ctl_elem_value *uc) \
626{ \ 626{ \
627 struct snd_soc_dai *cpu_dai = snd_kcontrol_chip(kc); \ 627 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, \
637 \ 637 \
638 /* OMAP McBSP implementation uses index values 0..4 */ \ 638 /* OMAP McBSP implementation uses index values 0..4 */ \
639 return omap_st_set_chgain(mcbsp, channel, val); \ 639 return omap_st_set_chgain(mcbsp, channel, val); \
640} 640} \
641 641 \
642#define OMAP_MCBSP_ST_GET_CHANNEL_VOLUME(channel) \
643static int \ 642static int \
644omap_mcbsp_get_st_ch##channel##_volume(struct snd_kcontrol *kc, \ 643omap_mcbsp_get_st_ch##channel##_volume(struct snd_kcontrol *kc, \
645 struct snd_ctl_elem_value *uc) \ 644 struct snd_ctl_elem_value *uc) \
646{ \ 645{ \
647 struct snd_soc_dai *cpu_dai = snd_kcontrol_chip(kc); \ 646 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, \
655 return 0; \ 654 return 0; \
656} 655}
657 656
658OMAP_MCBSP_ST_SET_CHANNEL_VOLUME(0) 657OMAP_MCBSP_ST_CHANNEL_VOLUME(0)
659OMAP_MCBSP_ST_SET_CHANNEL_VOLUME(1) 658OMAP_MCBSP_ST_CHANNEL_VOLUME(1)
660OMAP_MCBSP_ST_GET_CHANNEL_VOLUME(0)
661OMAP_MCBSP_ST_GET_CHANNEL_VOLUME(1)
662 659
663static int omap_mcbsp_st_put_mode(struct snd_kcontrol *kcontrol, 660static int omap_mcbsp_st_put_mode(struct snd_kcontrol *kcontrol,
664 struct snd_ctl_elem_value *ucontrol) 661 struct snd_ctl_elem_value *ucontrol)