public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Richard Fitzgerald <rf@opensource.cirrus.com>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	patches@opensource.cirrus.com
Subject: Re: [PATCH] ASoC: cs42l42: Add control for audio slow-start switch
Date: Fri, 29 Oct 2021 18:03:25 +0100	[thread overview]
Message-ID: <YXwpXedltzt1ykfc@sirena.org.uk> (raw)
In-Reply-To: <20211029161305.12714-1-rf@opensource.cirrus.com>

[-- Attachment #1: Type: text/plain, Size: 714 bytes --]

On Fri, Oct 29, 2021 at 05:13:05PM +0100, Richard Fitzgerald wrote:
> +static int cs42l42_slow_start_put(struct snd_kcontrol *kcontrol,
> +				  struct snd_ctl_elem_value *ucontrol)
> +{
> +	struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
> +	u8 val;
> +
> +	/* all bits of SLOW_START_EN much change together */
> +	switch (ucontrol->value.integer.value[0]) {
> +	case 0:
> +		val = 0;
> +		break;
> +	case 1:
> +		val = CS42L42_SLOW_START_EN_MASK;
> +		break;
> +	default:
> +		return -EINVAL;
> +	}
> +
> +	snd_soc_component_update_bits(component, CS42L42_SLOW_START_ENABLE,
> +				      CS42L42_SLOW_START_EN_MASK, val);
> +
> +	return 0;

This should return 1 if the value changed.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2021-10-29 17:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29 16:13 [PATCH] ASoC: cs42l42: Add control for audio slow-start switch Richard Fitzgerald
2021-10-29 17:03 ` Mark Brown [this message]

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=YXwpXedltzt1ykfc@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=rf@opensource.cirrus.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