alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>,
	alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
	Liam Girdwood <lrg@slimlogic.co.uk>
Subject: Re: [PATCH 1/2] ASoC: soc-cache: Use reg_def_copy instead of reg_cache_default
Date: Wed, 5 Jan 2011 17:08:20 -0600	[thread overview]
Message-ID: <4D24F9E4.1080704@freescale.com> (raw)
In-Reply-To: <20110105230339.GB5476@opensource.wolfsonmicro.com>

Mark Brown wrote:
> In general the expectation is that unless it's got a good reason not to
> a well written CODEC driver will use all the standard register cache
> infrastructure, including providing a set of defaults.  Good reasons for
> this include things like not having any registers and indeterminate
> default hardware state.

My concern is that I think it's unwise to hard-code the default values of the
registers in the source file.  Who's to say that a newer version of the chip
won't have different power-on defaults?

I do want to support a register cache, but I don't want to hard-code the default
values into cs4270.c.  Is this supported?

> As you will doubtless have seen when you looked at the code every other
> reference to reg_cache_default checks to see if it's set before using
> it.  This does rather suggest that the intention of the code is that it
> be optional.

So are you saying that there's a bug in this patch?  Perhaps that code should
look like this:

if (codec_drv->reg_cache_default)
	codec->reg_def_copy = kmemdup(codec_drv->reg_cache_default, reg_size, GFP_KERNEL);
else {
	codec->reg_def_copy = kmalloc(reg_size, GFP_KERNEL);
	// here we somehow tell the codec driver to initialize reg_def_copy
}

-- 
Timur Tabi
Linux kernel developer at Freescale

  reply	other threads:[~2011-01-05 23:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-02 16:11 [PATCH 0/2] ASoC: Override codec compress_type from the machine driver Dimitris Papastamos
2010-12-02 16:11 ` [PATCH 1/2] ASoC: soc-cache: Use reg_def_copy instead of reg_cache_default Dimitris Papastamos
2011-01-05 21:04   ` Timur Tabi
2011-01-05 23:03     ` Mark Brown
2011-01-05 23:08       ` Timur Tabi [this message]
2011-01-05 23:29         ` Mark Brown
2011-01-05 23:51           ` Mark Brown
2011-01-06  0:15             ` Tabi Timur-B04825
2011-01-06  0:34               ` Mark Brown
2011-01-06 16:26                 ` Timur Tabi
2011-01-06 21:20                   ` Mark Brown
2011-01-06 16:53     ` Dimitris Papastamos
2011-01-06 17:01       ` Timur Tabi
2010-12-02 16:11 ` [PATCH 2/2] ASoC: soc-core: Allow machine drivers to override compress_type Dimitris Papastamos
2010-12-03 16:14 ` [PATCH 0/2] ASoC: Override codec compress_type from the machine driver Liam Girdwood
2010-12-03 16:41 ` 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=4D24F9E4.1080704@freescale.com \
    --to=timur@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dp@opensource.wolfsonmicro.com \
    --cc=lrg@slimlogic.co.uk \
    --cc=patches@opensource.wolfsonmicro.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).