* Re: [alsa-devel] [PATCH] ASoC: da7210: Add support for spi regmap [not found] <1332345170.21744.10.camel@matrix> @ 2012-03-21 15:56 ` Mark Brown [not found] ` <1332348080.21744.26.camel@matrix> 0 siblings, 1 reply; 3+ messages in thread From: Mark Brown @ 2012-03-21 15:56 UTC (permalink / raw) To: Ashish Chavan Cc: lrg, alsa-devel, David Dajun Chen, kuninori.morimoto.gx, linux-kernel [-- 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 --] ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <1332348080.21744.26.camel@matrix>]
* Re: [alsa-devel] [PATCH] ASoC: da7210: Add support for spi regmap [not found] ` <1332348080.21744.26.camel@matrix> @ 2012-03-21 16:38 ` Mark Brown [not found] ` <1332349553.21744.33.camel@matrix> 0 siblings, 1 reply; 3+ messages in thread From: Mark Brown @ 2012-03-21 16:38 UTC (permalink / raw) To: Ashish Chavan Cc: lrg, alsa-devel, David Dajun Chen, kuninori.morimoto.gx, linux-kernel [-- Attachment #1: Type: text/plain, Size: 1293 bytes --] On Wed, Mar 21, 2012 at 10:11:20PM +0530, Ashish Chavan wrote: > On Wed, 2012-03-21 at 15:56 +0000, Mark Brown wrote: > 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. You also need to make sure that the register cache doesn't get confused. > > > /* 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 ...and didn't bother asking any questions so it's unlikely anyone will say anything... > you please elaborate the problem if you have details? so that I can > correct it. What is unclear in the previous feedback? You should be converting this to use a regmap patch... [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <1332349553.21744.33.camel@matrix>]
* Re: [alsa-devel] [PATCH] ASoC: da7210: Add support for spi regmap [not found] ` <1332349553.21744.33.camel@matrix> @ 2012-03-21 17:22 ` Mark Brown 0 siblings, 0 replies; 3+ messages in thread From: Mark Brown @ 2012-03-21 17:22 UTC (permalink / raw) To: Ashish Chavan Cc: lrg, alsa-devel, David Dajun Chen, kuninori.morimoto.gx, linux-kernel [-- Attachment #1: Type: text/plain, Size: 959 bytes --] On Wed, Mar 21, 2012 at 10:35:53PM +0530, Ashish Chavan wrote: > > > 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 > > ...and didn't bother asking any questions so it's unlikely anyone will > > say anything... > No, actually it's not like that. You mentioned that the sequence should > be changed, which will fix an issue that the driver has with suspend and > resume. I asked other users of this driver about the issue and waiting > for their feedback. I just wanted to have clear picture about the issue > before I commit any change there. Just to make sure that only changing > of sequence is enough or some thing extra need to be done. No, I didn't say that the sequence should be changed. I said that it should be implemented using the relevant framework features rather than being open coded. The sequence itself is fine from a framework point of view. [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-03-21 17:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1332345170.21744.10.camel@matrix>
2012-03-21 15:56 ` [alsa-devel] [PATCH] ASoC: da7210: Add support for spi regmap Mark Brown
[not found] ` <1332348080.21744.26.camel@matrix>
2012-03-21 16:38 ` Mark Brown
[not found] ` <1332349553.21744.33.camel@matrix>
2012-03-21 17:22 ` Mark Brown
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox