At Thu, 28 Jun 2012 19:06:07 +0530,
Laxman Dewangan wrote:
As Lars suggested, a simple ifdef should suffice for now.Ooh no. :-( I had taken the idea from snd_dmaengine_pcm driver.Then how about this?Way too much hustles than necessary...
create new file and header for snd-pcm-writecombine-buffer.c/.h and put
this in sound/core.
Select this file compilation through config SND_PCM_WRITECOMBINE_BUFFER
which will be select this config through sound/soc/xxx/Kconfig if they
want to use.
This will provide three apis: new, free and mmap.
Bit I like to hear simple way which solves the purpose.
With the upcoming generic dma_mmap_writecombine() stuff, it'd be even
simpler in future.
But, still we need to be careful about this. As mentioned, there is
no flag to know the possibility of writecombine mmap beforehand.
It'd be nice if we have either a compile-time or a run-time flag /
function to check that. Then the driver can also expose the mmap
capability to user-space depending on the flag.