From: Vinod Koul <vinod.koul@intel.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com,
Peter Ujfalusi <peter.ujfalusi@ti.com>,
broonie@kernel.org, Kp Jeeja <jeeja.kp@intel.com>,
"Subhransu S. Prusty" <subhransu.s.prusty@intel.com>
Subject: Re: [PATCH v2 1/2] ASoC: export dapm_kcontrol_set/get_value functions
Date: Fri, 30 May 2014 15:59:44 +0530 [thread overview]
Message-ID: <20140530102944.GP21128@intel.com> (raw)
In-Reply-To: <5388319F.9030703@metafoo.de>
On Fri, May 30, 2014 at 09:22:07AM +0200, Lars-Peter Clausen wrote:
> On 05/30/2014 08:09 AM, Vinod Koul wrote:
> >On Thu, May 29, 2014 at 12:55:07PM +0200, Lars-Peter Clausen wrote:
> >>On 05/29/2014 12:03 PM, Vinod Koul wrote:
> >>>The DSPs like Intel ones use the DPCM to represent the DSP toplogy. So when DAPM
> >>>triggers the widget, the DSP needs to know the kcontrol values and pass on to DSP
> >>>firmware, so export these for driver use
> >>>
> >>
> >>As I said I feel a bit uneasy about exporting these and I'd rather
> >>much prefer to see this patch in context (i.e. in the same series as
> >>its user).
> >I am still working on that series. The core patches could have gone ahead so
> >posted.
> >
> >Here is the code snippet that will come in subsequent series:
> >
> >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 *sst = 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;
> >
> > val = sst_reg_write(sst, mc->reg, mc->shift, mc->max,
> > ucontrol->value.integer.value[0]);
> > connect = !!val;
> >
> > dapm_kcontrol_set_value(kcontrol, val);
>
> This looks similar to what I discussed with Peter the other day. You
> do not really need to call dapm_kcontrol_set_value() for controls
> that are not a virtual control or a auto-muted control. Neither is
> probably the case here. The conclusion of our discussion also was to
> move the dapm_kcontrol_set_value() call into
> snd_soc_dapm_mixer_update_power(), in case it ever becomes mandatory
> for other types of controls as well, because this means that not
> every custom put callback has to call the function on it's own.
Yes I agree that if this is the approach we take we can remove the code snippet
here, which would make sense IMO
>
> Btw. in this case I think you should just use the default DAPM
> kcontrol put callback. There doesn't seem to be anything special in
> here and with the DAPM componentization series the default handler
> is also able to handle platforms.
Not for this version sure, but future platforms of our need some custom stuff to
be done. I will try to minimize those ones and once your component work is
complete redo these bits. Would be too happy to remove if it works out that way,
which is not the case with today. So till then we need these bits and exporting
of the dapm_kcontrol_set_value()
--
~Vinod
next prev parent reply other threads:[~2014-05-30 10:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-29 10:03 [PATCH v2 1/2] ASoC: export dapm_kcontrol_set/get_value functions Vinod Koul
2014-05-29 10:03 ` [PATCH v2 2/2] ASoC: dapm: Add a helper to get the platform for DAPM kcontrol Vinod Koul
2014-06-01 19:28 ` Mark Brown
2014-05-29 10:55 ` [PATCH v2 1/2] ASoC: export dapm_kcontrol_set/get_value functions Lars-Peter Clausen
2014-05-30 6:09 ` Vinod Koul
2014-05-30 7:22 ` Lars-Peter Clausen
2014-05-30 10:29 ` Vinod Koul [this message]
2014-05-30 12:50 ` Lars-Peter Clausen
2014-06-01 19:26 ` Mark Brown
2014-06-03 5:44 ` Vinod Koul
2014-06-03 10:11 ` Mark Brown
2014-06-06 5:54 ` Vinod Koul
2014-06-06 9:51 ` Mark Brown
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=20140530102944.GP21128@intel.com \
--to=vinod.koul@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=jeeja.kp@intel.com \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=peter.ujfalusi@ti.com \
--cc=subhransu.s.prusty@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 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.