diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/omap/omap-mcbsp.c | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index c1f466e1b8b6..1b9f5ebba44f 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c | |||
@@ -688,31 +688,22 @@ static int omap_mcbsp_st_get_mode(struct snd_kcontrol *kcontrol, | |||
688 | return 0; | 688 | return 0; |
689 | } | 689 | } |
690 | 690 | ||
691 | static const struct snd_kcontrol_new omap_mcbsp2_st_controls[] = { | 691 | #define OMAP_MCBSP_ST_CONTROLS(port) \ |
692 | SOC_SINGLE_EXT("McBSP2 Sidetone Switch", 1, 0, 1, 0, | 692 | static const struct snd_kcontrol_new omap_mcbsp##port##_st_controls[] = { \ |
693 | omap_mcbsp_st_get_mode, omap_mcbsp_st_put_mode), | 693 | SOC_SINGLE_EXT("McBSP" #port " Sidetone Switch", 1, 0, 1, 0, \ |
694 | OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP2 Sidetone Channel 0 Volume", | 694 | omap_mcbsp_st_get_mode, omap_mcbsp_st_put_mode), \ |
695 | -32768, 32767, | 695 | OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP" #port " Sidetone Channel 0 Volume", \ |
696 | omap_mcbsp_get_st_ch0_volume, | 696 | -32768, 32767, \ |
697 | omap_mcbsp_set_st_ch0_volume), | 697 | omap_mcbsp_get_st_ch0_volume, \ |
698 | OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP2 Sidetone Channel 1 Volume", | 698 | omap_mcbsp_set_st_ch0_volume), \ |
699 | -32768, 32767, | 699 | OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP" #port " Sidetone Channel 1 Volume", \ |
700 | omap_mcbsp_get_st_ch1_volume, | 700 | -32768, 32767, \ |
701 | omap_mcbsp_set_st_ch1_volume), | 701 | omap_mcbsp_get_st_ch1_volume, \ |
702 | }; | 702 | omap_mcbsp_set_st_ch1_volume), \ |
703 | } | ||
703 | 704 | ||
704 | static const struct snd_kcontrol_new omap_mcbsp3_st_controls[] = { | 705 | OMAP_MCBSP_ST_CONTROLS(2); |
705 | SOC_SINGLE_EXT("McBSP3 Sidetone Switch", 2, 0, 1, 0, | 706 | OMAP_MCBSP_ST_CONTROLS(3); |
706 | omap_mcbsp_st_get_mode, omap_mcbsp_st_put_mode), | ||
707 | OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP3 Sidetone Channel 0 Volume", | ||
708 | -32768, 32767, | ||
709 | omap_mcbsp_get_st_ch0_volume, | ||
710 | omap_mcbsp_set_st_ch0_volume), | ||
711 | OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP3 Sidetone Channel 1 Volume", | ||
712 | -32768, 32767, | ||
713 | omap_mcbsp_get_st_ch1_volume, | ||
714 | omap_mcbsp_set_st_ch1_volume), | ||
715 | }; | ||
716 | 707 | ||
717 | int omap_mcbsp_st_add_controls(struct snd_soc_pcm_runtime *rtd) | 708 | int omap_mcbsp_st_add_controls(struct snd_soc_pcm_runtime *rtd) |
718 | { | 709 | { |