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>] [day] [month] [year] [list]
Date:	Wed, 21 Mar 2012 15:56:35 +0000
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	Ashish Chavan <ashish.chavan@...tcummins.com>
Cc:	lrg <lrg@...com>, alsa-devel <alsa-devel@...a-project.org>,
	David Dajun Chen <david.chen@...semi.com>,
	"kuninori.morimoto.gx" <kuninori.morimoto.gx@...esas.com>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [alsa-devel] [PATCH] ASoC: da7210: Add support for spi regmap

On Wed, Mar 21, 2012 at 09:22:50PM +0530, Ashish Chavan wrote:

> +#if defined(CONFIG_SPI_MASTER)
> +	/* Dummy read to give two pulses over nCS */
> +	regmap_read(da7210->regmap, DA7210_STATUS, &val);
> +	regmap_read(da7210->regmap, DA7210_STATUS, &val);
> +	regmap_read(da7210->regmap, DA7210_STATUS, &val);
> +#endif

This ifdef stuff should all be runtime configured based on the bus type,
unless the cost of the reads is considered immaterial in which case it
should be unconditional.

> +#if defined(CONFIG_SPI_MASTER)
> +	snd_soc_write(codec, 0x00, 0x80);
> +#endif

Hrm?

>  	/* unlock */
>  	regmap_write(da7210->regmap, DA7210_A_HID_UNLOCK,	0x8B);
> @@ -1035,6 +1056,10 @@ static int da7210_probe(struct snd_soc_codec *codec)
>  	regmap_write(da7210->regmap, DA7210_A_HID_UNLOCK,	0x00);
>  	regmap_write(da7210->regmap, DA7210_A_TEST_UNLOCK,	0x00);

I also note that you've not yet updated this to use a regmap patch as
was previously requested.

> +#if defined(CONFIG_SPI_MASTER)
> +static int __devinit da7210_spi_probe(struct spi_device *spi)
> +{
> +	struct da7210_priv *da7210;
> +	int ret;
> +
> +	da7210 = kzalloc(sizeof(struct da7210_priv), GFP_KERNEL);
> +	if (!da7210)
> +		return -ENOMEM;

devm_kzalloc().

> +	da7210_regmap.read_flag_mask = 0x01;
> +	da7210_regmap.write_flag_mask = 0x00;

Just have a second, static, regmap variable.  The regmap should be
declared const.

> +	da7210->regmap = regmap_init_spi(spi, &da7210_regmap);

devm_regmap_init_spi() (will come in in the merge window).

> +static struct spi_driver da7210_spi_driver = {
> +	.driver = {
> +		.name = "da7210-codec",

No -codec.

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ