-MODULE_AUTHOR("Laurent Canet <canetl@esiee.fr>");
-MODULE_DESCRIPTION("ALSA Harmony sound driver");
-MODULE_LICENSE("GPL");
-MODULE_CLASSES("{sound}");
-MODULE_DEVICES("{{ALSA,Harmony soundcard}}");
-
-#undef DEBUG
-#ifdef DEBUG
-# define DPRINTK printk
-#else
-# define DPRINTK(x,...)
-#endif
-
-#define PFX "harmony: "
-
-#define MAX_PCM_DEVICES 1
-#define MAX_PCM_SUBSTREAMS 4
-#define MAX_MIDI_DEVICES 0
-
-#define HARMONY_BUF_SIZE 4096
-#define MAX_BUFS 10
-#define MAX_BUFFER_SIZE (MAX_BUFS * HARMONY_BUF_SIZE)
-
-/* number of silence & graveyard buffers */
-#define GRAVEYARD_BUFS 3
-#define SILENCE_BUFS 3
-
-#define HARMONY_CNTL_C 0x80000000
-
-#define HARMONY_DSTATUS_PN 0x00000200
-#define HARMONY_DSTATUS_RN 0x00000002
-#define HARMONY_DSTATUS_IE 0x80000000
-
-#define HARMONY_DF_16BIT_LINEAR 0x00000000
-#define HARMONY_DF_8BIT_ULAW 0x00000001
-#define HARMONY_DF_8BIT_ALAW 0x00000002
-
-#define HARMONY_SS_MONO 0x00000000
-#define HARMONY_SS_STEREO 0x00000001
-
-/*
- * Channels Mask in mixer register
- * try some "reasonable" default gain values
- */
-
-#define HARMONY_GAIN_TOTAL_SILENCE 0x00F00FFF
-
-/* the following should be enough (mixer is
- * very sensible on harmony)
- */
-#define HARMONY_GAIN_DEFAULT 0x0F2FF082
-
-
-/* useless since only one card is supported ATM */
-static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
-static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;
-static int boot_devs;
-
-module_param_array(index, int, boot_devs, 0444);
-MODULE_PARM_DESC(index, "Index value for Sun CS4231 soundcard.");
-MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-module_param_array(id, charp, boot_devs, 0444);
-MODULE_PARM_DESC(id, "ID string for Sun CS4231 soundcard.");
-MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-module_param_array(enable, bool, boot_devs, 0444);
-MODULE_PARM_DESC(enable, "Enable Sun CS4231 soundcard.");
-MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-
-/* Register offset (from base hpa) */
-#define REG_ID 0x00
-#define REG_RESET 0x04
-#define REG_CNTL 0x08
-#define REG_GAINCTL 0x0C
-#define REG_PNXTADD 0x10
-#define REG_PCURADD 0x14
-#define REG_RNXTADD 0x18
-#define REG_RCURADD 0x1C
-#define REG_DSTATUS 0x20
-#define REG_OV 0x24
-#define REG_PIO 0x28
-#define REG_DIAG 0x3C
-
-/*
- * main harmony structure
- */
-
-typedef struct snd_card_harmony {
-
- /* spinlocks (To be done) */
- spinlock_t mixer_lock;
- spinlock_t control_lock;
-
- /* parameters */
- int irq;
- unsigned long hpa;
- int id;
- int rev;
-
- u32 current_gain;
- int data_format; /* HARMONY_DF_xx_BIT_xxx */
- int sample_rate; /* HARMONY_SR_xx_KHZ */
- int stereo_select; /* HARMONY_SS_MONO or HARMONY_SS_STEREO */
- int format_initialized;
-
- unsigned long ply_buffer;
- int ply_buf;
- int ply_count;
- int ply_size;
- int ply_stopped;
- int ply_total;
-
- unsigned long cap_buffer;
- int cap_buf;
- int cap_count;
- int cap_size;
- int cap_stopped;
- int cap_total;
-
- struct parisc_device *pa_dev;
-
- struct snd_dma_device dma_dev;
-
- /* the graveyard buffer is used as recording buffer when playback,
- * because harmony always want a buffer to put recorded data */
- struct snd_dma_buffer graveyard_dma;
- int graveyard_count;
-
- /* same thing for silence buffer */
- struct snd_dma_buffer silence_dma;
- int silence_count;
-
- /* alsa stuff */
- snd_card_t *card;
- snd_pcm_t *pcm;
- snd_pcm_substream_t *playback_substream;
- snd_pcm_substream_t *capture_substream;
- snd_info_entry_t *proc_entry;
-} snd_card_harmony_t;
-#define chip_t snd_card_harmony_t
-
-static snd_card_t *snd_harmony_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
-
-/* wait to be out of control mode */
-static inline void snd_harmony_wait_cntl(snd_card_harmony_t *harmony)
-{
- int timeout = 5000;
+#include "harmony.h"
+
+static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
+static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
+module_param(index, int, 0444);
+MODULE_PARM_DESC(index, "Index value for Harmony driver.");
+module_param(id, charp, 0444);
+MODULE_PARM_DESC(id, "ID string for Harmony driver.");
+
+
+static struct parisc_device_id snd_harmony_devtable[] = {
+ /* bushmaster / flounder */
+ { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0007A },
+ /* 712 / 715 */
+ { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0007B },
+ /* pace */
+ { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0007E },
+ /* outfield / coral II */
+ { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0007F },
+ { 0, }
+};