Merge branch 'topic/hda-ca0132-dsp' into for-next
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / sound / pci / hda / hda_codec.h
index c9f53bd587b05e7122f6be89dee4151969cedb73..6c592722efcd8a9f284cdc36d69e3b418907980e 100644 (file)
@@ -730,9 +730,10 @@ struct hda_codec_ops {
 
 /* record for amp information cache */
 struct hda_cache_head {
-       u32 key;                /* hash key */
+       u32 key:31;             /* hash key */
+       u32 dirty:1;
        u16 val;                /* assigned value */
-       u16 next;               /* next link; -1 = terminal */
+       u16 next;
 };
 
 struct hda_amp_info {
@@ -768,6 +769,7 @@ struct hda_pcm_stream {
        u32 rates;      /* supported rates */
        u64 formats;    /* supported formats (SNDRV_PCM_FMTBIT_) */
        unsigned int maxbps;    /* supported max. bit per sample */
+       const struct snd_pcm_chmap_elem *chmap; /* chmap to override */
        struct hda_pcm_ops ops;
 };
 
@@ -840,19 +842,21 @@ struct hda_codec {
        struct hda_cache_rec amp_cache; /* cache for amp access */
        struct hda_cache_rec cmd_cache; /* cache for other commands */
 
-       struct snd_array conn_lists;    /* connection-list array */
+       struct list_head conn_list;     /* linked-list of connection-list */
 
        struct mutex spdif_mutex;
        struct mutex control_mutex;
        struct mutex hash_mutex;
        struct snd_array spdif_out;
        unsigned int spdif_in_enable;   /* SPDIF input enable? */
+       int primary_dig_out_type;       /* primary digital out PCM type */
        const 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 */
        struct snd_array cvt_setups;    /* audio convert setups */
 
 #ifdef CONFIG_SND_HDA_HWDEP
+       struct mutex user_mutex;
        struct snd_hwdep *hwdep;        /* assigned hwdep device */
        struct snd_array init_verbs;    /* additional init verbs */
        struct snd_array hints;         /* additional hints */
@@ -874,12 +878,16 @@ struct hda_codec {
        unsigned int pins_shutup:1;     /* pins are shut up */
        unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */
        unsigned int no_jack_detect:1;  /* Machine has no jack-detection */
+       unsigned int inv_eapd:1; /* broken h/w: inverted EAPD control */
+       unsigned int inv_jack_detect:1; /* broken h/w: inverted detection bit */
        unsigned int pcm_format_first:1; /* PCM format must be set first */
        unsigned int epss:1;            /* supporting EPSS? */
+       unsigned int cached_write:1;    /* write only to caches */
 #ifdef CONFIG_PM
        unsigned int power_on :1;       /* current (global) power-state */
        unsigned int d3_stop_clk:1;     /* support D3 operation without BCLK */
        unsigned int pm_down_notified:1; /* PM notified to controller */
+       unsigned int in_pm:1;           /* suspend/resume being performed */
        int power_transition;   /* power-state in transition */
        int power_count;        /* current (global) power refcount */
        struct delayed_work power_work; /* delayed task for powerdown */
@@ -889,17 +897,31 @@ struct hda_codec {
        spinlock_t power_lock;
 #endif
 
+       /* filter the requested power state per nid */
+       unsigned int (*power_filter)(struct hda_codec *codec, hda_nid_t nid,
+                                    unsigned int power_state);
+
        /* codec-specific additional proc output */
        void (*proc_widget_hook)(struct snd_info_buffer *buffer,
                                 struct hda_codec *codec, hda_nid_t nid);
 
        /* jack detection */
        struct snd_array jacktbl;
+       unsigned long jackpoll_interval; /* In jiffies. Zero means no poll, rely on unsol events */
+       struct delayed_work jackpoll_work;
 
 #ifdef CONFIG_SND_HDA_INPUT_JACK
        /* jack detection */
        struct snd_array jacks;
 #endif
+
+       /* fix-up list */
+       int fixup_id;
+       const struct hda_fixup *fixup_list;
+       const char *fixup_name;
+
+       /* additional init verbs */
+       struct snd_array verbs;
 };
 
 /* direction */
@@ -938,6 +960,8 @@ snd_hda_get_num_conns(struct hda_codec *codec, hda_nid_t nid)
 }
 int snd_hda_get_raw_connections(struct hda_codec *codec, hda_nid_t nid,
                            hda_nid_t *conn_list, int max_conns);
+int snd_hda_get_conn_list(struct hda_codec *codec, hda_nid_t nid,
+                         const hda_nid_t **listp);
 int snd_hda_override_conn_list(struct hda_codec *codec, hda_nid_t nid, int nums,
                          const hda_nid_t *list);
 int snd_hda_get_conn_index(struct hda_codec *codec, hda_nid_t mux,
@@ -958,7 +982,6 @@ void snd_hda_sequence_write(struct hda_codec *codec,
 int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex);
 
 /* cached write */
-#ifdef CONFIG_PM
 int snd_hda_codec_write_cache(struct hda_codec *codec, hda_nid_t nid,
                              int direct, unsigned int verb, unsigned int parm);
 void snd_hda_sequence_write_cache(struct hda_codec *codec,
@@ -966,17 +989,14 @@ void snd_hda_sequence_write_cache(struct hda_codec *codec,
 int snd_hda_codec_update_cache(struct hda_codec *codec, hda_nid_t nid,
                              int direct, unsigned int verb, unsigned int parm);
 void snd_hda_codec_resume_cache(struct hda_codec *codec);
-#else
-#define snd_hda_codec_write_cache      snd_hda_codec_write
-#define snd_hda_codec_update_cache     snd_hda_codec_write
-#define snd_hda_sequence_write_cache   snd_hda_sequence_write
-#endif
+/* both for cmd & amp caches */
+void snd_hda_codec_flush_cache(struct hda_codec *codec);
 
 /* the struct for codec->pin_configs */
 struct hda_pincfg {
        hda_nid_t nid;
-       unsigned char ctrl;     /* current pin control value */
-       unsigned char pad;      /* reserved */
+       unsigned char ctrl;     /* original pin control value */
+       unsigned char target;   /* target pin control value */
        unsigned int cfg;       /* default configuration */
 };
 
@@ -1034,14 +1054,15 @@ unsigned int snd_hda_calc_stream_format(unsigned int rate,
 int snd_hda_is_supported_format(struct hda_codec *codec, hda_nid_t nid,
                                unsigned int format);
 
+extern const struct snd_pcm_chmap_elem snd_pcm_2_1_chmaps[];
+
 /*
  * Misc
  */
 void snd_hda_get_codec_name(struct hda_codec *codec, char *name, int namelen);
 void snd_hda_bus_reboot_notify(struct hda_bus *bus);
 void snd_hda_codec_set_power_to_all(struct hda_codec *codec, hda_nid_t fg,
-                                   unsigned int power_state,
-                                   bool eapd_workaround);
+                                   unsigned int power_state);
 
 int snd_hda_lock_devices(struct hda_bus *bus);
 void snd_hda_unlock_devices(struct hda_bus *bus);