Lines Matching refs:bus

28 void snd_hdac_ext_bus_ppcap_enable(struct hdac_bus *bus, bool enable)  in snd_hdac_ext_bus_ppcap_enable()  argument
31 if (!bus->ppcap) { in snd_hdac_ext_bus_ppcap_enable()
32 dev_err(bus->dev, "Address of PP capability is NULL"); in snd_hdac_ext_bus_ppcap_enable()
37 snd_hdac_updatel(bus->ppcap, AZX_REG_PP_PPCTL, in snd_hdac_ext_bus_ppcap_enable()
40 snd_hdac_updatel(bus->ppcap, AZX_REG_PP_PPCTL, in snd_hdac_ext_bus_ppcap_enable()
50 void snd_hdac_ext_bus_ppcap_int_enable(struct hdac_bus *bus, bool enable) in snd_hdac_ext_bus_ppcap_int_enable() argument
53 if (!bus->ppcap) { in snd_hdac_ext_bus_ppcap_int_enable()
54 dev_err(bus->dev, "Address of PP capability is NULL\n"); in snd_hdac_ext_bus_ppcap_int_enable()
59 snd_hdac_updatel(bus->ppcap, AZX_REG_PP_PPCTL, in snd_hdac_ext_bus_ppcap_int_enable()
62 snd_hdac_updatel(bus->ppcap, AZX_REG_PP_PPCTL, in snd_hdac_ext_bus_ppcap_int_enable()
80 int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_bus *bus) in snd_hdac_ext_bus_get_ml_capabilities() argument
87 link_count = readl(bus->mlcap + AZX_REG_ML_MLCD) + 1; in snd_hdac_ext_bus_get_ml_capabilities()
89 dev_dbg(bus->dev, "In %s Link count: %d\n", __func__, link_count); 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()
111 list_add_tail(&hlink->list, &bus->hlink_list); in snd_hdac_ext_bus_get_ml_capabilities()
124 void snd_hdac_ext_link_free_all(struct hdac_bus *bus) in snd_hdac_ext_link_free_all() argument
128 while (!list_empty(&bus->hlink_list)) { in snd_hdac_ext_link_free_all()
129 hlink = list_first_entry(&bus->hlink_list, struct hdac_ext_link, list); in snd_hdac_ext_link_free_all()
136 struct hdac_ext_link *snd_hdac_ext_bus_get_hlink_by_id(struct hdac_bus *bus, u32 id) in snd_hdac_ext_bus_get_hlink_by_id() argument
140 list_for_each_entry(hlink, &bus->hlink_list, list) in snd_hdac_ext_bus_get_hlink_by_id()
154 struct hdac_ext_link *snd_hdac_ext_bus_get_hlink_by_addr(struct hdac_bus *bus, int addr) in snd_hdac_ext_bus_get_hlink_by_addr() argument
158 list_for_each_entry(hlink, &bus->hlink_list, list) in snd_hdac_ext_bus_get_hlink_by_addr()
170 struct hdac_ext_link *snd_hdac_ext_bus_get_hlink_by_name(struct hdac_bus *bus, in snd_hdac_ext_bus_get_hlink_by_name() argument
177 if (bus->idx != bus_idx) in snd_hdac_ext_bus_get_hlink_by_name()
182 return snd_hdac_ext_bus_get_hlink_by_addr(bus, addr); in snd_hdac_ext_bus_get_hlink_by_name()
239 int snd_hdac_ext_bus_link_power_up_all(struct hdac_bus *bus) in snd_hdac_ext_bus_link_power_up_all() argument
244 list_for_each_entry(hlink, &bus->hlink_list, list) { in snd_hdac_ext_bus_link_power_up_all()
258 int snd_hdac_ext_bus_link_power_down_all(struct hdac_bus *bus) in snd_hdac_ext_bus_link_power_down_all() argument
263 list_for_each_entry(hlink, &bus->hlink_list, list) { in snd_hdac_ext_bus_link_power_down_all()
297 int snd_hdac_ext_bus_link_get(struct hdac_bus *bus, in snd_hdac_ext_bus_link_get() argument
303 guard(mutex)(&bus->lock); in snd_hdac_ext_bus_link_get()
310 if (!bus->cmd_dma_state) { in snd_hdac_ext_bus_link_get()
311 snd_hdac_bus_init_cmd_io(bus); in snd_hdac_ext_bus_link_get()
312 bus->cmd_dma_state = true; in snd_hdac_ext_bus_link_get()
327 codec_mask = snd_hdac_chip_readw(bus, STATESTS); in snd_hdac_ext_bus_link_get()
328 dev_dbg(bus->dev, "codec_mask = 0x%lx\n", codec_mask); in snd_hdac_ext_bus_link_get()
329 snd_hdac_chip_writew(bus, STATESTS, codec_mask); in snd_hdac_ext_bus_link_get()
330 if (!bus->codec_mask) in snd_hdac_ext_bus_link_get()
331 bus->codec_mask = codec_mask; in snd_hdac_ext_bus_link_get()
338 int snd_hdac_ext_bus_link_put(struct hdac_bus *bus, in snd_hdac_ext_bus_link_put() argument
345 guard(mutex)(&bus->lock); in snd_hdac_ext_bus_link_put()
358 list_for_each_entry(hlink_tmp, &bus->hlink_list, list) { in snd_hdac_ext_bus_link_put()
366 snd_hdac_bus_stop_cmd_io(bus); in snd_hdac_ext_bus_link_put()
367 bus->cmd_dma_state = false; in snd_hdac_ext_bus_link_put()
379 snd_hdac_ext_bus_get_hlink_by_name(codec->bus, devname); in hdac_ext_codec_link_up()
382 snd_hdac_ext_bus_link_get(codec->bus, hlink); in hdac_ext_codec_link_up()
389 snd_hdac_ext_bus_get_hlink_by_name(codec->bus, devname); in hdac_ext_codec_link_down()
392 snd_hdac_ext_bus_link_put(codec->bus, hlink); in hdac_ext_codec_link_down()
397 struct hdac_bus *bus = codec->bus; in snd_hdac_ext_bus_link_power() local
398 bool oldstate = test_bit(codec->addr, &bus->codec_powered); in snd_hdac_ext_bus_link_power()