From: Peter Ujfalusi <peter.ujfalusi@nokia.com>
To: "Koskinen Ilkka (Nokia-D/Tampere)" <ilkka.koskinen@nokia.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"tony@atomide.com" <tony@atomide.com>,
"broonie@opensource.wolfsonmicro.com"
<broonie@opensource.wolfsonmicro.com>,
"Valentin Eduardo (Nokia-D/Helsinki)"
<eduardo.valentin@nokia.com>,
"Nurkkala Eero.An (EXT-Offcode/Oulu)"
<ext-Eero.Nurkkala@nokia.com>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCHv3 2/2] ASoC: OMAP-McBSP: ASoC interface for McBSP sidetone
Date: Thu, 18 Feb 2010 16:11:38 +0200 [thread overview]
Message-ID: <201002181611.38241.peter.ujfalusi@nokia.com> (raw)
In-Reply-To: <1266496635-31347-3-git-send-email-ilkka.koskinen@nokia.com>
On Thursday 18 February 2010 14:37:15 Koskinen Ilkka (Nokia-D/Tampere) wrote:
...
> +static int omap_mcbsp_set_st_channel_vol(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol,
> + int id, int channel)
> +{
> + struct soc_mixer_control *mc =
> + (struct soc_mixer_control *)kcontrol->private_value;
> + int max = mc->max;
> + int min = mc->min;
> + int val = ucontrol->value.integer.value[0];
> +
> + if (val < min || val > max)
> + return -EINVAL;
> +
> + return omap_st_set_chgain((id)-1, val, 0, channel);
So how do you actually set the ch1 gain to other than 0?
int omap_st_set_chgain(unsigned int id, s16 ch0gain, s16 ch1gain, int channels);
So in any cases you are calling with ch1gain = 0, and depending on the selected
channel you put that to ch0gain.
All in all, with this code you are only able to update ch0, and never the ch1.
Should than the omap_st_set_chgain have only one parameter for the gain, and the
channel parameter tells the code to which channel to put the gain?
> +}
> +
> +static int omap_mcbsp_get_st_channel_vol(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol,
> + int id, int channel)
> +{
> + s16 ch0gain, ch1gain;
> +
> + if (omap_st_get_chgain((id)-1, &ch0gain, &ch1gain))
> + return -EAGAIN;
Than probably the omap_st_get_chgain should only retrieve the gain for one
channel also?
> +
> + if (channel == OMAP_MCBSP_ST_CHANNEL_0)
> + ucontrol->value.integer.value[0] = ch0gain;
> + else if (channel == OMAP_MCBSP_ST_CHANNEL_1)
> + ucontrol->value.integer.value[0] = ch1gain;
> +
> + return 0;
> +}
> +
--
Péter
next prev parent reply other threads:[~2010-02-18 14:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-18 12:37 [PATCHv2 0/2] McBSP: OMAP3: Add sidetone feature Ilkka Koskinen
2010-02-18 12:37 ` [PATCHv3 1/2] " Ilkka Koskinen
2010-02-18 12:37 ` [PATCHv3 2/2] ASoC: OMAP-McBSP: ASoC interface for McBSP sidetone Ilkka Koskinen
2010-02-18 14:11 ` Peter Ujfalusi [this message]
2010-02-18 17:16 ` [alsa-devel] " Ilkka Koskinen
2010-02-18 13:24 ` [PATCHv3 1/2] McBSP: OMAP3: Add sidetone feature Jarkko Nikula
2010-02-18 13:56 ` Peter Ujfalusi
2010-02-18 15:41 ` [alsa-devel] " 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=201002181611.38241.peter.ujfalusi@nokia.com \
--to=peter.ujfalusi@nokia.com \
--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=linux-omap@vger.kernel.org \
--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