openvortex-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Openvortex-dev] Re: Aureal ALSA-kernel migration.


From: Jeff Muizelaar
Subject: Re: [Openvortex-dev] Re: Aureal ALSA-kernel migration.
Date: Tue, 3 Feb 2004 18:39:20 -0500
User-agent: Mutt/1.3.28i

> but a serious one is 
> 
> - au88x0_*.c have global functions vortex_*().
> 
> when you build multiple au88x0 drivers into kernel statically, they
> will conflict with each other, because each au88[123]0_* includes the
> same au88x0_* file.
> 
> i haven't notice this because alsa-drivers are supposed to be
> modules...
> 
> 
> to solve this situation, we'll need either:
> 
> - rename each function to a unique name for the card (maybe with the
>   help of macro?)

The best way to do this that I can think of is something like:

#define vortex_fn(a, b)   b ## a
used like:

int vortex_fn(do_somthing, CHIP)(int a, int b) {
        ...
}

expanding to:

int au8830dosomething(int a, int b){
        ...
}


this is not very nice....

> 
> - make them all static and implement as callbacks
> 
> - make the h/w specific functions as callback functions (i.e. hwread,
>   hwrite, etc), and each function calls these callbacks.

Yeah I think this is the prefered way, but a lot of work/redesign.

A 4th way of doing it would be to make all the functions static and then
include everything into one file...

#include "au88x0_core.c"
#include "au88x0_pcm.c"
etc.

This is probably the easiest way to do things, in the short term with a
gradual transistion over to something with hardware specific callbacks.

I have attached a rough patch that basically does what I described above.

-Jeff

Attachment: static.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]