Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Eric Nelson <eric.nelson@boundarydevices.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
	alsa-devel@alsa-project.org, Matt Sealey <matt@genesi-usa.com>,
	"troy.kisky" <troy.kisky@boundarydevices.com>,
	"zengzm.kernel" <zengzm.kernel@gmail.com>,
	Fabio Estevam <festevam@gmail.com>
Subject: Re: [RFC] ASoC: sgtl5000: Remove cache support
Date: Wed, 8 May 2013 16:11:28 +0100	[thread overview]
Message-ID: <20130508151128.GW7478@sirena.org.uk> (raw)
In-Reply-To: <20130508145919.GU7478@sirena.org.uk>


[-- Attachment #1.1: Type: text/plain, Size: 1518 bytes --]

On Wed, May 08, 2013 at 03:59:19PM +0100, Mark Brown wrote:
> On Wed, May 08, 2013 at 07:26:22AM -0700, Eric Nelson wrote:

> > An initial pass of writing all of the default register values with a
> > sort of 'cache flush' appears to be the right thing.

> > Then it doesn't even matter if the values match the datasheet, or if
> > the spec changes over time. If the values are reasonable, the device
> > will function properly.

> No, it does matter - when we do things like cache syncs on resume the
> core will suppress writes of registers which have their power on value
> since either the register will have been reset to that value by power
> loss or retained the value due to power being maintained.  This is a
> useful win when resuming to audio activity, I2C is pretty slow.

Actually the simplest way to implement this solution (at least with
regmap, IIRC there might've been some issues with the ASoC cache code)
is just to discard the register defaults.  The core will fall back to
reading the hardware for any register it doesn't have cached but will
continue to cache values that are written.  

Something that iterates all the known registers and reads the default
values in will be required in order to support control access with the
device powered down.  I'd therefore suggest just not telling regmap
about the current defaults and instead changing the code to loop over
them and write them out during startup.  Probably with a big fat comment
about why we're doing this.

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

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2013-05-08 15:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1367610549-25542-1-git-send-email-festevam@gmail.com>
     [not found] ` <20130503223613.GR4945@sirena.org.uk>
2013-05-04 18:47   ` [RFC] ASoC: sgtl5000: Remove cache support Fabio Estevam
2013-05-04 20:25     ` Fabio Estevam
2013-05-05 10:15       ` Mark Brown
     [not found]         ` <CAKGA1bmKdtAoUP7Yn0CJRVwsCNX5JkEWdWVJj1VJBaJn+9PA=A@mail.gmail.com>
2013-05-06 22:06           ` Mark Brown
     [not found]             ` <CAKGA1b=+j5BpHzWOfkDv+xjLLcauHeD4jDj_Do+6ft6UPhYEtA@mail.gmail.com>
2013-05-07 23:26               ` Fabio Estevam
2013-05-08  0:57                 ` Troy Kisky
2013-05-08 10:31               ` Mark Brown
2013-05-08 14:26                 ` Eric Nelson
2013-05-08 14:59                   ` Mark Brown
2013-05-08 15:11                     ` Mark Brown [this message]
2013-05-08 16:02                       ` Fabio Estevam
2013-05-08 17:14                         ` Fabio Estevam
2013-05-03 19:55 Fabio Estevam

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=20130508151128.GW7478@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=eric.nelson@boundarydevices.com \
    --cc=fabio.estevam@freescale.com \
    --cc=festevam@gmail.com \
    --cc=matt@genesi-usa.com \
    --cc=troy.kisky@boundarydevices.com \
    --cc=zengzm.kernel@gmail.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