alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Beer <daniel.beer@igorinstitute.com>
To: "Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
	Mark Brown <broonie@kernel.org>,
	linux-kernel@vger.kernel.org, Liam Girdwood <lgirdwood@gmail.com>,
	Andy Liu <andy-liu@ti.com>, Rob Herring <robh+dt@kernel.org>,
	Derek Simkowiak <derek.simkowiak@igorinstitute.com>
Subject: Re: [PATCH v2 1/2] ASoC: add support for TAS5805M digital amplifier
Date: Fri, 14 Jan 2022 11:18:58 +1300	[thread overview]
Message-ID: <20220113221858.GA18380@nyquist.nev> (raw)
In-Reply-To: <703cec53-5de7-e8c1-5a1f-e44f0cbc141f@linux.intel.com>

On Thu, Jan 13, 2022 at 10:18:27AM +0100, Amadeusz Sławiński wrote:
> > +static int tas5805m_vol_put(struct snd_kcontrol *kcontrol,
> > +			    struct snd_ctl_elem_value *ucontrol)
> > +{
> > +	struct snd_soc_component *component =
> > +		snd_soc_kcontrol_component(kcontrol);
> > +	struct tas5805m_priv *tas5805m =
> > +		snd_soc_component_get_drvdata(component);
> > +
> > +	if (!(volume_is_valid(ucontrol->value.integer.value[0]) &&
> > +	      volume_is_valid(ucontrol->value.integer.value[1])))
> > +		return -EINVAL;
> > +
> > +	mutex_lock(&tas5805m->lock);
> > +	tas5805m->vol[0] = ucontrol->value.integer.value[0];
> > +	tas5805m->vol[1] = ucontrol->value.integer.value[1];
> > +	dev_dbg(component->dev, "set vol=%d/%d (is_powered=%d)\n",
> > +		tas5805m->vol[0], tas5805m->vol[1], tas5805m->is_powered);
> > +	if (tas5805m->is_powered)
> > +		tas5805m_refresh_unlocked(component);
> > +	mutex_unlock(&tas5805m->lock);
> > +
> > +	return 0;
> > +}
> > +
> 
> put method should return '1' if value changed, so ALSA knows to inform
> userspace utilities about change. You can check if userspace is notified of
> changes with "alsactl monitor", you should see something like:
> node hw:2, #3 (2,0,0,ADC0 Capture Volume,0) VALUE
> when value changes.

Thanks, will fix this.

-- 
Daniel Beer
Firmware Engineer at Igor Institute
daniel.beer@igorinstitute.com or +64-27-420-8101
Offices in Seattle, San Francisco, and Vancouver BC or (206) 494-3312

  reply	other threads:[~2022-01-13 22:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-13  8:38 [PATCH v2 0/2] ASoC: add support for TAS5805M digital amplifier Daniel Beer
2022-01-10 23:53 ` [PATCH v2 1/2] " Daniel Beer
2022-01-13  9:18   ` Amadeusz Sławiński
2022-01-13 22:18     ` Daniel Beer [this message]
2022-01-11  0:00 ` [PATCH v2 2/2] ASoC: dt-bindings: add bindings for TI TAS5805M Daniel Beer
2022-01-13 16:29   ` Rob Herring
2022-01-13 22:20     ` Daniel Beer

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=20220113221858.GA18380@nyquist.nev \
    --to=daniel.beer@igorinstitute.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=andy-liu@ti.com \
    --cc=broonie@kernel.org \
    --cc=derek.simkowiak@igorinstitute.com \
    --cc=devicetree@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /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).