lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110811092702.GA18454@opensource.wolfsonmicro.com>
Date:	Thu, 11 Aug 2011 18:27:11 +0900
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	Lars-Peter Clausen <lars@...afoo.de>
Cc:	Liam Girdwood <lrg@...com>, alsa-devel@...a-project.org,
	device-drivers-devel@...ckfin.uclinux.org,
	linux-kernel@...r.kernel.org, Mike Frysinger <vapier.adi@...il.com>
Subject: Re: [PATCH 2/4] ASoC: Add ADAU1373 codec support

On Wed, Aug 10, 2011 at 05:52:42AM +0200, Lars-Peter Clausen wrote:

> +static const char *adau1373_micbias_text[] = {
> +	"2.9 V",
> +	"2.2 V",
> +	"2.6 V",
> +	"1.8 V",
> +};

This should be controlled by platform data and/or the machine driver,
not interactively by the user.  With some microphone technologies there
is actually a risk of damage with higher micbiases.

> +	SOC_DOUBLE("AIF3 Playback Boost(+6dB)", ADAU1373_VOL_GAIN1, 4, 5, 1, 0),
> +	SOC_DOUBLE("AIF2 Playback Boost(+6dB)", ADAU1373_VOL_GAIN1, 2, 3, 1, 0),
> +	SOC_DOUBLE("AIF1 Playback Boost(+6dB)", ADAU1373_VOL_GAIN1, 0, 1, 1, 0),
> +	SOC_DOUBLE("AIF3 Capture Boost(+6dB)", ADAU1373_VOL_GAIN2, 4, 5, 1, 0),
> +	SOC_DOUBLE("AIF2 Capture Boost(+6dB)", ADAU1373_VOL_GAIN2, 2, 3, 1, 0),
> +	SOC_DOUBLE("AIF1 Capture Boost(+6dB)", ADAU1373_VOL_GAIN2, 0, 1, 1, 0),
> +	SOC_DOUBLE("DMIC Capture Boost(+6dB)", ADAU1373_VOL_GAIN3, 6, 7, 1, 0),
> +	SOC_DOUBLE("ADC Capture Boost(+6dB)", ADAU1373_VOL_GAIN3, 4, 5, 1, 0),
> +	SOC_DOUBLE("DAC2 Playback Boost(+6dB)", ADAU1373_VOL_GAIN3, 2, 3, 1, 0),
> +	SOC_DOUBLE("DAC1 Playback Boost(+6dB)", ADAU1373_VOL_GAIN3, 0, 1, 1, 0),
> +
> +	SOC_DOUBLE("Input1 Boost(+20dB)", ADAU1373_ADC_GAIN, 0, 4, 1, 0),
> +	SOC_DOUBLE("Input2 Boost(+20dB)", ADAU1373_ADC_GAIN, 1, 5, 1, 0),
> +	SOC_DOUBLE("Input3 Boost(+20dB)", ADAU1373_ADC_GAIN, 2, 6, 1, 0),
> +	SOC_DOUBLE("Input4 Boost(+20dB)", ADAU1373_ADC_GAIN, 3, 7, 1, 0),

All this stuff should be TLV.

> +	SOC_ENUM("Lineout1 Mono Stereo", adau1373_lineout1_mode_enum),
> +	SOC_ENUM("Speaker Mono Stereo", adau1373_speaker_mode_enum),

I'd expect these to be platform data/machine data rather than user
control?  The speaker wiring isn't going to vary dynamically...

> +	switch (freq / params_rate(params)) {
> +	case 1024: /* fs */
> +		div = 0;
> +		break;
> +	case 1536: /* 2/3 fs */
> +		div = 1;
> +		break;

These comments look inaccuate, fs is the sample rate so a divide of 1
would be fs.

> +static void adau1373_load_drc_settings(struct snd_soc_codec *codec,
> +	unsigned int nr, uint8_t *drc)
> +{
> +	unsigned int i;
> +
> +	for (i = 0; i < 13; ++i)
> +		snd_soc_write(codec, ADAU1373_DRC(nr) + i, drc[i]);

ARRAY_SIZE() or a #define or something rather than a magic number.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ