From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: "Prchal Jiří" <jiri.prchal@aksignal.cz>
Cc: vbarinov@embeddedalley.com, alsa-devel@alsa-project.org,
sudhakar.raj@ti.com, nsekhar@ti.com, peter.ujfalusi@ti.com,
mr.swami.reddy@ti.com, lrg@ti.com
Subject: Re: [PATCH] ASoC: tlv320aic3x: add AGC, MIC_BIAS
Date: Tue, 26 Jun 2012 14:17:13 +0100 [thread overview]
Message-ID: <20120626131712.GT30406@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <4FE9B35B.9020002@aksignal.cz>
[-- Attachment #1.1: Type: text/plain, Size: 2292 bytes --]
On Tue, Jun 26, 2012 at 03:04:27PM +0200, Prchal Jiří wrote:
> SOC_DOUBLE_R("AGC Switch", LAGC_CTRL_A, RAGC_CTRL_A, 7, 0x01, 0),
> + SOC_ENUM("Left AGC Target level", aic3x_enum[LAGC_LEV_ENUM]),
> + SOC_ENUM("Right AGC Target level", aic3x_enum[RAGC_LEV_ENUM]),
> + SOC_ENUM("Left AGC Attack time", aic3x_enum[LAGC_ATT_ENUM]),
> + SOC_ENUM("Right AGC Attack time", aic3x_enum[RAGC_ATT_ENUM]),
> + SOC_ENUM("Left AGC Decay time", aic3x_enum[LAGC_DEC_ENUM]),
> + SOC_ENUM("Right AGC Decay time", aic3x_enum[RAGC_DEC_ENUM]),
Please move everything out of the big array or if you insist on having
the array then use the indexes in the assignments. Otherwise the code
is just error prone and hard to read.
> +
> + SOC_ENUM("Mic Bias", aic3x_enum[MIC_BIAS_ENUM]),
No, this should be platform data or done with a callback from the
machine driver. It's very unlikely that it's sensible to vary at
runtime without coordination with other driver code.
> + /* set to avoid artifacts on the audio output during power-on/off */
> + snd_soc_write(codec, AIC3X_HEADSET_DETECT_CTRL_B, 0x80); /*ac-coupled*/
> + snd_soc_write(codec, HPOUT_POP_REDUCTION, 0x4e); /* 10 + 4 ms, reference*/
> +
> + /* short circuit protection */
> + snd_soc_write(codec, HPRCOM_CFG, 0x04);
> +
This appears to be unrelated to the change. What is it for?
> /* DAC to Mono Line Out default volume and route to Output mixer */
> - snd_soc_write(codec, DACL1_2_MONOLOPM_VOL, DEFAULT_VOL | ROUTE_ON);
> - snd_soc_write(codec, DACR1_2_MONOLOPM_VOL, DEFAULT_VOL | ROUTE_ON);
> + /* mix both channels with -6dB level */
> + snd_soc_write(codec, DACL1_2_MONOLOPM_VOL, (DEFAULT_VOL + 12) | ROUTE_ON);
> + snd_soc_write(codec, DACR1_2_MONOLOPM_VOL, (DEFAULT_VOL + 12) | ROUTE_ON);
This is also an unrelated change to the chip defaults (which we were
overriding anyway when we shouldn't be...). Code like this should just
be removed completely.
> + /* AGC to -10dB, 20 / 500ms, no clip stepping, noise gate -90dB, hysteresis 3dB*/
> + snd_soc_write(codec, LAGC_CTRL_A, 0x2f);
> + snd_soc_write(codec, RAGC_CTRL_A, 0x2f);
> + snd_soc_write(codec, LAGC_CTRL_C, 0xbe);
> + snd_soc_write(codec, RAGC_CTRL_C, 0xbe);
Again, just use the chip defaults and let the user override.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2012-06-26 13:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-26 13:04 [PATCH] ASoC: tlv320aic3x: add AGC, MIC_BIAS Prchal Jiří
2012-06-26 13:17 ` Mark Brown [this message]
2012-06-27 7:48 ` Prchal Jiří
2012-06-27 11:25 ` Mark Brown
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=20120626131712.GT30406@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=jiri.prchal@aksignal.cz \
--cc=lrg@ti.com \
--cc=mr.swami.reddy@ti.com \
--cc=nsekhar@ti.com \
--cc=peter.ujfalusi@ti.com \
--cc=sudhakar.raj@ti.com \
--cc=vbarinov@embeddedalley.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.