// SPDX-License-Identifier: GPL-2.0-only /* * hdac-ext-controller.c - HD-audio extended controller functions. * * Copyright (C) 2014-2015 Intel Corp * Author: Jeeja KP <[email protected]> * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <linux/delay.h> #include <linux/slab.h> #include <sound/hda_register.h> #include <sound/hdaudio_ext.h> /* * processing pipe helpers - these helpers are useful for dealing with HDA * new capability of processing pipelines */ /** * snd_hdac_ext_bus_ppcap_enable - enable/disable processing pipe capability * @bus: the pointer to HDAC bus object * @enable: flag to turn on/off the capability */ void snd_hdac_ext_bus_ppcap_enable(struct hdac_bus *bus, bool enable) { … } EXPORT_SYMBOL_GPL(…); /** * snd_hdac_ext_bus_ppcap_int_enable - ppcap interrupt enable/disable * @bus: the pointer to HDAC bus object * @enable: flag to enable/disable interrupt */ void snd_hdac_ext_bus_ppcap_int_enable(struct hdac_bus *bus, bool enable) { … } EXPORT_SYMBOL_GPL(…); /* * Multilink helpers - these helpers are useful for dealing with HDA * new multilink capability */ /** * snd_hdac_ext_bus_get_ml_capabilities - get multilink capability * @bus: the pointer to HDAC bus object * * This will parse all links and read the mlink capabilities and add them * in hlink_list of extended hdac bus * Note: this will be freed on bus exit by driver */ int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_bus *bus) { … } EXPORT_SYMBOL_GPL(…); /** * snd_hdac_ext_link_free_all- free hdac extended link objects * * @bus: the pointer to HDAC bus object */ void snd_hdac_ext_link_free_all(struct hdac_bus *bus) { … } EXPORT_SYMBOL_GPL(…); /** * snd_hdac_ext_bus_get_hlink_by_addr - get hlink at specified address * @bus: hlink's parent bus device * @addr: codec device address * * Returns hlink object or NULL if matching hlink is not found. */ struct hdac_ext_link *snd_hdac_ext_bus_get_hlink_by_addr(struct hdac_bus *bus, int addr) { … } EXPORT_SYMBOL_GPL(…); /** * snd_hdac_ext_bus_get_hlink_by_name - get hlink based on codec name * @bus: the pointer to HDAC bus object * @codec_name: codec name */ struct hdac_ext_link *snd_hdac_ext_bus_get_hlink_by_name(struct hdac_bus *bus, const char *codec_name) { … } EXPORT_SYMBOL_GPL(…); static int check_hdac_link_power_active(struct hdac_ext_link *hlink, bool enable) { … } /** * snd_hdac_ext_bus_link_power_up -power up hda link * @hlink: HD-audio extended link */ int snd_hdac_ext_bus_link_power_up(struct hdac_ext_link *hlink) { … } EXPORT_SYMBOL_GPL(…); /** * snd_hdac_ext_bus_link_power_down -power down hda link * @hlink: HD-audio extended link */ int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *hlink) { … } EXPORT_SYMBOL_GPL(…); /** * snd_hdac_ext_bus_link_power_up_all -power up all hda link * @bus: the pointer to HDAC bus object */ int snd_hdac_ext_bus_link_power_up_all(struct hdac_bus *bus) { … } EXPORT_SYMBOL_GPL(…); /** * snd_hdac_ext_bus_link_power_down_all -power down all hda link * @bus: the pointer to HDAC bus object */ int snd_hdac_ext_bus_link_power_down_all(struct hdac_bus *bus) { … } EXPORT_SYMBOL_GPL(…); /** * snd_hdac_ext_bus_link_set_stream_id - maps stream id to link output * @link: HD-audio ext link to set up * @stream: stream id */ void snd_hdac_ext_bus_link_set_stream_id(struct hdac_ext_link *link, int stream) { … } EXPORT_SYMBOL_GPL(…); /** * snd_hdac_ext_bus_link_clear_stream_id - maps stream id to link output * @link: HD-audio ext link to set up * @stream: stream id */ void snd_hdac_ext_bus_link_clear_stream_id(struct hdac_ext_link *link, int stream) { … } EXPORT_SYMBOL_GPL(…); int snd_hdac_ext_bus_link_get(struct hdac_bus *bus, struct hdac_ext_link *hlink) { … } EXPORT_SYMBOL_GPL(…); int snd_hdac_ext_bus_link_put(struct hdac_bus *bus, struct hdac_ext_link *hlink) { … } EXPORT_SYMBOL_GPL(…); static void hdac_ext_codec_link_up(struct hdac_device *codec) { … } static void hdac_ext_codec_link_down(struct hdac_device *codec) { … } void snd_hdac_ext_bus_link_power(struct hdac_device *codec, bool enable) { … } EXPORT_SYMBOL_GPL(…);