]> err.no Git - linux-2.6/blobdiff - sound/pci/oxygen/oxygen.h
Merge branch 'linus' into core/printk
[linux-2.6] / sound / pci / oxygen / oxygen.h
index a10c37788059b11db071eaf6a2f3698d155e30bc..a71c6e059260543c08b172f4fd71e3bdd0f5eef8 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <linux/mutex.h>
 #include <linux/spinlock.h>
+#include <linux/wait.h>
 #include <linux/workqueue.h>
 #include "oxygen_regs.h"
 
 #define PCM_AC97       5
 #define PCM_COUNT      6
 
+/* model-specific configuration of outputs/inputs */
+#define PLAYBACK_0_TO_I2S      0x001
+#define PLAYBACK_1_TO_SPDIF    0x004
+#define PLAYBACK_2_TO_AC97_1   0x008
+#define CAPTURE_0_FROM_I2S_1   0x010
+#define CAPTURE_0_FROM_I2S_2   0x020
+#define CAPTURE_1_FROM_SPDIF   0x080
+#define CAPTURE_2_FROM_I2S_2   0x100
+#define CAPTURE_2_FROM_AC97_1  0x200
+
 enum {
        CONTROL_SPDIF_PCM,
        CONTROL_SPDIF_INPUT_BITS,
+       CONTROL_MIC_CAPTURE_SWITCH,
+       CONTROL_LINE_CAPTURE_SWITCH,
+       CONTROL_CD_CAPTURE_SWITCH,
+       CONTROL_AUX_CAPTURE_SWITCH,
        CONTROL_COUNT
 };
 
@@ -30,7 +45,9 @@ enum {
 struct pci_dev;
 struct snd_card;
 struct snd_pcm_substream;
+struct snd_pcm_hardware;
 struct snd_pcm_hw_params;
+struct snd_kcontrol_new;
 struct snd_rawmidi;
 struct oxygen_model;
 
@@ -43,6 +60,7 @@ struct oxygen {
        struct snd_rawmidi *midi;
        int irq;
        const struct oxygen_model *model;
+       void *model_data;
        unsigned int interrupt_mask;
        u8 dac_volume[8];
        u8 dac_mute;
@@ -50,14 +68,16 @@ struct oxygen {
        u8 pcm_running;
        u8 dac_routing;
        u8 spdif_playback_enable;
-       u8 ak4396_reg1;
        u8 revision;
-       u8 has_2nd_ac97_codec;
+       u8 has_ac97_0;
+       u8 has_ac97_1;
        u32 spdif_bits;
        u32 spdif_pcm_bits;
        struct snd_pcm_substream *streams[PCM_COUNT];
        struct snd_kcontrol *controls[CONTROL_COUNT];
        struct work_struct spdif_input_bits_work;
+       struct work_struct gpio_work;
+       wait_queue_head_t ac97_waitqueue;
 };
 
 struct oxygen_model {
@@ -66,18 +86,30 @@ struct oxygen_model {
        const char *chip;
        struct module *owner;
        void (*init)(struct oxygen *chip);
+       int (*control_filter)(struct snd_kcontrol_new *template);
        int (*mixer_init)(struct oxygen *chip);
        void (*cleanup)(struct oxygen *chip);
+       void (*pcm_hardware_filter)(unsigned int channel,
+                                   struct snd_pcm_hardware *hardware);
        void (*set_dac_params)(struct oxygen *chip,
                               struct snd_pcm_hw_params *params);
        void (*set_adc_params)(struct oxygen *chip,
                               struct snd_pcm_hw_params *params);
        void (*update_dac_volume)(struct oxygen *chip);
        void (*update_dac_mute)(struct oxygen *chip);
+       void (*gpio_changed)(struct oxygen *chip);
+       void (*ac97_switch)(struct oxygen *chip,
+                           unsigned int reg, unsigned int mute);
        const unsigned int *dac_tlv;
-       u8 record_from_dma_b;
-       u8 cd_in_from_video_in;
-       u8 dac_minimum_volume;
+       size_t model_data_size;
+       unsigned int pcm_dev_cfg;
+       u8 dac_channels;
+       u8 dac_volume_min;
+       u8 dac_volume_max;
+       u8 misc_flags;
+       u8 function_flags;
+       u16 dac_i2s_format;
+       u16 adc_i2s_format;
 };
 
 /* oxygen_lib.c */
@@ -119,6 +151,7 @@ void oxygen_write_ac97_masked(struct oxygen *chip, unsigned int codec,
                              unsigned int index, u16 data, u16 mask);
 
 void oxygen_write_spi(struct oxygen *chip, u8 control, unsigned int data);
+void oxygen_write_i2c(struct oxygen *chip, u8 device, u8 map, u8 data);
 
 static inline void oxygen_set_bits8(struct oxygen *chip,
                                    unsigned int reg, u8 value)