Lines Matching refs:hlink

83 	struct hdac_ext_link *hlink;
90 hlink = kzalloc(sizeof(*hlink), GFP_KERNEL);
91 if (!hlink)
93 hlink->index = idx;
94 hlink->bus = bus;
95 hlink->ml_addr = bus->mlcap + AZX_ML_BASE +
97 hlink->lcaps = readl(hlink->ml_addr + AZX_REG_ML_LCAP);
98 hlink->lsdiid = readw(hlink->ml_addr + AZX_REG_ML_LSDIID);
101 hlink->ref_count = 1;
103 list_add_tail(&hlink->list, &bus->hlink_list);
118 struct hdac_ext_link *hlink;
121 hlink = list_first_entry(&bus->hlink_list, struct hdac_ext_link, list);
122 list_del(&hlink->list);
123 kfree(hlink);
129 * snd_hdac_ext_bus_get_hlink_by_addr - get hlink at specified address
130 * @bus: hlink's parent bus device
133 * Returns hlink object or NULL if matching hlink is not found.
137 struct hdac_ext_link *hlink;
139 list_for_each_entry(hlink, &bus->hlink_list, list)
140 if (hlink->lsdiid & (0x1 << addr))
141 return hlink;
147 * snd_hdac_ext_bus_get_hlink_by_name - get hlink based on codec name
167 static int check_hdac_link_power_active(struct hdac_ext_link *hlink, bool enable)
177 val = readl(hlink->ml_addr + AZX_REG_ML_LCTL);
193 * @hlink: HD-audio extended link
195 int snd_hdac_ext_bus_link_power_up(struct hdac_ext_link *hlink)
197 snd_hdac_updatel(hlink->ml_addr, AZX_REG_ML_LCTL,
200 return check_hdac_link_power_active(hlink, true);
206 * @hlink: HD-audio extended link
208 int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *hlink)
210 snd_hdac_updatel(hlink->ml_addr, AZX_REG_ML_LCTL, AZX_ML_LCTL_SPA, 0);
212 return check_hdac_link_power_active(hlink, false);
222 struct hdac_ext_link *hlink = NULL;
225 list_for_each_entry(hlink, &bus->hlink_list, list) {
226 ret = snd_hdac_ext_bus_link_power_up(hlink);
241 struct hdac_ext_link *hlink = NULL;
244 list_for_each_entry(hlink, &bus->hlink_list, list) {
245 ret = snd_hdac_ext_bus_link_power_down(hlink);
279 struct hdac_ext_link *hlink)
290 if (++hlink->ref_count == 1) {
296 ret = snd_hdac_ext_bus_link_power_up(hlink);
301 snd_hdac_updatew(hlink->ml_addr, AZX_REG_ML_LOSIDV,
321 struct hdac_ext_link *hlink)
333 if (--hlink->ref_count == 0) {
334 ret = snd_hdac_ext_bus_link_power_down(hlink);
361 struct hdac_ext_link *hlink =
364 if (hlink)
365 snd_hdac_ext_bus_link_get(codec->bus, hlink);
371 struct hdac_ext_link *hlink =
374 if (hlink)
375 snd_hdac_ext_bus_link_put(codec->bus, hlink);