Merge branch 'master' of git://oak/home/sfr/kernels/iseries/work
[pandora-kernel.git] / include / sound / emu10k1.h
index d14c543..892e310 100644 (file)
@@ -33,6 +33,7 @@
 #include <sound/pcm-indirect.h>
 #include <sound/timer.h>
 #include <linux/interrupt.h>
+#include <linux/mutex.h>
 #include <asm/io.h>
 
 /* ------------------- DEFINES -------------------- */
 #define A_IOCFG_GPOUT0         0x0044          /* analog/digital                               */
 #define A_IOCFG_DISABLE_ANALOG 0x0040          /* = 'enable' for Audigy2 (chiprev=4)           */
 #define A_IOCFG_ENABLE_DIGITAL 0x0004
+#define A_IOCFG_ENABLE_DIGITAL_AUDIGY4 0x0080
 #define A_IOCFG_UNKNOWN_20      0x0020
 #define A_IOCFG_DISABLE_AC97_FRONT      0x0080  /* turn off ac97 front -> front (10k2.1)       */
 #define A_IOCFG_GPOUT1         0x0002          /* IR? drive's internal bypass (?)              */
@@ -1022,7 +1024,7 @@ struct snd_emu10k1_fx8010 {
        int gpr_size;                   /* size of allocated GPR controls */
        int gpr_count;                  /* count of used kcontrols */
        struct list_head gpr_ctl;       /* GPR controls */
-       struct semaphore lock;
+       struct mutex lock;
        struct snd_emu10k1_fx8010_pcm pcm[8];
        spinlock_t irq_lock;
        struct snd_emu10k1_fx8010_irq *irq_handlers;
@@ -1061,6 +1063,10 @@ struct snd_emu_chip_details {
        unsigned char spdif_bug;    /* Has Spdif phasing bug */
        unsigned char ac97_chip;    /* Has an AC97 chip: 1 = mandatory, 2 = optional */
        unsigned char ecard;        /* APS EEPROM */
+       unsigned char emu1212m;     /* EMU 1212m card */
+       unsigned char spi_dac;      /* SPI interface for DAC */
+       unsigned char i2c_adc;      /* I2C interface for ADC */
+       unsigned char adc_1361t;    /* Use Philips 1361T ADC */
        const char *driver;
        const char *name;
        const char *id;         /* for backward compatibility - can be NULL if not needed */
@@ -1071,7 +1077,8 @@ struct snd_emu10k1 {
 
        unsigned long port;                     /* I/O port number */
        unsigned int tos_link: 1,               /* tos link detected */
-           rear_ac97: 1;                       /* rear channels are on AC'97 */
+               rear_ac97: 1,                   /* rear channels are on AC'97 */
+               enable_ir: 1;
        /* Contains profile of card capabilities */
        const struct snd_emu_chip_details *card_capabilities;
        unsigned int audigy;                    /* is Audigy? */
@@ -1108,6 +1115,7 @@ struct snd_emu10k1 {
        struct snd_pcm *pcm;
        struct snd_pcm *pcm_mic;
        struct snd_pcm *pcm_efx;
+       struct snd_pcm *pcm_multi;
        struct snd_pcm *pcm_p16v;
 
        spinlock_t synth_lock;
@@ -1117,7 +1125,6 @@ struct snd_emu10k1 {
        spinlock_t reg_lock;
        spinlock_t emu_lock;
        spinlock_t voice_lock;
-       struct semaphore ptb_lock;
 
        struct snd_emu10k1_voice voices[NUM_G];
        struct snd_emu10k1_voice p16v_voices[4];
@@ -1153,6 +1160,17 @@ struct snd_emu10k1 {
 
        unsigned int efx_voices_mask[2];
        unsigned int next_free_voice;
+
+#ifdef CONFIG_PM
+       unsigned int *saved_ptr;
+       unsigned int *saved_gpr;
+       unsigned int *tram_val_saved;
+       unsigned int *tram_addr_saved;
+       unsigned int *saved_icode;
+       unsigned int *p16v_saved;
+       unsigned int saved_a_iocfg, saved_hcfg;
+#endif
+
 };
 
 int snd_emu10k1_create(struct snd_card *card,
@@ -1178,17 +1196,18 @@ int snd_emu10k1_fx8010_new(struct snd_emu10k1 *emu, int device, struct snd_hwdep
 
 irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
-/* initialization */
 void snd_emu10k1_voice_init(struct snd_emu10k1 * emu, int voice);
 int snd_emu10k1_init_efx(struct snd_emu10k1 *emu);
 void snd_emu10k1_free_efx(struct snd_emu10k1 *emu);
 int snd_emu10k1_fx8010_tram_setup(struct snd_emu10k1 *emu, u32 size);
+int snd_emu10k1_done(struct snd_emu10k1 * emu);
 
 /* I/O functions */
 unsigned int snd_emu10k1_ptr_read(struct snd_emu10k1 * emu, unsigned int reg, unsigned int chn);
 void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data);
 unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, unsigned int reg, unsigned int chn);
 void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data);
+int snd_emu10k1_spi_write(struct snd_emu10k1 * emu, unsigned int data);
 unsigned int snd_emu10k1_efx_read(struct snd_emu10k1 *emu, unsigned int pc);
 void snd_emu10k1_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb);
 void snd_emu10k1_intr_disable(struct snd_emu10k1 *emu, unsigned int intrenb);
@@ -1206,6 +1225,20 @@ unsigned short snd_emu10k1_ac97_read(struct snd_ac97 *ac97, unsigned short reg);
 void snd_emu10k1_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short data);
 unsigned int snd_emu10k1_rate_to_pitch(unsigned int rate);
 
+#ifdef CONFIG_PM
+void snd_emu10k1_suspend_regs(struct snd_emu10k1 *emu);
+void snd_emu10k1_resume_init(struct snd_emu10k1 *emu);
+void snd_emu10k1_resume_regs(struct snd_emu10k1 *emu);
+int snd_emu10k1_efx_alloc_pm_buffer(struct snd_emu10k1 *emu);
+void snd_emu10k1_efx_free_pm_buffer(struct snd_emu10k1 *emu);
+void snd_emu10k1_efx_suspend(struct snd_emu10k1 *emu);
+void snd_emu10k1_efx_resume(struct snd_emu10k1 *emu);
+int snd_p16v_alloc_pm_buffer(struct snd_emu10k1 *emu);
+void snd_p16v_free_pm_buffer(struct snd_emu10k1 *emu);
+void snd_p16v_suspend(struct snd_emu10k1 *emu);
+void snd_p16v_resume(struct snd_emu10k1 *emu);
+#endif
+
 /* memory allocation */
 struct snd_util_memblk *snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *substream);
 int snd_emu10k1_free_pages(struct snd_emu10k1 *emu, struct snd_util_memblk *blk);
@@ -1491,6 +1524,10 @@ struct snd_emu10k1_fx8010_control_gpr {
        unsigned int value[32];         /* initial values */
        unsigned int min;               /* minimum range */
        unsigned int max;               /* maximum range */
+       union {
+               snd_kcontrol_tlv_rw_t *c;
+               unsigned int *p;
+       } tlv;
        unsigned int translation;       /* translation type (EMU10K1_GPR_TRANSLATION*) */
 };