[OLPC-devel] Re: ALSA interface for the analog input

Jim Gettys jg at laptop.org
Tue Jul 11 08:23:33 EDT 2006


On Tue, 2006-07-11 at 15:49 +0800, Jaya Kumar wrote:
> On 7/7/06, Jim Gettys <jg at laptop.org> wrote:
> > That begs an interesting question: we have to poke a register on the ADI
> > 1888, and also tell the embedded controller to do something, to enable
> > the analog input.
> >
> > Is this going to pose any difficulties?  One piece of it is potentially
> > generic, and the other is clearly very OLPC hardware specific....
> 
> No problems on the ALSA side. Here's my understanding:
> 
> . User decides to use sensor mode and clicks on something in the UI

Actually, we'll probably want to automate this in some fashion: an
application knows when it needs analog input.  The user may not have
that understanding (particularly younger children).  Asking them to put
the audio input into/out of a magic mode that will screw up regular
audio input is asking for trouble; it would often get left in the wrong
mode.

> . That UI app then has to do two things:
> *a- tell the EC to turn on MIC_AC (ie: bypass C35 and R25) [ OLPC specific ]
> *b- tell ALSA to disable VREFOUT and the high pass filter [ AD1888 specific ]

Exactly.

> . User connects the sensor device to the mic input jack
> . Done!
> . User clicks on UI to switch back into mic mode
> . UI does the opposite in *a and *b
> . Can connect to and use the standard mic again

It may be when the process that had the device open and set it into
analog mode closes the device that it gets reset automatically by the
device driver.

> 
> Details on *a:
> Based on the port IO sequence that Ray sent, I guess talking to the EC
> will be through cs5536 GPIO (LPC). There's a cs5536 gpio driver that
> shows up as a character device. The userspace app could use that
> interface to talk to the EC.

Ah, I didn't understand how that worked.  Thanks.  I haven't gone
through the 5536 manual in that level of detail.

> 
> Details on *b:
> Both the AD1888 specific VREFOUT and high pass filter bits are exposed
> via mixer controls that are set from user space. The UI app can either
> shell out amixer commands or use the snd_mixer_* API to unset the two
> controls which are surfaced as:
> "V_REFOUT Enable"
> "High Pass Filter Enable"
> 
> I hope this helps clarify things.
> 
> btw, the patches for this and the AD1888 suspend/resume fix have been
> merged into Linus's 2.6.18-rc1 tree. Aggressive suspend/resume is in
> the alsa tree and also akpm's -mm tree.

Thanks. Dave Woodhouse is setting up a git tree you'll be able to push
to for drivers you believe are stable that you want to see testing on;
we hope it will become the "canonical"  development kernel.  Right now,
everyone has to pull from N different trees to pull together a complete
system, which is error prone and time consuming.

> 
> Thanks,
> jaya
-- 
Jim Gettys
One Laptop Per Child





More information about the Devel mailing list