From: Mark Brown <broonie@kernel.org>
To: Steven Eckhoff <steven.eckhoff.opensource@gmail.com>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
linux-kernel@vger.kernel.org
Subject: Re: [alsa-devel][PATCH v1] ASoC: TSCS454: Add Support
Date: Tue, 29 May 2018 13:17:46 +0100 [thread overview]
Message-ID: <20180529121746.GH23509@sirena.org.uk> (raw)
In-Reply-To: <20180529105147.GA32219@t7-ThinkPad-E560>
[-- Attachment #1: Type: text/plain, Size: 1670 bytes --]
On Tue, May 29, 2018 at 05:52:00AM -0500, Steven Eckhoff wrote:
> +static char const * const in_bst_txt[] = {
> + "0 dB", "10 dB", "20 dB", "30 dB"};
> +
This looks like just a regular volume control, it should be a normal
SOC_SINGLE_TLV().
> + SOC_SINGLE("Input Channel 1 Mute En",
> + R_ICTL0, FB_ICTL0_IN1MUTE, 1, 0),
All these En controls (I'm guessing Enable?) are just simple on/off
controls and should end in Switch as per ControlNames.txt.
> + /* R_ICH0VOL PG 1 ADDR 0x12 */
> + SOC_SINGLE_TLV("Input Channel 0", R_ICH0VOL,
> + FB_ICHVOL_ICHVOL, FM_ICHVOL_ICHVOL, 0, in_vol_tlv_arr),
All volume controls should end in Volume.
> +static int tscs454_hw_params(struct snd_pcm_substream *substream,
> + struct snd_pcm_hw_params *params,
> + struct snd_soc_dai *dai)
> +{
> + struct snd_soc_component *component = dai->component;
> + struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component);
> + unsigned int fs = params_rate(params);
> + mutex_lock(&aif->lock);
> + config_aif = aif->users == 0;
> + aif->users++;
> + mutex_unlock(&aif->lock);
> +
> + if (!config_aif)
> + return 0;
We silently ignore attempts to configure the parameters? That's broken,
userspace won't know. You should be setting more of the symmetry flags
on the DAIs (for things that are relevant) and returning an error if
there's an attempt to configure an incompatible parameter.
> + mutex_lock(&tscs454->active_aifs_lock);
> + res_ir_pll = tscs454->active_aifs == 0;
Please write normal if statements, these comparisons within assignments
are easy to miss and look like attempts to combine multiple
initializations in a single line due to the mix of = and ==.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2018-05-29 12:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-29 10:52 Steven Eckhoff
2018-05-29 12:17 ` Mark Brown [this message]
2018-05-30 18:25 ` kbuild test robot
2018-05-30 18:25 ` [RFC PATCH] ASoC: TSCS454: tscs454_set_sysclk() can be static kbuild test robot
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=20180529121746.GH23509@sirena.org.uk \
--to=broonie@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=steven.eckhoff.opensource@gmail.com \
--cc=tiwai@suse.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
all inboxes | Powered by JetHome®