[alsa-devel] [PATCH] ASoC: Add external amplifier controls for Visstrim_M10.

Mark Brown broonie at opensource.wolfsonmicro.com
Thu Jan 19 16:45:21 CET 2012


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.


More information about the Alsa-devel mailing list