Lines Matching +full:codec +full:- +full:driver

1 /* SPDX-License-Identifier: GPL-2.0 */
3 * HD-audio core stuff
12 #include <linux/io-64-nonatomic-lo-hi.h>
23 /* codec node id */
50 * HD-audio codec base device
56 unsigned int addr; /* codec address */
73 const char *vendor_name; /* codec vendor name */
74 const char *chip_name; /* codec chip name */
98 unsigned int registered:1; /* codec was registered */
101 /* device/driver type used for matching */
110 SND_SKL_PCI_BIND_LEGACY,/* bind only with legacy driver */
111 SND_SKL_PCI_BIND_ASOC /* bind only with ASoC driver */
124 int snd_hdac_device_register(struct hdac_device *codec);
125 void snd_hdac_device_unregister(struct hdac_device *codec);
126 int snd_hdac_device_set_chip_name(struct hdac_device *codec, const char *name);
129 int snd_hdac_refresh_widgets(struct hdac_device *codec);
131 int snd_hdac_read(struct hdac_device *codec, hda_nid_t nid,
133 int _snd_hdac_read_parm(struct hdac_device *codec, hda_nid_t nid, int parm,
135 int snd_hdac_read_parm_uncached(struct hdac_device *codec, hda_nid_t nid,
137 int snd_hdac_override_parm(struct hdac_device *codec, hda_nid_t nid,
139 int snd_hdac_get_connections(struct hdac_device *codec, hda_nid_t nid,
141 int snd_hdac_get_sub_nodes(struct hdac_device *codec, hda_nid_t nid,
148 int snd_hdac_query_supported_pcm(struct hdac_device *codec, hda_nid_t nid,
150 bool snd_hdac_is_supported_format(struct hdac_device *codec, hda_nid_t nid,
162 * snd_hdac_read_parm - read a codec parameter
163 * @codec: the codec object
167 * Returns -1 for error. If you need to distinguish the error more
170 static inline int snd_hdac_read_parm(struct hdac_device *codec, hda_nid_t nid, in snd_hdac_read_parm() argument
175 return _snd_hdac_read_parm(codec, nid, parm, &val) < 0 ? -1 : val; in snd_hdac_read_parm()
179 int snd_hdac_power_up(struct hdac_device *codec);
180 int snd_hdac_power_down(struct hdac_device *codec);
181 int snd_hdac_power_up_pm(struct hdac_device *codec);
182 int snd_hdac_power_down_pm(struct hdac_device *codec);
183 int snd_hdac_keep_power_up(struct hdac_device *codec);
185 /* call this at entering into suspend/resume callbacks in codec driver */
186 static inline void snd_hdac_enter_pm(struct hdac_device *codec) in snd_hdac_enter_pm() argument
188 atomic_inc(&codec->in_pm); in snd_hdac_enter_pm()
191 /* call this at leaving from suspend/resume callbacks in codec driver */
192 static inline void snd_hdac_leave_pm(struct hdac_device *codec) in snd_hdac_leave_pm() argument
194 atomic_dec(&codec->in_pm); in snd_hdac_leave_pm()
197 static inline bool snd_hdac_is_in_pm(struct hdac_device *codec) in snd_hdac_is_in_pm() argument
199 return atomic_read(&codec->in_pm); in snd_hdac_is_in_pm()
202 static inline bool snd_hdac_is_power_on(struct hdac_device *codec) in snd_hdac_is_power_on() argument
204 return !pm_runtime_suspended(&codec->dev); in snd_hdac_is_power_on()
207 static inline int snd_hdac_power_up(struct hdac_device *codec) { return 0; } in snd_hdac_power_up() argument
208 static inline int snd_hdac_power_down(struct hdac_device *codec) { return 0; } in snd_hdac_power_down() argument
209 static inline int snd_hdac_power_up_pm(struct hdac_device *codec) { return 0; } in snd_hdac_power_up_pm() argument
210 static inline int snd_hdac_power_down_pm(struct hdac_device *codec) { return 0; } in snd_hdac_power_down_pm() argument
211 static inline int snd_hdac_keep_power_up(struct hdac_device *codec) { return 0; } in snd_hdac_keep_power_up() argument
212 static inline void snd_hdac_enter_pm(struct hdac_device *codec) {} in snd_hdac_enter_pm() argument
213 static inline void snd_hdac_leave_pm(struct hdac_device *codec) {} in snd_hdac_leave_pm() argument
214 static inline bool snd_hdac_is_in_pm(struct hdac_device *codec) { return false; } in snd_hdac_is_in_pm() argument
215 static inline bool snd_hdac_is_power_on(struct hdac_device *codec) { return true; } in snd_hdac_is_power_on() argument
219 * HD-audio codec base driver
222 struct device_driver driver; member
234 #define drv_to_hdac_driver(_drv) container_of(_drv, struct hdac_driver, driver)
248 /* notify of codec link power-up/down */
253 * ops used for ASoC HDA codec drivers
277 * HD-audio bus base driver
306 /* codec linked list */
310 /* link caddr -> codec */
389 void snd_hdac_codec_link_up(struct hdac_device *codec);
390 void snd_hdac_codec_link_down(struct hdac_device *codec);
418 #define snd_hdac_aligned_mmio(bus) (bus)->aligned_mmio
464 snd_hdac_reg_writeb(chip, (chip)->remap_addr + (reg), value)
466 snd_hdac_reg_readb(chip, (chip)->remap_addr + (reg))
468 snd_hdac_reg_writew(chip, (chip)->remap_addr + (reg), value)
470 snd_hdac_reg_readw(chip, (chip)->remap_addr + (reg))
472 snd_hdac_reg_writel(chip, (chip)->remap_addr + (reg), value)
474 snd_hdac_reg_readl(chip, (chip)->remap_addr + (reg))
509 * HD-audio stream
539 * controller and the codec
613 snd_hdac_reg_writel((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg, value)
615 snd_hdac_reg_writew((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg, value)
617 snd_hdac_reg_writeb((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg, value)
619 snd_hdac_reg_readl((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
621 snd_hdac_reg_readw((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
623 snd_hdac_reg_readb((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
626 false, (dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
629 false, (dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
647 #define snd_hdac_dsp_lock_init(dev) mutex_init(&(dev)->dsp_mutex)
648 #define snd_hdac_dsp_lock(dev) mutex_lock(&(dev)->dsp_mutex)
649 #define snd_hdac_dsp_unlock(dev) mutex_unlock(&(dev)->dsp_mutex)
650 #define snd_hdac_stream_is_locked(dev) ((dev)->locked)
689 array->elem_size = size; in snd_array_init()
690 array->alloc_align = align; in snd_array_init()
695 return array->list + idx * array->elem_size; in snd_array_elem()
700 return (unsigned long)(ptr - array->list) / array->elem_size; in snd_array_index()
705 for ((idx) = 0, (ptr) = (array)->list; (idx) < (array)->used; \