diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-08-22 06:11:43 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-08-25 16:30:27 -0400 |
commit | db61550931957ee6c7dba751662919424b4344f3 (patch) | |
tree | 53c9963ac18d67185fbd5ac70726072e1c2dc0b4 | |
parent | 8996a31c58374742dfb555675a8569617572d82c (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>
-rw-r--r-- | sound/soc/omap/omap-mcbsp.c | 17 |
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) \ |
623 | static int \ | 623 | static int \ |
624 | omap_mcbsp_set_st_ch##channel##_volume(struct snd_kcontrol *kc, \ | 624 | omap_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) \ | ||
643 | static int \ | 642 | static int \ |
644 | omap_mcbsp_get_st_ch##channel##_volume(struct snd_kcontrol *kc, \ | 643 | omap_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 | ||
658 | OMAP_MCBSP_ST_SET_CHANNEL_VOLUME(0) | 657 | OMAP_MCBSP_ST_CHANNEL_VOLUME(0) |
659 | OMAP_MCBSP_ST_SET_CHANNEL_VOLUME(1) | 658 | OMAP_MCBSP_ST_CHANNEL_VOLUME(1) |
660 | OMAP_MCBSP_ST_GET_CHANNEL_VOLUME(0) | ||
661 | OMAP_MCBSP_ST_GET_CHANNEL_VOLUME(1) | ||
662 | 659 | ||
663 | static int omap_mcbsp_st_put_mode(struct snd_kcontrol *kcontrol, | 660 | static int omap_mcbsp_st_put_mode(struct snd_kcontrol *kcontrol, |
664 | struct snd_ctl_elem_value *ucontrol) | 661 | struct snd_ctl_elem_value *ucontrol) |