summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_codec.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-03-03 01:22:59 +0300
committerTakashi Iwai <tiwai@suse.de>2015-03-23 15:17:02 +0300
commitd068ebc25e6e1360510ad8023fe7bca3dacd204e (patch)
tree982ba3c4c1aa5f1a647f505d1d0863b926fde605 /sound/pci/hda/hda_codec.h
parente3d280fc6d42017b2379503fbda83655a05294fe (diff)
downloadlinux-d068ebc25e6e1360510ad8023fe7bca3dacd204e.tar.xz
ALSA: hda - Move some codes up to hdac_bus struct
A few basic codes for communicating over HD-audio bus are moved to struct hdac_bus now. It has only command and get_response ops in addition to the unsolicited event handling. Note that the codec-side tracing support is disabled temporarily during this transition due to the code shuffling. It will be re-enabled later once when all pieces are settled down. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.h')
-rw-r--r--sound/pci/hda/hda_codec.h34
1 files changed, 10 insertions, 24 deletions
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index 31a9e10e5137..6efcb4ad6935 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -98,16 +98,6 @@ struct hda_bus_ops {
#endif
};
-/* unsolicited event handler */
-#define HDA_UNSOL_QUEUE_SIZE 64
-struct hda_bus_unsolicited {
- /* ring buffer */
- u32 queue[HDA_UNSOL_QUEUE_SIZE * 2];
- unsigned int rp, wp;
- /* workqueue */
- struct work_struct work;
-};
-
/*
* codec bus
*
@@ -115,6 +105,8 @@ struct hda_bus_unsolicited {
* A hda_bus contains several codecs in the list codec_list.
*/
struct hda_bus {
+ struct hdac_bus core;
+
struct snd_card *card;
void *private_data;
@@ -122,25 +114,14 @@ struct hda_bus {
const char *modelname;
struct hda_bus_ops ops;
- /* codec linked list */
- struct list_head codec_list;
- unsigned int num_codecs;
- /* link caddr -> codec */
- struct hda_codec *caddr_tbl[HDA_MAX_CODEC_ADDRESS + 1];
-
- struct mutex cmd_mutex;
struct mutex prepare_mutex;
- /* unsolicited event queue */
- struct hda_bus_unsolicited unsol;
-
/* assigned PCMs */
DECLARE_BITMAP(pcm_dev_bits, SNDRV_PCM_DEVICES);
/* misc op flags */
unsigned int needs_damn_long_delay :1;
unsigned int allow_bus_reset:1; /* allow bus reset at fatal error */
- unsigned int sync_write:1; /* sync after verb write */
/* status for codec/controller */
unsigned int shutdown :1; /* being unloaded */
unsigned int rirb_error:1; /* error in codec communication */
@@ -149,7 +130,6 @@ struct hda_bus {
unsigned int no_response_fallback:1; /* don't fallback at RIRB error */
int primary_dig_out_type; /* primary digital out PCM type */
- unsigned long codec_powered; /* bit flags of powered codecs */
};
/*
@@ -281,7 +261,6 @@ struct hda_codec {
struct hda_bus *bus;
struct snd_card *card;
unsigned int addr; /* codec addr*/
- struct list_head list; /* list point */
hda_nid_t afg; /* AFG node id */
hda_nid_t mfg; /* MFG node id */
@@ -413,6 +392,9 @@ struct hda_codec {
#define dev_to_hda_codec(_dev) container_of(_dev, struct hda_codec, core.dev)
#define hda_codec_dev(_dev) (&(_dev)->core.dev)
+#define list_for_each_codec(c, bus) \
+ list_for_each_entry(c, &(bus)->core.codec_list, core.list)
+
/* direction */
enum {
HDA_INPUT, HDA_OUTPUT
@@ -473,7 +455,11 @@ void snd_hda_sequence_write(struct hda_codec *codec,
const struct hda_verb *seq);
/* unsolicited event */
-int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex);
+static inline void
+snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex)
+{
+ snd_hdac_bus_queue_event(&bus->core, res, res_ex);
+}
/* cached write */
int snd_hda_codec_write_cache(struct hda_codec *codec, hda_nid_t nid,