]> git.karo-electronics.de Git - karo-tx-linux.git/blob - include/sound/hdaudio_ext.h
ALSA: HDA: remove the unused function declaration
[karo-tx-linux.git] / include / sound / hdaudio_ext.h
1 #ifndef __SOUND_HDAUDIO_EXT_H
2 #define __SOUND_HDAUDIO_EXT_H
3
4 #include <sound/hdaudio.h>
5
6 /**
7  * hdac_ext_bus: HDAC extended bus for extended HDA caps
8  *
9  * @bus: hdac bus
10  * @num_streams: streams supported
11  * @ppcap: pp capabilities pointer
12  * @spbcap: SPIB capabilities pointer
13  * @mlcap: MultiLink capabilities pointer
14  * @gtscap: gts capabilities pointer
15  * @hlink_list: link list of HDA links
16  */
17 struct hdac_ext_bus {
18         struct hdac_bus bus;
19         int num_streams;
20         int idx;
21
22         void __iomem *ppcap;
23         void __iomem *spbcap;
24         void __iomem *mlcap;
25         void __iomem *gtscap;
26
27         struct list_head hlink_list;
28 };
29
30 int snd_hdac_ext_bus_init(struct hdac_ext_bus *sbus, struct device *dev,
31                       const struct hdac_bus_ops *ops,
32                       const struct hdac_io_ops *io_ops);
33
34 void snd_hdac_ext_bus_exit(struct hdac_ext_bus *sbus);
35 int snd_hdac_ext_bus_device_init(struct hdac_ext_bus *sbus, int addr);
36 void snd_hdac_ext_bus_device_exit(struct hdac_device *hdev);
37
38 #define ebus_to_hbus(ebus)      (&(ebus)->bus)
39 #define hbus_to_ebus(_bus) \
40         container_of(_bus, struct hdac_ext_bus, bus)
41
42 int snd_hdac_ext_bus_parse_capabilities(struct hdac_ext_bus *sbus);
43 void snd_hdac_ext_bus_ppcap_enable(struct hdac_ext_bus *chip, bool enable);
44 void snd_hdac_ext_bus_ppcap_int_enable(struct hdac_ext_bus *chip, bool enable);
45
46 void snd_hdac_ext_stream_spbcap_enable(struct hdac_ext_bus *chip,
47                                  bool enable, int index);
48
49 int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_ext_bus *bus);
50 struct hdac_ext_link *snd_hdac_ext_bus_get_link(struct hdac_ext_bus *bus,
51                                                 const char *codec_name);
52
53 enum hdac_ext_stream_type {
54         HDAC_EXT_STREAM_TYPE_COUPLED = 0,
55         HDAC_EXT_STREAM_TYPE_HOST,
56         HDAC_EXT_STREAM_TYPE_LINK
57 };
58
59 /**
60  * hdac_ext_stream: HDAC extended stream for extended HDA caps
61  *
62  * @hstream: hdac_stream
63  * @pphc_addr: processing pipe host stream pointer
64  * @pplc_addr: processing pipe link stream pointer
65  * @decoupled: stream host and link is decoupled
66  * @link_locked: link is locked
67  * @link_prepared: link is prepared
68  * link_substream: link substream
69  */
70 struct hdac_ext_stream {
71         struct hdac_stream hstream;
72
73         void __iomem *pphc_addr;
74         void __iomem *pplc_addr;
75
76         bool decoupled:1;
77         bool link_locked:1;
78         bool link_prepared;
79
80         struct snd_pcm_substream *link_substream;
81 };
82
83 #define hdac_stream(s)          (&(s)->hstream)
84 #define stream_to_hdac_ext_stream(s) \
85         container_of(s, struct hdac_ext_stream, hstream)
86
87 void snd_hdac_ext_stream_init(struct hdac_ext_bus *bus,
88                                 struct hdac_ext_stream *stream, int idx,
89                                 int direction, int tag);
90 struct hdac_ext_stream *snd_hdac_ext_stream_assign(struct hdac_ext_bus *bus,
91                                            struct snd_pcm_substream *substream,
92                                            int type);
93 void snd_hdac_ext_stream_release(struct hdac_ext_stream *azx_dev, int type);
94 void snd_hdac_ext_stream_decouple(struct hdac_ext_bus *bus,
95                                 struct hdac_ext_stream *azx_dev, bool decouple);
96 void snd_hdac_ext_stop_streams(struct hdac_ext_bus *sbus);
97
98 void snd_hdac_ext_link_stream_start(struct hdac_ext_stream *hstream);
99 void snd_hdac_ext_link_stream_clear(struct hdac_ext_stream *hstream);
100 void snd_hdac_ext_link_stream_reset(struct hdac_ext_stream *hstream);
101 int snd_hdac_ext_link_stream_setup(struct hdac_ext_stream *stream, int fmt);
102
103 struct hdac_ext_link {
104         struct hdac_bus *bus;
105         int index;
106         void __iomem *ml_addr; /* link output stream reg pointer */
107         u32 lcaps;   /* link capablities */
108         u16 lsdiid;  /* link sdi identifier */
109         struct list_head list;
110 };
111
112 int snd_hdac_ext_bus_link_power_up(struct hdac_ext_link *link);
113 int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *link);
114 void snd_hdac_ext_link_set_stream_id(struct hdac_ext_link *link,
115                                  int stream);
116 void snd_hdac_ext_link_clear_stream_id(struct hdac_ext_link *link,
117                                  int stream);
118
119 /* update register macro */
120 #define snd_hdac_updatel(addr, reg, mask, val)          \
121         writel(((readl(addr + reg) & ~(mask)) | (val)), \
122                 addr + reg)
123
124 #define snd_hdac_updatew(addr, reg, mask, val)          \
125         writew(((readw(addr + reg) & ~(mask)) | (val)), \
126                 addr + reg)
127
128 #endif /* __SOUND_HDAUDIO_EXT_H */