Lines Matching refs:hlink
84 struct hdac_ext_link *hlink; in snd_hdac_ext_bus_get_ml_capabilities() local
92 hlink = kzalloc_obj(*hlink); in snd_hdac_ext_bus_get_ml_capabilities()
93 if (!hlink) in snd_hdac_ext_bus_get_ml_capabilities()
95 hlink->index = idx; in snd_hdac_ext_bus_get_ml_capabilities()
96 hlink->bus = bus; in snd_hdac_ext_bus_get_ml_capabilities()
97 hlink->ml_addr = bus->mlcap + AZX_ML_BASE + in snd_hdac_ext_bus_get_ml_capabilities()
99 hlink->lcaps = readl(hlink->ml_addr + AZX_REG_ML_LCAP); in snd_hdac_ext_bus_get_ml_capabilities()
100 hlink->lsdiid = readw(hlink->ml_addr + AZX_REG_ML_LSDIID); in snd_hdac_ext_bus_get_ml_capabilities()
101 hlink->slcount = FIELD_GET(AZX_ML_HDA_LCAP_SLCOUNT, hlink->lcaps) + 1; in snd_hdac_ext_bus_get_ml_capabilities()
103 if (hdac_ext_link_alt(hlink)) { in snd_hdac_ext_bus_get_ml_capabilities()
104 leptr = readl(hlink->ml_addr + AZX_REG_ML_LEPTR); in snd_hdac_ext_bus_get_ml_capabilities()
105 hlink->id = FIELD_GET(AZX_REG_ML_LEPTR_ID, leptr); in snd_hdac_ext_bus_get_ml_capabilities()
109 hlink->ref_count = 1; in snd_hdac_ext_bus_get_ml_capabilities()
111 list_add_tail(&hlink->list, &bus->hlink_list); in snd_hdac_ext_bus_get_ml_capabilities()
126 struct hdac_ext_link *hlink; in snd_hdac_ext_link_free_all() local
129 hlink = list_first_entry(&bus->hlink_list, struct hdac_ext_link, list); in snd_hdac_ext_link_free_all()
130 list_del(&hlink->list); in snd_hdac_ext_link_free_all()
131 kfree(hlink); in snd_hdac_ext_link_free_all()
138 struct hdac_ext_link *hlink; in snd_hdac_ext_bus_get_hlink_by_id() local
140 list_for_each_entry(hlink, &bus->hlink_list, list) in snd_hdac_ext_bus_get_hlink_by_id()
141 if (hdac_ext_link_alt(hlink) && hlink->id == id) in snd_hdac_ext_bus_get_hlink_by_id()
142 return hlink; in snd_hdac_ext_bus_get_hlink_by_id()
156 struct hdac_ext_link *hlink; in snd_hdac_ext_bus_get_hlink_by_addr() local
158 list_for_each_entry(hlink, &bus->hlink_list, list) in snd_hdac_ext_bus_get_hlink_by_addr()
159 if (hlink->lsdiid & (0x1 << addr)) in snd_hdac_ext_bus_get_hlink_by_addr()
160 return hlink; in snd_hdac_ext_bus_get_hlink_by_addr()
186 static int check_hdac_link_power_active(struct hdac_ext_link *hlink, bool enable) in check_hdac_link_power_active() argument
196 val = readl(hlink->ml_addr + AZX_REG_ML_LCTL); in check_hdac_link_power_active()
214 int snd_hdac_ext_bus_link_power_up(struct hdac_ext_link *hlink) in snd_hdac_ext_bus_link_power_up() argument
216 snd_hdac_updatel(hlink->ml_addr, AZX_REG_ML_LCTL, in snd_hdac_ext_bus_link_power_up()
219 return check_hdac_link_power_active(hlink, true); in snd_hdac_ext_bus_link_power_up()
227 int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *hlink) in snd_hdac_ext_bus_link_power_down() argument
229 snd_hdac_updatel(hlink->ml_addr, AZX_REG_ML_LCTL, AZX_ML_LCTL_SPA, 0); in snd_hdac_ext_bus_link_power_down()
231 return check_hdac_link_power_active(hlink, false); in snd_hdac_ext_bus_link_power_down()
241 struct hdac_ext_link *hlink = NULL; in snd_hdac_ext_bus_link_power_up_all() local
244 list_for_each_entry(hlink, &bus->hlink_list, list) { in snd_hdac_ext_bus_link_power_up_all()
245 ret = snd_hdac_ext_bus_link_power_up(hlink); in snd_hdac_ext_bus_link_power_up_all()
260 struct hdac_ext_link *hlink = NULL; in snd_hdac_ext_bus_link_power_down_all() local
263 list_for_each_entry(hlink, &bus->hlink_list, list) { in snd_hdac_ext_bus_link_power_down_all()
264 ret = snd_hdac_ext_bus_link_power_down(hlink); in snd_hdac_ext_bus_link_power_down_all()
298 struct hdac_ext_link *hlink) in snd_hdac_ext_bus_link_get() argument
309 if (++hlink->ref_count == 1) { in snd_hdac_ext_bus_link_get()
315 ret = snd_hdac_ext_bus_link_power_up(hlink); in snd_hdac_ext_bus_link_get()
320 snd_hdac_updatew(hlink->ml_addr, AZX_REG_ML_LOSIDV, in snd_hdac_ext_bus_link_get()
339 struct hdac_ext_link *hlink) in snd_hdac_ext_bus_link_put() argument
351 if (--hlink->ref_count == 0) { in snd_hdac_ext_bus_link_put()
352 ret = snd_hdac_ext_bus_link_power_down(hlink); in snd_hdac_ext_bus_link_put()
378 struct hdac_ext_link *hlink = in hdac_ext_codec_link_up() local
381 if (hlink) in hdac_ext_codec_link_up()
382 snd_hdac_ext_bus_link_get(codec->bus, hlink); in hdac_ext_codec_link_up()
388 struct hdac_ext_link *hlink = in hdac_ext_codec_link_down() local
391 if (hlink) in hdac_ext_codec_link_down()
392 snd_hdac_ext_bus_link_put(codec->bus, hlink); in hdac_ext_codec_link_down()