All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Javier Martin <javier.martin@vista-silicon.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] ASoC: Add external amplifier controls for Visstrim_M10.
Date: Thu, 19 Jan 2012 15:45:21 +0000	[thread overview]
Message-ID: <20120119154521.GG3178@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1326984807-10424-1-git-send-email-javier.martin@vista-silicon.com>

On Thu, Jan 19, 2012 at 03:53:27PM +0100, Javier Martin wrote:
> Visstrim_M10 has an external class D amplifier.
> This patch provides support for controlling the 4
> possible gain levels and per channel muting.

It does seem like there could usefully be a generic driver but it's so
little code...

> +	switch (reg) {
> +	case MX27VIS_AMP_GAIN:
> +		gpio_set_value(MX27VIS_PIN_G0, value & 1);
> +		gpio_set_value(MX27VIS_PIN_G1, value >> 1);
> +		mx27vis_amp_gain = value;
> +		break;
> +	case MX27VIS_AMP_MUTE:
> +		gpio_set_value(MX27VIS_PIN_SDL, value & 1);
> +		gpio_set_value(MX27VIS_PIN_SDR, value >> 1);
> +		mx27vis_amp_mute = value;
> +		break;

These should validate that value is in range.

> +	ret = mxc_gpio_setup_multiple_pins(mx27vis_amp_pins,
> +			ARRAY_SIZE(mx27vis_amp_pins), "MX27VIS_AMP");
> +	if (ret) {
> +		printk(KERN_ERR "ASoC: unable to setup gpios\n");
> +		platform_device_put(mx27vis_aic32x4_snd_device);
> +	}

This looks awfully like it should be arch/arm code except it looks like
it also munges in the gpio_request.  Odd.

  reply	other threads:[~2012-01-19 15:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-19 14:53 [PATCH] ASoC: Add external amplifier controls for Visstrim_M10 Javier Martin
2012-01-19 15:45 ` Mark Brown [this message]
2012-01-19 16:37   ` javier Martin
2012-01-19 17:59     ` Mark Brown
2012-01-19 16:52 ` Lars-Peter Clausen

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=20120119154521.GG3178@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=javier.martin@vista-silicon.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.