Lines Matching defs:hlink
84 struct hdac_ext_link *hlink;
92 hlink = kzalloc(sizeof(*hlink), GFP_KERNEL);
93 if (!hlink)
95 hlink->index = idx;
96 hlink->bus = bus;
97 hlink->ml_addr = bus->mlcap + AZX_ML_BASE +
99 hlink->lcaps = readl(hlink->ml_addr + AZX_REG_ML_LCAP);
100 hlink->lsdiid = readw(hlink->ml_addr + AZX_REG_ML_LSDIID);
101 hlink->slcount = FIELD_GET(AZX_ML_HDA_LCAP_SLCOUNT, hlink->lcaps) + 1;
103 if (hdac_ext_link_alt(hlink)) {
104 leptr = readl(hlink->ml_addr + AZX_REG_ML_LEPTR);
105 hlink->id = FIELD_GET(AZX_REG_ML_LEPTR_ID, leptr);
109 hlink->ref_count = 1;
111 list_add_tail(&hlink->list, &bus->hlink_list);
126 struct hdac_ext_link *hlink;
129 hlink = list_first_entry(&bus->hlink_list, struct hdac_ext_link, list);
130 list_del(&hlink->list);
131 kfree(hlink);
138 struct hdac_ext_link *hlink;
140 list_for_each_entry(hlink, &bus->hlink_list, list)
141 if (hdac_ext_link_alt(hlink) && hlink->id == id)
142 return hlink;
148 * snd_hdac_ext_bus_get_hlink_by_addr - get hlink at specified address
149 * @bus: hlink's parent bus device
152 * Returns hlink object or NULL if matching hlink is not found.
156 struct hdac_ext_link *hlink;
158 list_for_each_entry(hlink, &bus->hlink_list, list)
159 if (hlink->lsdiid & (0x1 << addr))
160 return hlink;
166 * snd_hdac_ext_bus_get_hlink_by_name - get hlink based on codec name
186 static int check_hdac_link_power_active(struct hdac_ext_link *hlink, bool enable)
196 val = readl(hlink->ml_addr + AZX_REG_ML_LCTL);
212 * @hlink: HD-audio extended link
214 int snd_hdac_ext_bus_link_power_up(struct hdac_ext_link *hlink)
216 snd_hdac_updatel(hlink->ml_addr, AZX_REG_ML_LCTL,
219 return check_hdac_link_power_active(hlink, true);
225 * @hlink: HD-audio extended link
227 int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *hlink)
229 snd_hdac_updatel(hlink->ml_addr, AZX_REG_ML_LCTL, AZX_ML_LCTL_SPA, 0);
231 return check_hdac_link_power_active(hlink, false);
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_up(hlink);
260 struct hdac_ext_link *hlink = NULL;
263 list_for_each_entry(hlink, &bus->hlink_list, list) {
264 ret = snd_hdac_ext_bus_link_power_down(hlink);
298 struct hdac_ext_link *hlink)
309 if (++hlink->ref_count == 1) {
315 ret = snd_hdac_ext_bus_link_power_up(hlink);
320 snd_hdac_updatew(hlink->ml_addr, AZX_REG_ML_LOSIDV,
339 struct hdac_ext_link *hlink)
351 if (--hlink->ref_count == 0) {
352 ret = snd_hdac_ext_bus_link_power_down(hlink);
378 struct hdac_ext_link *hlink =
381 if (hlink)
382 snd_hdac_ext_bus_link_get(codec->bus, hlink);
388 struct hdac_ext_link *hlink =
391 if (hlink)
392 snd_hdac_ext_bus_link_put(codec->bus, hlink);