Merge branch 'topic/ca0106-spdif-stream' into topic/ca0106
[pandora-kernel.git] / sound / pci / ca0106 / ca0106.h
index 75da174..14b8d9a 100644 (file)
 #define SPCS_WORD_LENGTH_20A   0x0000000a      /* Word Length 20 bit                           */
 #define SPCS_WORD_LENGTH_20    0x00000009      /* Word Length 20 bit (both 0xa and 0x9 are 20 bit) */
 #define SPCS_WORD_LENGTH_21    0x00000007      /* Word Length 21 bit                           */
-#define SPCS_WORD_LENGTH_21    0x00000007      /* Word Length 21 bit                           */
 #define SPCS_WORD_LENGTH_22    0x00000005      /* Word Length 22 bit                           */
 #define SPCS_WORD_LENGTH_23    0x00000003      /* Word Length 23 bit                           */
 #define SPCS_WORD_LENGTH_24    0x0000000b      /* Word Length 24 bit                           */
@@ -665,10 +664,14 @@ struct snd_ca0106_pcm {
 struct snd_ca0106_details {
         u32 serial;
         char * name;
-        int ac97;
-       int gpio_type;
-       int i2c_adc;
-       int spi_dac;
+       int ac97;       /* ac97 = 0 -> Select MIC, Line in, TAD in, AUX in.
+                          ac97 = 1 -> Default to AC97 in. */
+       int gpio_type;  /* gpio_type = 1 -> shared mic-in/line-in
+                          gpio_type = 2 -> shared side-out/line-in. */
+       int i2c_adc;    /* with i2c_adc=1, the driver adds some capture volume
+                          controls, phone, mic, line-in and aux. */
+       int spi_dac;    /* spi_dac=1 adds the mute switch for each analog
+                          output, front, rear, etc. */
 };
 
 // definition of the chip-specific record
@@ -687,11 +690,12 @@ struct snd_ca0106 {
        spinlock_t emu_lock;
 
        struct snd_ac97 *ac97;
-       struct snd_pcm *pcm;
+       struct snd_pcm *pcm[4];
 
        struct snd_ca0106_channel playback_channels[4];
        struct snd_ca0106_channel capture_channels[4];
-       u32 spdif_bits[4];             /* s/pdif out setup */
+       u32 spdif_bits[4];             /* s/pdif out default setup */
+       u32 spdif_str_bits[4];         /* s/pdif out per-stream setup */
        int spdif_enable;
        int capture_source;
        int i2c_capture_source;
@@ -704,6 +708,11 @@ struct snd_ca0106 {
        struct snd_ca_midi midi2;
 
        u16 spi_dac_reg[16];
+
+#ifdef CONFIG_PM
+#define NUM_SAVED_VOLUMES      9
+       unsigned int saved_vol[NUM_SAVED_VOLUMES];
+#endif
 };
 
 int snd_ca0106_mixer(struct snd_ca0106 *emu);
@@ -722,3 +731,11 @@ int snd_ca0106_i2c_write(struct snd_ca0106 *emu, u32 reg, u32 value);
 
 int snd_ca0106_spi_write(struct snd_ca0106 * emu,
                                   unsigned int data);
+
+#ifdef CONFIG_PM
+void snd_ca0106_mixer_suspend(struct snd_ca0106 *chip);
+void snd_ca0106_mixer_resume(struct snd_ca0106 *chip);
+#else
+#define snd_ca0106_mixer_suspend(chip) do { } while (0)
+#define snd_ca0106_mixer_resume(chip)  do { } while (0)
+#endif