]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/pci/hda/hda_codec.h
ALSA: hda - No 'Headphone as Line-out' swich without line-outs
[linux-2.6-omap-h63xx.git] / sound / pci / hda / hda_codec.h
index 77064b0cb82122794d85159b9cd390527c5973b6..a70b181bbacedcb1d587280d1d59245e9eef00bd 100644 (file)
@@ -539,6 +539,16 @@ static inline void snd_array_init(struct snd_array *array, unsigned int size,
        array->alloc_align = align;
 }
 
+static inline void *snd_array_elem(struct snd_array *array, unsigned int idx)
+{
+       return array->list + idx * array->elem_size;
+}
+
+static inline unsigned int snd_array_index(struct snd_array *array, void *ptr)
+{
+       return (unsigned long)(ptr - array->list) / array->elem_size;
+}
+
 /*
  * Structures
  */
@@ -556,17 +566,17 @@ typedef u16 hda_nid_t;
 /* bus operators */
 struct hda_bus_ops {
        /* send a single command */
-       int (*command)(struct hda_codec *codec, hda_nid_t nid, int direct,
-                      unsigned int verb, unsigned int parm);
+       int (*command)(struct hda_bus *bus, unsigned int cmd);
        /* get a response from the last command */
-       unsigned int (*get_response)(struct hda_codec *codec);
+       unsigned int (*get_response)(struct hda_bus *bus);
        /* free the private data */
        void (*private_free)(struct hda_bus *);
        /* attach a PCM stream */
-       int (*attach_pcm)(struct hda_codec *codec, struct hda_pcm *pcm);
+       int (*attach_pcm)(struct hda_bus *bus, struct hda_codec *codec,
+                         struct hda_pcm *pcm);
 #ifdef CONFIG_SND_HDA_POWER_SAVE
        /* notify power-up/down from codec to controller */
-       void (*pm_notify)(struct hda_codec *codec);
+       void (*pm_notify)(struct hda_bus *bus);
 #endif
 };
 
@@ -607,6 +617,7 @@ struct hda_bus {
 
        /* misc op flags */
        unsigned int needs_damn_long_delay :1;
+       unsigned int shutdown :1;       /* being unloaded */
 };
 
 /*
@@ -719,6 +730,8 @@ struct hda_codec {
 
        /* detected preset */
        const struct hda_codec_preset *preset;
+       const char *name;       /* codec name */
+       const char *modelname;  /* model name for preset */
 
        /* set by patch */
        struct hda_codec_ops patch_ops;
@@ -738,6 +751,8 @@ struct hda_codec {
        hda_nid_t start_nid;
        u32 *wcaps;
 
+       struct snd_array mixers;        /* list of assigned mixer elements */
+
        struct hda_cache_rec amp_cache; /* cache for amp access */
        struct hda_cache_rec cmd_cache; /* cache for other commands */
 
@@ -747,7 +762,11 @@ struct hda_codec {
        unsigned int spdif_in_enable;   /* SPDIF input enable? */
        hda_nid_t *slave_dig_outs; /* optional digital out slave widgets */
 
+#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 */
+#endif
 
        /* misc flags */
        unsigned int spdif_status_reset :1; /* needs to toggle SPDIF for each
@@ -819,6 +838,7 @@ void snd_hda_codec_resume_cache(struct hda_codec *codec);
  * Mixer
  */
 int snd_hda_build_controls(struct hda_bus *bus);
+int snd_hda_codec_build_controls(struct hda_codec *codec);
 
 /*
  * PCM
@@ -850,6 +870,13 @@ int snd_hda_suspend(struct hda_bus *bus, pm_message_t state);
 int snd_hda_resume(struct hda_bus *bus);
 #endif
 
+/*
+ * get widget information
+ */
+const char *snd_hda_get_jack_connectivity(u32 cfg);
+const char *snd_hda_get_jack_type(u32 cfg);
+const char *snd_hda_get_jack_location(u32 cfg);
+
 /*
  * power saving
  */