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

On Wed, 2012-03-21 at 15:56 +0000, Mark Brown wrote:
> 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.
> 

OK, will make it runtime.

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

This is writing to page register. SPI register space is divided in to
two pages. Registers from 0x01 to 0x80 fall in to first page. If we want
to write to any register above 0x80, first we need to set page register
with PAGE1. May be I should put comments to make it obvious.

> 
> >  	/* 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.

Actually I don't have enough details about the problem that you
mentioned with this. I am waiting for inputs from some body else. Can
you please elaborate the problem if you have details? so that I can
correct it.

> 
> > +#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().

OK for this and rest of all comments. I will take care of them in next
submission soon.

  reply	other threads:[~2012-03-21 16:29 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 ` [alsa-devel] " Mark Brown
2012-03-21 16:41   ` Ashish Chavan [this message]
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=1332348080.21744.26.camel@matrix \
    --to=ashish.chavan@kpitcummins.com \
    --cc=David@alsa-project.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.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).