From: Timur Tabi <timur@freescale.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: ALSA development <alsa-devel@alsa-project.org>,
Liam Girdwood <lrg@slimlogic.co.uk>
Subject: Re: asoc: problem with snd_soc_dai_set_fmt()
Date: Thu, 29 Apr 2010 18:30:19 -0500 [thread overview]
Message-ID: <s2oed82fe3e1004291630k697318f9od19ceca1011540fa@mail.gmail.com> (raw)
In-Reply-To: <20100429221808.GB23958@opensource.wolfsonmicro.com>
On Thu, Apr 29, 2010 at 5:18 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Thu, Apr 29, 2010 at 04:22:17PM -0500, Timur Tabi wrote:
>
>> Let's say the DAI driver has not defined a .set_fmt() function. This means
>> that if the fabric driver does this:
>
> *machine*
Grr... I've been calling it the fabric driver for a long time, and I
know I didn't make up that term.
> Right, but really this is the case - the driver has completely ignored
> what the machine driver was trying to do.
But there are several functions like that, such as the _pll function.
What if the CPU driver really doesn't care what the frequency is or
the PLL or whatever? Do I need to define stub functions for all of
these?
> It may be that the default
> behaviour is what was asked for, but it may also be that you've asked
> for I2S format and got DSP format or something similiarly incompatible.
But if the CPU driver does not define a function to check for that,
isn't that the same thing as saying, "I really don't care -- I'll
support whatever you want"?
> Due to the above issue I don't think this is a good idea - we really
> ought to let the machine driver know if the request it made was ignored
> in case it is trying to set up something that can't be supported.
IMHO, ignored != not supported.
For instance, it's possible for a CPU driver initially to support only
some configurations, so the set_fmt function would be necessary.
Later, the CPU driver could be updated to support all possible
configurations, and it could know that via some other mechanism (like
the device tree), and so it would be redundant if it let the machine
driver know what that configuration is.
This is what I'm doing to my SSI driver. Now that it probes the SSI
nodes directly, it doesn't need the machine driver to tell it what the
capabilities are.
> Another short term option would be to change the error code to be
> something a bit more distinctive than -EINVAL.
That would help.
> The current expectation is that the machine driver knows what the
> hardware is capable of
But not necessarily at compile time! I was hoping to use this as a
mechanism for determining the capabilities at run time.
--
Timur Tabi
Linux kernel developer at Freescale
next prev parent reply other threads:[~2010-04-29 23:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-29 21:22 asoc: problem with snd_soc_dai_set_fmt() Timur Tabi
2010-04-29 22:18 ` Mark Brown
2010-04-29 23:30 ` Timur Tabi [this message]
2010-04-30 10:37 ` Mark Brown
2010-04-30 1:28 ` jassi brar
2010-04-30 8:58 ` 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=s2oed82fe3e1004291630k697318f9od19ceca1011540fa@mail.gmail.com \
--to=timur@freescale.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=lrg@slimlogic.co.uk \
/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).