[alsa-devel] [PATCH 1/4] ASoC: ak5702: add support for ak5702 -- 4ch ADC

Paolo Doz paolo.doz at gmail.com
Mon Nov 26 17:14:58 CET 2012

On Mon, Oct 29, 2012 at 7:17 PM, Mark Brown
<broonie at opensource.wolfsonmicro.com> wrote:
> On Mon, Oct 29, 2012 at 06:49:18PM +0100, Paolo Doz wrote:
> Please don't top post.
> > @Lars-Peter: thanks for the code review
> > @Mark: You're right. The original source code (that I found on the web)
> > was for kernel 2.6.35, and then I adapted it to work with kernel 3.2 series.
> > Can you suggest me a "state of the art" codec driver where can
> > I have a look at best practice?
> Anything that's been getting work recently...  wm8731 is probably
> similar to what you have there.
> > In the end the codec should work with alsa infrastructure available in
> > kernel 3.2 so I can test it's correctness directly on my hw.
> That's a *very* old kernel now, any mainline submissions should be
> against a current development kernel.

I'm rewriting the ak5702 codec driver following you suggestions.
>From you space should be possible to select input source. The codec
has 2 ADC with 2 differents inputs and another one shared by both

Inside the codec the input selection is made in the following way

8 bit register (ie ADC A)
bit 0 -> select left1 or left2
bit 1 -> select right1 or right2

bit2/3/4 other settings

bit5 -> if 1 select left5 otherwise select (left1 or left2) depending on bit0
bit6 -> if 1 select right5 otherwise select (right1 or rigth2) depending on bit1

Is there any SOC_ENUM that can be used to represent this situation? I
mean something like "Left1, Left2, Left5" ?

At the moment I have one SOC_ENUM to select "Left1, Left2" and another
for "Left1/2, Left5"


More information about the Alsa-devel mailing list