All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Jan Weitzel <j.weitzel@phytec.de>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org, lrg@ti.com
Subject: Re: [PATCH REPOST] sound: codec: tlv320aic3x: remove mono controls
Date: Sat, 16 Jul 2011 00:46:31 +0900	[thread overview]
Message-ID: <20110715154626.GG11154@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1310744454-13790-1-git-send-email-j.weitzel@phytec.de>

On Fri, Jul 15, 2011 at 05:40:54PM +0200, Jan Weitzel wrote:
> if codec driver is used for AIC3X_MODEL_3007 the mono iout controls overwrite
> registers for class-d amplifier.
> classd amplifier controls are only used for AIC3X_MODEL_3007.

> Removing all mono snd_kcontrol_new, snd_soc_dapm_widget, snd_soc_dapm_route
> and aic3x_init stuff from common code and call only for not AIC3X_MODEL_3007
> codecs.

This is clearly not what your subject line says...

>  	if (aic3x->model == AIC3X_MODEL_3007) {
>  		aic3x_init_3007(codec);
>  		snd_soc_write(codec, CLASSD_CTRL, 0);
> +
> +		return 0;
>  	}
> +	/* Not on AIC3X_MODEL_3007 init */
> +

This is really not great legibility and it's going to get terribly
confusing if someone comes up with some other device that also needs
custom init.  A similar issue applied to some of the other stuff but
this is the most obvious example.  I'd suggest restructuring this to
have all the mono-specific code in an if statement that postively
selects for the feature.

>  	if (aic3x->model == AIC3X_MODEL_3007)
>  		snd_soc_add_controls(codec, &aic3x_classd_amp_gain_ctrl, 1);
> -
> +	else
> +		snd_soc_add_controls(codec, aic3x_mono_controls,
> +					ARRAY_SIZE(aic3x_mono_controls));

This if ... else should really be a switch.

  parent reply	other threads:[~2011-07-15 15:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-17 11:40 [PATCH] sound: codec: tlv320aic3x: remove mono controls Jan Weitzel
2011-06-17 13:04 ` Jarkko Nikula
2011-06-17 13:05   ` Mark Brown
2011-06-17 13:17     ` Jan Weitzel
     [not found]       ` <1310727555.26087.40.camel@lws-weitzel>
2011-07-15 12:42         ` Mark Brown
     [not found]           ` <1310744454-13790-1-git-send-email-j.weitzel@phytec.de>
2011-07-15 15:46             ` Mark Brown [this message]
2011-07-18 11:13               ` [PATCH v2] ASoC: tlv320aic3x: no mono controls 3007 model Jan Weitzel
2011-07-19 14:59                 ` Mark Brown
2011-07-21  7:11                   ` [PATCH v3] " Jan Weitzel
2011-06-17 13:18     ` [PATCH] sound: codec: tlv320aic3x: remove mono controls Jarkko Nikula

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=20110715154626.GG11154@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=j.weitzel@phytec.de \
    --cc=lrg@ti.com \
    --cc=tiwai@suse.de \
    /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.