alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Liam Girdwood <lrg@slimlogic.co.uk>
To: Ilkka Koskinen <ilkka.koskinen@nokia.com>
Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
	peter.ujfalusi@nokia.com, jhnikula@gmail.com,
	broonie@opensource.wolfsonmicro.com, tony@atomide.com,
	eduardo.valentin@nokia.com, ext-eero.nurkkala@nokia.com
Subject: Re: [alsa-devel] [PATCH 2/2] ASoC: OMAP-McBSP: ASoC interface for McBSP sidetone
Date: Thu, 28 Jan 2010 16:21:43 +0000	[thread overview]
Message-ID: <1264695703.3044.244.camel@odin> (raw)
In-Reply-To: <1264693587-4764-3-git-send-email-ilkka.koskinen@nokia.com>

On Thu, 2010-01-28 at 17:46 +0200, Ilkka Koskinen wrote:
> Add ASoC interface for OMAP McBSP2 and McBSP3 sidetones.
> 
> Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
> ---
>  sound/soc/omap/omap-mcbsp.c |  187 +++++++++++++++++++++++++++++++++++++++++++
>  sound/soc/omap/omap-mcbsp.h |    2 +
>  2 files changed, 189 insertions(+), 0 deletions(-)
> 
> diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
> index 6bbbd2a..295620b 100644
> --- a/sound/soc/omap/omap-mcbsp.c
> +++ b/sound/soc/omap/omap-mcbsp.c
> @@ -39,6 +39,14 @@

snip

> +/* McBSP Sidetone Switch */
> +static const char *omap_mcbsp_st_status[] = {
> +	"off",
> +	"on",
> +};
> +

Should this not be a switch (like a mute switch) rather than an enum
kcontrol ?

> +static const struct soc_enum omap_mcbsp_st_status_enum[] = {
> +	SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(omap_mcbsp_st_status),
> +			    omap_mcbsp_st_status),
> +};
> +
> +static const struct snd_kcontrol_new omap_mcbsp2_st_controls[] = {
> +	SOC_ENUM_EXT("McBSP2 Sidetone Switch", omap_mcbsp_st_status_enum[0],
> +			omap_mcbsp2_st_get_mode, omap_mcbsp2_st_set_mode),
> +	OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP2 Sidetone Channel 0 Volume",
> +				      -32768, 32767,
> +				      omap_mcbsp2_get_st_ch0_volume,
> +				      omap_mcbsp2_set_st_ch0_volume),
> +	OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP2 Sidetone Channel 1 Volume",
> +				      -32768, 32767,
> +				      omap_mcbsp2_get_st_ch1_volume,
> +				      omap_mcbsp2_set_st_ch1_volume),
> +};
> +
> +static const struct snd_kcontrol_new omap_mcbsp3_st_controls[] = {
> +	SOC_ENUM_EXT("McBSP3 Sidetone Switch", omap_mcbsp_st_status_enum[0],
> +			omap_mcbsp3_st_get_mode, omap_mcbsp3_st_set_mode),
> +	OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP3 Sidetone Channel 0 Volume",
> +				      -32768, 32767,
> +				      omap_mcbsp3_get_st_ch0_volume,
> +				      omap_mcbsp3_set_st_ch0_volume),
> +	OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP3 Sidetone Channel 1 Volume",
> +				      -32768, 32767,
> +				      omap_mcbsp3_get_st_ch1_volume,
> +				      omap_mcbsp3_set_st_ch1_volume),
> +};
> +
> +int omap_mcbsp_st_add_controls(struct snd_soc_codec *codec, int mcbsp_id)
> +{
> +	if (!cpu_is_omap34xx())
> +		return -ENODEV;
> +
> +	switch (mcbsp_id) {
> +	case 2: /* McBSP 2 */
> +		return snd_soc_add_controls(codec, omap_mcbsp2_st_controls,
> +					ARRAY_SIZE(omap_mcbsp2_st_controls));
> +	case 3: /* McBSP 3 */
> +		return snd_soc_add_controls(codec, omap_mcbsp3_st_controls,
> +					ARRAY_SIZE(omap_mcbsp3_st_controls));
> +	default:
> +		break;
> +	}
> +
> +	return -1;

-EINVAL;

> +}
> +EXPORT_SYMBOL_GPL(omap_mcbsp_st_add_controls);
> +
>  static int __init snd_omap_mcbsp_init(void)
>  {
>  	return snd_soc_register_dais(omap_mcbsp_dai,
> diff --git a/sound/soc/omap/omap-mcbsp.h b/sound/soc/omap/omap-mcbsp.h
> index 647d2f9..7537435 100644
> --- a/sound/soc/omap/omap-mcbsp.h
> +++ b/sound/soc/omap/omap-mcbsp.h
> @@ -57,4 +57,6 @@ enum omap_mcbsp_div {
>  
>  extern struct snd_soc_dai omap_mcbsp_dai[NUM_LINKS];
>  
> +int omap_mcbsp_st_add_controls(struct snd_soc_codec *codec, int mcbsp_id);
> +
>  #endif



  reply	other threads:[~2010-01-28 16:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-28 15:46 [PATCH 0/2] McBSP: OMAP3: Add sidetone feature Ilkka Koskinen
2010-01-28 15:46 ` [PATCH 1/2] " Ilkka Koskinen
2010-01-28 15:46   ` [PATCH 2/2] ASoC: OMAP-McBSP: ASoC interface for McBSP sidetone Ilkka Koskinen
2010-01-28 16:21     ` Liam Girdwood [this message]
2010-01-29 12:06       ` ilkka.koskinen
2010-01-28 16:57 ` [PATCH 0/2] McBSP: OMAP3: Add sidetone feature Jarkko Nikula
2010-01-29 14:51   ` Ilkka Koskinen
2010-01-29 15:23     ` Jarkko Nikula

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=1264695703.3044.244.camel@odin \
    --to=lrg@slimlogic.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=eduardo.valentin@nokia.com \
    --cc=ext-eero.nurkkala@nokia.com \
    --cc=ilkka.koskinen@nokia.com \
    --cc=jhnikula@gmail.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=peter.ujfalusi@nokia.com \
    --cc=tony@atomide.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).