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] [day] [month] [year] [list]
Message-ID: <20111012160854.GV3647@opensource.wolfsonmicro.com>
Date:	Wed, 12 Oct 2011 17:08:55 +0100
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	Ashish Chavan <ashish.chavan@...tcummins.com>
Cc:	lrg@...com, alsa-devel <alsa-devel@...a-project.org>,
	David Dajun Chen <david.chen@...semi.com>,
	kuninori.morimoto.gx@...esas.com,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [alsa-devel] [PATCH 9/9] ASoC: da7210: Add support for DAPM

On Wed, Oct 12, 2011 at 08:40:51PM +0530, Ashish Chavan wrote:
> This patch adds support for DAPM covering all inputs and outputs
> as well as ADC and DAC.

So, you added a bunch of additional routes using the register sequence
method and then add DAPM support, this seems to be the wrong way round
and isn't great for review.  Converting the existing stuff to DAPM and
then adding new features seems a lot more sensible.

> +	/* MICBIAS */
> +	SND_SOC_DAPM_MICBIAS("Mic Bias", DA7210_MIC_L, 6, 0),

Use supply widgets for biases, new code shouldn't introduce micbiases.

> +	/* Input path */
> +	{"Mic Bias", NULL, "MICR"},
> +	{"Mic Bias", NULL, "MICL"},
> +
> +	{"Mic Left", NULL, "Mic Bias"},
> +	{"Mic Right", NULL, "Mic Bias"},

Microphone bias must be hooked up by the board - for example, the system
may use an external microphone bias.

> +static int da7210_add_widgets(struct snd_soc_codec *codec)
> +{
> +	struct snd_soc_dapm_context *dapm = &codec->dapm;
> +
> +	snd_soc_dapm_new_controls(dapm, da7210_dapm_widgets,
> +				  ARRAY_SIZE(da7210_dapm_widgets));
> +	snd_soc_dapm_add_routes(dapm, da7210_audio_map,
> +				ARRAY_SIZE(da7210_audio_map));

Just assign these in the card struct.

> @@ -748,6 +942,10 @@ static int da7210_probe(struct snd_soc_codec *codec)
>  	snd_soc_write(codec, DA7210_INMIX_L, DA7210_IN_L_EN);
>  	snd_soc_write(codec, DA7210_INMIX_R, DA7210_IN_R_EN);
>  
> +	/* In mixer source selection, only MIC is selected by default */
> +	snd_soc_write(codec, DA7210_INMIX_L, 0x01);
> +	snd_soc_write(codec, DA7210_INMIX_R, 0x01);
> +

As ever just leave the chip defaults alone.

> +	/* Enable standby for all inputs and outputs */
> +	snd_soc_write(codec, DA7210_STARTUP2, DA7210_LOUT1_L_STBY |
> +		DA7210_LOUT1_R_STBY | DA7210_LOUT2_STBY | DA7210_HP_L_STBY |
> +		DA7210_HP_R_STBY | DA7210_DAC_L_STBY | DA7210_DAC_R_STBY);
> +	snd_soc_write(codec, DA7210_STARTUP3, DA7210_MIC_L_STBY |
> +		DA7210_MIC_R_STBY | DA7210_LIN1_L_STBY | DA7210_LIN1_R_STBY |
> +		DA7210_LIN2_STBY | DA7210_ADC_L_STBY | DA7210_ADC_R_STBY);
> +

This looks like it should be in set_bias_level().
--
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