From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>,
Liam Girdwood <lrg@ti.com>
Cc: alsa-devel@alsa-project.org, Jarkko Nikula <jarkko.nikula@bitmer.com>
Subject: Re: [PATCH 3/3] ASoC: omap-mcbsp: Use macro to create the McBSP2/3 ST controls
Date: Tue, 21 Aug 2012 17:46:56 +0300 [thread overview]
Message-ID: <50339F60.6030102@ti.com> (raw)
In-Reply-To: <1345560123-23959-4-git-send-email-peter.ujfalusi@ti.com>
Hi,
On 08/21/2012 05:42 PM, Peter Ujfalusi wrote:
> To remove duplicated code from the driver.
>
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
> 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 c964f68..be52f26 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,
> return 0;
> }
>
> -static const struct snd_kcontrol_new omap_mcbsp2_st_controls[] = {
> - SOC_SINGLE_EXT("McBSP2 Sidetone Switch", 1, 0, 1, 0,
> - omap_mcbsp_st_get_mode, omap_mcbsp_st_put_mode),
> - OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP2 Sidetone Channel 0 Volume",
> - -32768, 32767,
> - omap_mcbsp_get_st_ch0_volume,
> - omap_mcbsp_set_st_ch0_volume),
> - OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP2 Sidetone Channel 1 Volume",
> - -32768, 32767,
> - omap_mcbsp_get_st_ch1_volume,
> - omap_mcbsp_set_st_ch1_volume),
> -};
> +#define OMAP_MCBSP_ST_CONTROLS(port) \
> +static const struct snd_kcontrol_new omap_mcbsp##port##_st_controls[] = { \
> +SOC_SINGLE_EXT("McBSP##port## Sidetone Switch", 1, 0, 1, 0, \
> + omap_mcbsp_st_get_mode, omap_mcbsp_st_put_mode), \
> +OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP##port## Sidetone Channel 0 Volume", \
> + -32768, 32767, \
> + omap_mcbsp_get_st_ch0_volume, \
> + omap_mcbsp_set_st_ch0_volume), \
> +OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP##port## Sidetone Channel 1 Volume", \
> + -32768, 32767, \
> + omap_mcbsp_get_st_ch1_volume, \
> + omap_mcbsp_set_st_ch1_volume), \
> +}
This macro does not work correctly, I get this:
amixer | grep McBSP
Simple mixer control 'McBSP##port## Sidetone',0
Simple mixer control 'McBSP##port## Sidetone Channel 0',0
Simple mixer control 'McBSP##port## Sidetone Channel 1',0
as control names...
Please ignore this patch, I'll fix it or drop this.
>
> -static const struct snd_kcontrol_new omap_mcbsp3_st_controls[] = {
> - SOC_SINGLE_EXT("McBSP3 Sidetone Switch", 2, 0, 1, 0,
> - omap_mcbsp_st_get_mode, omap_mcbsp_st_put_mode),
> - OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP3 Sidetone Channel 0 Volume",
> - -32768, 32767,
> - omap_mcbsp_get_st_ch0_volume,
> - omap_mcbsp_set_st_ch0_volume),
> - OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP3 Sidetone Channel 1 Volume",
> - -32768, 32767,
> - omap_mcbsp_get_st_ch1_volume,
> - omap_mcbsp_set_st_ch1_volume),
> -};
> +OMAP_MCBSP_ST_CONTROLS(2);
> +OMAP_MCBSP_ST_CONTROLS(3);
>
> int omap_mcbsp_st_add_controls(struct snd_soc_pcm_runtime *rtd)
> {
>
--
Péter
prev parent reply other threads:[~2012-08-21 14:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-21 14:42 [PATCH 0/3] ASoC: omap-mcbsp: Sidetone related changes Peter Ujfalusi
2012-08-21 14:42 ` [PATCH 1/3] ASoC: omap-mcbsp: Check mcbsp->id instead of cpu_dai->id when adding ST controls Peter Ujfalusi
2012-08-21 14:42 ` [PATCH 2/3] ASoC: omap-mcbsp: Only print warning if the st_data is missing for the port Peter Ujfalusi
2012-08-21 14:42 ` [PATCH 3/3] ASoC: omap-mcbsp: Use macro to create the McBSP2/3 ST controls Peter Ujfalusi
2012-08-21 14:46 ` Peter Ujfalusi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50339F60.6030102@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=jarkko.nikula@bitmer.com \
--cc=lrg@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.