Header Files

For the above example, at least the following include files are necessary.

  #include <linux/init.h>
  #include <linux/pci.h>
  #include <linux/slab.h>
  #include <sound/core.h>
  #include <sound/initval.h>


where the last one is necessary only when module options are defined in the source file. If the code is split into several files, the files without module options don't need them.

In addition to these headers, you'll need <linux/interrupt.h> for interrupt handling, and <asm/io.h> for I/O access. If you use the mdelay() or udelay() functions, you'll need to include <linux/delay.h> too.

The ALSA interfaces like the PCM and control APIs are defined in other <sound/xxx.h> header files. They have to be included after <sound/core.h>.