From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: "Lopez Cruz, Misael" <x0052729@ti.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: SoC codec read callback definition
Date: Thu, 23 Jul 2009 16:46:04 +0100 [thread overview]
Message-ID: <20090723154603.GA30390@sirena.org.uk> (raw)
In-Reply-To: <67059DBF19D7214F9C66BB0EA91BA90E59BA9D93@dlee04.ent.ti.com>
On Thu, Jul 23, 2009 at 02:50:53AM -0500, Lopez Cruz, Misael wrote:
> However, actual implementation of that callback in many CODEC drivers
> may return a negative error value (i.e. when a register is out of cache
> reg size). Should the callback definition be changed to return _int_
> instead of _unsigned int_? Some drivers (like wm8900, wm9081) handle
> invalid registers with BUG_ON, in that case it's not necessary to
> return the negative error code.
There's two classes of error. Reads from the hardware might possibly
fail at runtime, while reads from cache should never fail - an attempt
to read from an uncached register is a clear bug in the driver. When
the code was originally written there were essentially no devices with
readback so the cache was the only option.
> What should be the best way to handle this? Or is it ok as currently
> implemented? Well, it was just a thought.
Ideally we'd have error codes but that would loose us a bit of data and
IIRC there's at least one codec in there with 32 bit registers which
would need to be handled.
prev parent reply other threads:[~2009-07-23 15:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-23 7:50 SoC codec read callback definition Lopez Cruz, Misael
2009-07-23 15:46 ` Mark Brown [this message]
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=20090723154603.GA30390@sirena.org.uk \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=x0052729@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