From: Lars-Peter Clausen <lars@metafoo.de>
To: Vinod Koul <vinod.koul@intel.com>
Cc: alsa-devel@alsa-project.org, broonie@kernel.org, lgirdwood@gmail.com
Subject: Re: [RFC 19/19] ASoC: Intel: mrfld: add the DSP mixers
Date: Sat, 14 Jun 2014 17:39:09 +0200 [thread overview]
Message-ID: <539C6C9D.6020004@metafoo.de> (raw)
In-Reply-To: <1402662848-24534-20-git-send-email-vinod.koul@intel.com>
On 06/13/2014 02:34 PM, Vinod Koul wrote:
> The is RFC patch for adding the platform mixer controls. This requires the
> dapm_set-get to be exported. Or changes required after component series is
> merged
You are not using dapm_kcontrol_get_value() in this patch and without that
calling dapm_kcontrol_set_value() is pretty pointless as the value is never
read again. But it is still a good idea to use the generic controls rather
than having a custom copy&pasted version.
>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> ---
> sound/soc/intel/sst-atom-controls.c | 67 +++++++++++++++++++++++++++++++++++
> 1 files changed, 67 insertions(+), 0 deletions(-)
>
> diff --git a/sound/soc/intel/sst-atom-controls.c b/sound/soc/intel/sst-atom-controls.c
> index 2e733f8..81a24eb 100644
> --- a/sound/soc/intel/sst-atom-controls.c
> +++ b/sound/soc/intel/sst-atom-controls.c
> @@ -66,6 +66,47 @@ unsigned int sst_reg_write(struct sst_data *drv, unsigned int reg,
> return val;
> }
>
> +int sst_mix_put(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct snd_soc_dapm_widget_list *wlist;// = dapm_kcontrol_get_wlist(kcontrol);
> + struct snd_soc_dapm_widget *widget = wlist->widgets[0];
> + struct soc_mixer_control *mc =
> + (struct soc_mixer_control *)kcontrol->private_value;
> + struct sst_data *drv = snd_soc_platform_get_drvdata(widget->platform);
> + unsigned int mask = (1 << fls(mc->max)) - 1;
> + unsigned int val;
> + int connect;
> + struct snd_soc_dapm_update update;
> +
> + pr_debug("%s called set %#lx for %s\n", __func__,
> + ucontrol->value.integer.value[0], widget->name);
> + val = sst_reg_write(drv, mc->reg, mc->shift, mc->max, ucontrol->value.integer.value[0]);
> + connect = !!val;
> +
> + //dapm_kcontrol_set_value(kcontrol, val);
> + update.kcontrol = kcontrol;
> + update.reg = mc->reg;
> + update.mask = mask;
> + update.val = val;
> +
> + snd_soc_dapm_mixer_update_power(widget->dapm, kcontrol, connect, &update);
> + return 0;
> +}
> +
> +int sst_mix_get(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct snd_soc_dapm_widget_list *wlist;// = dapm_kcontrol_get_wlist(kcontrol);
> + struct snd_soc_dapm_widget *w = wlist->widgets[0];
> + struct soc_mixer_control *mc =
> + (struct soc_mixer_control *)kcontrol->private_value;
> + struct sst_data *drv = snd_soc_platform_get_drvdata(w->platform);
> +
> + ucontrol->value.integer.value[0] = !!sst_reg_read(drv, mc->reg, mc->shift, mc->max);
> + return 0;
> +}
> +
> static inline void sst_fill_byte_control(char *param,
> u8 ipc_msg, u8 block,
> u8 task_id, u8 pipe_id,
> @@ -937,6 +978,32 @@ static const struct snd_soc_dapm_widget sst_dapm_widgets[] = {
> SST_PATH_MEDIA_LOOP_OUTPUT("media_loop2_out", SST_TASK_SBA, SST_SWM_OUT_MEDIA_LOOP2, SST_FMT_STEREO, sst_set_media_loop),
>
> /* Media Mixers */
> + SST_SWM_MIXER("media0_out mix 0", SST_MIX_MEDIA0, SST_TASK_MMX, SST_SWM_OUT_MEDIA0,
> + sst_mix_media0_controls, sst_swm_mixer_event),
> + SST_SWM_MIXER("media1_out mix 0", SST_MIX_MEDIA1, SST_TASK_MMX, SST_SWM_OUT_MEDIA1,
> + sst_mix_media1_controls, sst_swm_mixer_event),
> +
> + /* SBA PCM mixers */
> + SST_SWM_MIXER("pcm0_out mix 0", SST_MIX_PCM0, SST_TASK_SBA, SST_SWM_OUT_PCM0,
> + sst_mix_pcm0_controls, sst_swm_mixer_event),
> + SST_SWM_MIXER("pcm1_out mix 0", SST_MIX_PCM1, SST_TASK_SBA, SST_SWM_OUT_PCM1,
> + sst_mix_pcm1_controls, sst_swm_mixer_event),
> + SST_SWM_MIXER("pcm2_out mix 0", SST_MIX_PCM2, SST_TASK_SBA, SST_SWM_OUT_PCM2,
> + sst_mix_pcm2_controls, sst_swm_mixer_event),
> +
> + /* SBA Loop mixers */
> + SST_SWM_MIXER("sprot_loop_out mix 0", SST_MIX_LOOP0, SST_TASK_SBA, SST_SWM_OUT_SPROT_LOOP,
> + sst_mix_sprot_l0_controls, sst_swm_mixer_event),
> + SST_SWM_MIXER("media_loop1_out mix 0", SST_MIX_LOOP1, SST_TASK_SBA, SST_SWM_OUT_MEDIA_LOOP1,
> + sst_mix_media_l1_controls, sst_swm_mixer_event),
> + SST_SWM_MIXER("media_loop2_out mix 0", SST_MIX_LOOP2, SST_TASK_SBA, SST_SWM_OUT_MEDIA_LOOP2,
> + sst_mix_media_l2_controls, sst_swm_mixer_event),
> +
> + /* SBA Backend mixers */
> + SST_SWM_MIXER("codec_out0 mix 0", SST_MIX_CODEC0, SST_TASK_SBA, SST_SWM_OUT_CODEC0,
> + sst_mix_codec0_controls, sst_swm_mixer_event),
> + SST_SWM_MIXER("codec_out1 mix 0", SST_MIX_CODEC1, SST_TASK_SBA, SST_SWM_OUT_CODEC1,
> + sst_mix_codec1_controls, sst_swm_mixer_event),
> };
>
> static const struct snd_soc_dapm_route intercon[] = {
>
next prev parent reply other threads:[~2014-06-14 15:39 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-13 12:33 [PATCH 00/19]: add mrfld DSP support Vinod Koul
2014-06-13 12:33 ` [PATCH 01/19] ASoC: Intel: add COMPILE_TEST to mfld machine Vinod Koul
2014-06-21 10:42 ` Mark Brown
2014-06-21 15:34 ` Mark Brown
2014-06-21 16:08 ` Vinod Koul
2014-06-13 12:33 ` [PATCH 02/19] ASoC: Intel: mfld_pcm: move stream handling to dai_ops Vinod Koul
2014-06-21 10:43 ` Mark Brown
2014-06-13 12:33 ` [PATCH 03/19] ASoC: Intel: mfld-pcm rename period callback arg Vinod Koul
2014-06-21 10:43 ` Mark Brown
2014-06-13 12:33 ` [PATCH 04/19] ASoc: Intel: mfld-pcm: report pcm delay Vinod Koul
2014-06-21 10:43 ` Mark Brown
2014-06-13 12:33 ` [PATCH 05/19] ASoC: Intel: add the mrfld fw IPC definations Vinod Koul
2014-06-22 11:02 ` Mark Brown
2014-06-13 12:33 ` [PATCH 06/19] ASoC: Intel: mfld-pcm: modularize stream allocation code Vinod Koul
2014-06-22 11:02 ` Mark Brown
2014-06-13 12:33 ` [PATCH 07/19] ASoC: Intel: add mrfld pipelines Vinod Koul
2014-06-23 11:24 ` Mark Brown
2014-06-13 12:33 ` [PATCH 08/19] ASoC: Intel: use common stream allocation method for compressed stream Vinod Koul
2014-06-23 11:24 ` Mark Brown
2014-06-13 12:33 ` [PATCH 09/19] ASoC: Intel: mfld-pcm: add FE and BE ops Vinod Koul
2014-06-23 11:26 ` Mark Brown
2014-06-13 12:33 ` [PATCH 10/19] ASoC: Intel: add mrfld DSP registers Vinod Koul
2014-06-20 8:22 ` Lars-Peter Clausen
2014-06-20 11:32 ` Vinod Koul
2014-06-20 12:33 ` Lars-Peter Clausen
2014-06-21 6:22 ` Vinod Koul
2014-06-21 6:56 ` Lars-Peter Clausen
2014-06-23 4:27 ` Vinod Koul
2014-06-25 4:31 ` Lars-Peter Clausen
2014-06-26 10:22 ` Vinod Koul
2014-06-13 12:34 ` [PATCH 11/19] ASoC: intel: mfld-pcm: don't call trigger ops to DSP for internal streams Vinod Koul
2014-06-13 12:34 ` [PATCH 12/19] ASoC: Intel: add generic parameter set interface Vinod Koul
2014-06-13 12:34 ` [PATCH 13/19] ASoC: Intel: mrfld: add bytes control for modules Vinod Koul
2014-06-20 8:11 ` Lars-Peter Clausen
2014-06-20 11:30 ` Vinod Koul
2014-06-20 12:27 ` Lars-Peter Clausen
2014-06-21 6:16 ` Vinod Koul
2014-06-21 6:19 ` Lars-Peter Clausen
2014-06-23 4:15 ` Vinod Koul
2014-06-25 4:23 ` Lars-Peter Clausen
2014-06-13 12:34 ` [PATCH 14/19] ASoC: Intel: mrfld: add the gain controls Vinod Koul
2014-06-13 12:34 ` [PATCH 15/19] ASoC: Intel: mfld-pcm: add control for powering up/down dsp Vinod Koul
2014-06-13 12:34 ` [PATCH 16/19] ASoC: Intel: mrfld: add DSP core controls Vinod Koul
2014-06-13 12:34 ` [PATCH 17/19] ASoC: InteL; mrfld: add the DSP DAPM widgets Vinod Koul
2014-06-13 12:34 ` [PATCH 18/19] ASoC: Intel: mfld-pcm: add the fe & be dai ops Vinod Koul
2014-06-13 12:34 ` [RFC 19/19] ASoC: Intel: mrfld: add the DSP mixers Vinod Koul
2014-06-14 15:39 ` Lars-Peter Clausen [this message]
2014-07-04 4:46 ` Vinod Koul
2014-07-04 11:21 ` Lars-Peter Clausen
2014-07-07 8:45 ` Vinod Koul
2014-06-20 8:04 ` [PATCH 00/19]: add mrfld DSP support Lars-Peter Clausen
2014-06-20 8:20 ` Vinod Koul
2014-06-20 8:57 ` Lars-Peter Clausen
2014-06-23 10:09 ` Mark Brown
2014-06-25 4:27 ` Lars-Peter Clausen
2014-06-26 10:31 ` Vinod Koul
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=539C6C9D.6020004@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=vinod.koul@intel.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).