Header Files

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

  #include <sound/driver.h>
  #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 codes are split to several files, the file without module options don't need them.

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

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