From: "Joachim Förster" <mls.JOFT@gmx.de>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel <alsa-devel@alsa-project.org>,
Lorenz Kolb <lorenz.kolb@lkmail.de>,
"linuxppc-embedded@ozlabs.org" <linuxppc-embedded@ozlabs.org>
Subject: Re: [alsa-devel] [PATCH 1/2] Xlinx ML403 AC97 Controller Reference device driver
Date: Thu, 09 Aug 2007 21:44:46 +0200 [thread overview]
Message-ID: <1186688686.28843.61.camel@localhost> (raw)
In-Reply-To: <s5hsl6sws0s.wl%tiwai@suse.de>
Hi Takashi,
before posting a corrected version, I would like to ask some unclear
things (I think I understood the rest):
On Thu, 2007-08-09 at 19:13 +0200, Takashi Iwai wrote:
> (snip)
> > +static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
> > +static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
> > +static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;
>
> Can the driver really support multiple instances?
> If not, better to avoid these arrays.
Well, while I wrote the driver I considered that there might be more
than one instance - though I didn't test it and I won't be able to test
it (no such hardware available - with more than one LM4550 chip).
So, shall I remove it?
> > +struct lm4550_reg lm4550_regfile[64] = {
> > + {.reg = 0x00,
> > + .flag = LM4550_REG_NOSAVE | LM4550_REG_FAKEREAD,
> > + .def = 0x0D50},
>
> Better to use C99 style initialization here, e.g.
>
> [0x00] = { .... },
> [0x02] = { .... },
> [0x7e] = { .... },
>
> so you can avoid writing empty items.
> The index value could be also AC97_XXX, such as [AC97_MASTER] =
> {...}.
>
> What is the purpose of reg field at all, BTW? I guess it's
> superfluous.
No, it's there to provide a shadow copy of the codec's (LM4550)
registers. It contains default values and (while driver is running)
current values, which were written to the hardware. I had to introduce
this, because Xilinx's AC97 Controller Reference has a very ugly bug: It
provides a "register access finish" bit, so the driver is able to tell
when a register read or write access is finished. Unfortunately this
particular bit only works in the range of 0 to 100 times since board
reset. After that many register access it just remains saying: I'm _not_
ready. But in fact, in most cases (98%) the correct value already is the
read register (assume we have just said to the control that we want to
read a register).
I thought, ok we have such RegAccessFinished bit, so use it, if we have
to, until it doesn't work anymore.
So, through a shadow copy of most registers (some cannot be shadow or it
makes no sence) I can provide the values without having to actually read
from the controller/codec. The regfile also contains info which register
might be shadowed, if values get saved at all (if written) ...
Furthermore ALSA's AC97 layer does heavy initialization access series on
the codec, which I tried to "mask out" completely
(LM4550_REG_FAKEPROBE).
> > +#define LM4550_RF_FLAG(reg) lm4550_regfile[reg / 2].flag
<snip>
> > +static void lm4550_regfile_init(void)
> > +{
> > + int i;
> > + for (i = 0; i < 128; i = i + 2)
> > + if (LM4550_RF_FLAG(i) & LM4550_REG_FAKEPROBE)
> > + LM4550_RF_VAL(i) = LM4550_RF_DEF(i);
>
> "MACRO(x) = XXX" looks a bit strange to me.
Hmmm, ok. I thought about that, too. I think, I'll spell them out?
> RATE_CONTINUOUS and RATE_KNOW are usually exclusive.
Ok, so what I want is RATE_CONTINUOUS, right? (because the LM4550
supports 4000 to 48000kHz in 1Hz steps)
BTW: What is RATE_KNOT good for?
Joachim
next prev parent reply other threads:[~2007-08-09 19:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-09 10:36 [PATCH 1/2] Xlinx ML403 AC97 Controller Reference device driver Joachim Förster
2007-08-09 17:13 ` [alsa-devel] " Takashi Iwai
2007-08-09 19:44 ` Joachim Förster [this message]
2007-08-09 22:27 ` Takashi Iwai
2007-08-10 11:50 ` Joachim Förster
2007-08-10 12:07 ` Takashi Iwai
2007-08-11 16:23 ` [PATCHv2 1/2] Xilinx " Joachim Förster
2007-08-15 18:45 ` [PATCH] [ML403-AC97CR] Fix (device/driver) name registered with platform bus Joachim Foerster
2007-08-11 16:24 ` [PATCHv2 2/2] [VIRTEX] Register AC97 Controller Reference with the " Joachim Förster
2007-08-09 17:49 ` [PATCH 1/2] Xlinx ML403 AC97 Controller Reference device driver Grant Likely
2007-08-09 20:01 ` Joachim Förster
2007-08-09 20:07 ` Grant Likely
2007-08-09 22:30 ` Takashi Iwai
2007-08-09 18:17 ` Stephen Neuendorffer
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=1186688686.28843.61.camel@localhost \
--to=mls.joft@gmx.de \
--cc=alsa-devel@alsa-project.org \
--cc=linuxppc-embedded@ozlabs.org \
--cc=lorenz.kolb@lkmail.de \
--cc=tiwai@suse.de \
/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).