aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2012-08-22 06:11:42 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-08-25 16:30:23 -0400
commit8996a31c58374742dfb555675a8569617572d82c (patch)
tree49dbf5197840527d9e0fb3b9629f0f2abfb9bc86 /sound
parent8a88df4cda5eaed97e027f9c9e76012a7113bf9a (diff)
ASoC: omap-mcbsp: Use macro to create the McBSP2/3 ST controls
To remove duplicated code from the driver. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/omap/omap-mcbsp.c39
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
691static 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, 692static const struct snd_kcontrol_new omap_mcbsp##port##_st_controls[] = { \
693 omap_mcbsp_st_get_mode, omap_mcbsp_st_put_mode), 693SOC_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, 695OMAP_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, 699OMAP_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
704static const struct snd_kcontrol_new omap_mcbsp3_st_controls[] = { 705OMAP_MCBSP_ST_CONTROLS(2);
705 SOC_SINGLE_EXT("McBSP3 Sidetone Switch", 2, 0, 1, 0, 706OMAP_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
717int omap_mcbsp_st_add_controls(struct snd_soc_pcm_runtime *rtd) 708int omap_mcbsp_st_add_controls(struct snd_soc_pcm_runtime *rtd)
718{ 709{