ALSA: hda - Fix init verbs of AD1884A mobile model
[safe/jmp/linux-2.6] / sound / pci / hda / hda_codec.h
index 43af18c..2fdecf4 100644 (file)
@@ -614,8 +614,8 @@ struct hda_bus {
 
        /* unsolicited event queue */
        struct hda_bus_unsolicited *unsol;
-
-       struct snd_info_entry *proc;
+       char workq_name[16];
+       struct workqueue_struct *workq; /* common workqueue for codecs */
 
        /* assigned PCMs */
        DECLARE_BITMAP(pcm_dev_bits, SNDRV_PCM_DEVICES);
@@ -642,6 +642,16 @@ struct hda_codec_preset {
        int (*patch)(struct hda_codec *codec);
 };
        
+struct hda_codec_preset_list {
+       const struct hda_codec_preset *preset;
+       struct module *owner;
+       struct list_head list;
+};
+
+/* initial hook */
+int snd_hda_add_codec_preset(struct hda_codec_preset_list *preset);
+int snd_hda_delete_codec_preset(struct hda_codec_preset_list *preset);
+
 /* ops set by the preset patch */
 struct hda_codec_ops {
        int (*build_controls)(struct hda_codec *codec);
@@ -729,12 +739,14 @@ struct hda_codec {
        hda_nid_t mfg;  /* MFG node id */
 
        /* ids */
+       u32 function_id;
        u32 vendor_id;
        u32 subsystem_id;
        u32 revision_id;
 
        /* detected preset */
        const struct hda_codec_preset *preset;
+       struct module *owner;
        const char *name;       /* codec name */
        const char *modelname;  /* model name for preset */
 
@@ -762,15 +774,19 @@ struct hda_codec {
        struct hda_cache_rec cmd_cache; /* cache for other commands */
 
        struct mutex spdif_mutex;
+       struct mutex control_mutex;
        unsigned int spdif_status;      /* IEC958 status bits */
        unsigned short spdif_ctls;      /* SPDIF control bits */
        unsigned int spdif_in_enable;   /* SPDIF input enable? */
        hda_nid_t *slave_dig_outs; /* optional digital out slave widgets */
+       struct snd_array init_pins;     /* initial (BIOS) pin configurations */
+       struct snd_array driver_pins;   /* pin configs set by codec parser */
 
 #ifdef CONFIG_SND_HDA_HWDEP
        struct snd_hwdep *hwdep;        /* assigned hwdep device */
        struct snd_array init_verbs;    /* additional init verbs */
        struct snd_array hints;         /* additional hints */
+       struct snd_array user_pins;     /* default pin configs to override */
 #endif
 
        /* misc flags */
@@ -778,6 +794,9 @@ struct hda_codec {
                                             * status change
                                             * (e.g. Realtek codecs)
                                             */
+       unsigned int pin_amp_workaround:1; /* pin out-amp takes index
+                                           * (e.g. Conexant codecs)
+                                           */
 #ifdef CONFIG_SND_HDA_POWER_SAVE
        unsigned int power_on :1;       /* current (global) power-state */
        unsigned int power_transition :1; /* power-state in transition */
@@ -802,7 +821,7 @@ enum {
 int snd_hda_bus_new(struct snd_card *card, const struct hda_bus_template *temp,
                    struct hda_bus **busp);
 int snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr,
-                     struct hda_codec **codecp);
+                     int do_init, struct hda_codec **codecp);
 
 /*
  * low level functions
@@ -843,6 +862,18 @@ void snd_hda_codec_resume_cache(struct hda_codec *codec);
 #define snd_hda_sequence_write_cache   snd_hda_sequence_write
 #endif
 
+/* the struct for codec->pin_configs */
+struct hda_pincfg {
+       hda_nid_t nid;
+       unsigned int cfg;
+};
+
+unsigned int snd_hda_codec_get_pincfg(struct hda_codec *codec, hda_nid_t nid);
+int snd_hda_codec_set_pincfg(struct hda_codec *codec, hda_nid_t nid,
+                            unsigned int cfg);
+int snd_hda_add_pincfg(struct hda_codec *codec, struct snd_array *list,
+                      hda_nid_t nid, unsigned int cfg); /* for hwdep */
+
 /*
  * Mixer
  */
@@ -898,4 +929,19 @@ static inline void snd_hda_power_down(struct hda_codec *codec) {}
 #define snd_hda_codec_needs_resume(codec) 1
 #endif
 
+/*
+ * Codec modularization
+ */
+
+/* Export symbols only for communication with codec drivers;
+ * When built in kernel, all HD-audio drivers are supposed to be statically
+ * linked to the kernel.  Thus, the symbols don't have to (or shouldn't) be
+ * exported unless it's built as a module.
+ */
+#ifdef MODULE
+#define EXPORT_SYMBOL_HDA(sym) EXPORT_SYMBOL_GPL(sym)
+#else
+#define EXPORT_SYMBOL_HDA(sym)
+#endif
+
 #endif /* __SOUND_HDA_CODEC_H */