alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Ashish Chavan <ashish.chavan@kpitcummins.com>
Cc: lrg <lrg@ti.com>, alsa-devel <alsa-devel@alsa-project.org>,
	David Dajun Chen <david.chen@diasemi.com>,
	"kuninori.morimoto.gx" <kuninori.morimoto.gx@renesas.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [alsa-devel] [PATCH] ASoC: da7210: Add support for spi regmap
Date: Wed, 21 Mar 2012 15:56:35 +0000	[thread overview]
Message-ID: <20120321155635.GE3226@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1332345170.21744.10.camel@matrix>

[-- Attachment #1: Type: text/plain, Size: 1622 bytes --]

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.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-03-21 15:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-21 15:52 [PATCH] ASoC: da7210: Add support for spi regmap Ashish Chavan
2012-03-21 15:56 ` Mark Brown [this message]
2012-03-21 16:41   ` Ashish Chavan
2012-03-21 16:38     ` Mark Brown
2012-03-21 17:05       ` Ashish Chavan
2012-03-21 17:22         ` [alsa-devel] " 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=20120321155635.GE3226@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=ashish.chavan@kpitcummins.com \
    --cc=david.chen@diasemi.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.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;
as well as URLs for NNTP newsgroup(s).