Commit | Line | Data |
---|---|---|
dfe66a18 JK |
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 | ||
0b00a561 JK |
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 | int snd_hdac_ext_bus_map_codec_to_link(struct hdac_ext_bus *bus, int addr); | |
51 | struct hdac_ext_link *snd_hdac_ext_bus_get_link(struct hdac_ext_bus *bus, | |
52 | const char *codec_name); | |
53 | ||
54 | enum hdac_ext_stream_type { | |
55 | HDAC_EXT_STREAM_TYPE_COUPLED = 0, | |
56 | HDAC_EXT_STREAM_TYPE_HOST, | |
57 | HDAC_EXT_STREAM_TYPE_LINK | |
58 | }; | |
59 | ||
60 | struct hdac_ext_link { | |
61 | struct hdac_bus *bus; | |
62 | int index; | |
63 | void __iomem *ml_addr; /* link output stream reg pointer */ | |
64 | u32 lcaps; /* link capablities */ | |
65 | u16 lsdiid; /* link sdi identifier */ | |
66 | struct list_head list; | |
67 | }; | |
68 | ||
69 | int snd_hdac_ext_bus_link_power_up(struct hdac_ext_link *link); | |
70 | int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *link); | |
71 | void snd_hdac_ext_link_set_stream_id(struct hdac_ext_link *link, | |
72 | int stream); | |
73 | void snd_hdac_ext_link_clear_stream_id(struct hdac_ext_link *link, | |
74 | int stream); | |
75 | ||
76 | /* update register macro */ | |
77 | #define snd_hdac_updatel(addr, reg, mask, val) \ | |
78 | writel(((readl(addr + reg) & ~(mask)) | (val)), \ | |
79 | addr + reg) | |
80 | ||
dfe66a18 | 81 | #endif /* __SOUND_HDAUDIO_EXT_H */ |