Lines Matching +full:codec +full:- +full:1

1 /* SPDX-License-Identifier: GPL-2.0 */
3 * HD-audio core stuff
20 /* codec node id */
47 * HD-audio codec base device
53 unsigned int addr; /* codec address */
65 unsigned int afg_unsol:1;
66 unsigned int mfg_unsol:1;
70 const char *vendor_name; /* codec vendor name */
71 const char *chip_name; /* codec chip name */
92 bool lazy_cache:1; /* don't wake up for writes */
93 bool caps_overwriting:1; /* caps overwrite being in process */
94 bool cache_coef:1; /* cache COEF read/write too */
120 int snd_hdac_device_register(struct hdac_device *codec);
121 void snd_hdac_device_unregister(struct hdac_device *codec);
122 int snd_hdac_device_set_chip_name(struct hdac_device *codec, const char *name);
125 int snd_hdac_refresh_widgets(struct hdac_device *codec);
127 int snd_hdac_read(struct hdac_device *codec, hda_nid_t nid,
129 int _snd_hdac_read_parm(struct hdac_device *codec, hda_nid_t nid, int parm,
131 int snd_hdac_read_parm_uncached(struct hdac_device *codec, hda_nid_t nid,
133 int snd_hdac_override_parm(struct hdac_device *codec, hda_nid_t nid,
135 int snd_hdac_get_connections(struct hdac_device *codec, hda_nid_t nid,
137 int snd_hdac_get_sub_nodes(struct hdac_device *codec, hda_nid_t nid,
144 int snd_hdac_query_supported_pcm(struct hdac_device *codec, hda_nid_t nid,
146 bool snd_hdac_is_supported_format(struct hdac_device *codec, hda_nid_t nid,
158 * snd_hdac_read_parm - read a codec parameter
159 * @codec: the codec object
163 * Returns -1 for error. If you need to distinguish the error more
166 static inline int snd_hdac_read_parm(struct hdac_device *codec, hda_nid_t nid, in snd_hdac_read_parm() argument
171 return _snd_hdac_read_parm(codec, nid, parm, &val) < 0 ? -1 : val; in snd_hdac_read_parm()
175 int snd_hdac_power_up(struct hdac_device *codec);
176 int snd_hdac_power_down(struct hdac_device *codec);
177 int snd_hdac_power_up_pm(struct hdac_device *codec);
178 int snd_hdac_power_down_pm(struct hdac_device *codec);
179 int snd_hdac_keep_power_up(struct hdac_device *codec);
181 /* call this at entering into suspend/resume callbacks in codec driver */
182 static inline void snd_hdac_enter_pm(struct hdac_device *codec) in snd_hdac_enter_pm() argument
184 atomic_inc(&codec->in_pm); in snd_hdac_enter_pm()
187 /* call this at leaving from suspend/resume callbacks in codec driver */
188 static inline void snd_hdac_leave_pm(struct hdac_device *codec) in snd_hdac_leave_pm() argument
190 atomic_dec(&codec->in_pm); in snd_hdac_leave_pm()
193 static inline bool snd_hdac_is_in_pm(struct hdac_device *codec) in snd_hdac_is_in_pm() argument
195 return atomic_read(&codec->in_pm); in snd_hdac_is_in_pm()
198 static inline bool snd_hdac_is_power_on(struct hdac_device *codec) in snd_hdac_is_power_on() argument
200 return !pm_runtime_suspended(&codec->dev); in snd_hdac_is_power_on()
203 static inline int snd_hdac_power_up(struct hdac_device *codec) { return 0; } in snd_hdac_power_up() argument
204 static inline int snd_hdac_power_down(struct hdac_device *codec) { return 0; } in snd_hdac_power_down() argument
205 static inline int snd_hdac_power_up_pm(struct hdac_device *codec) { return 0; } in snd_hdac_power_up_pm() argument
206 static inline int snd_hdac_power_down_pm(struct hdac_device *codec) { return 0; } in snd_hdac_power_down_pm() argument
207 static inline int snd_hdac_keep_power_up(struct hdac_device *codec) { return 0; } in snd_hdac_keep_power_up() argument
208 static inline void snd_hdac_enter_pm(struct hdac_device *codec) {} in snd_hdac_enter_pm() argument
209 static inline void snd_hdac_leave_pm(struct hdac_device *codec) {} in snd_hdac_leave_pm() argument
210 static inline bool snd_hdac_is_in_pm(struct hdac_device *codec) { return false; } in snd_hdac_is_in_pm() argument
211 static inline bool snd_hdac_is_power_on(struct hdac_device *codec) { return true; } in snd_hdac_is_power_on() argument
215 * HD-audio codec base driver
247 * ops used for ASoC HDA codec drivers
271 * HD-audio bus base driver
300 /* codec linked list */
304 /* link caddr -> codec */
305 struct hdac_device *caddr_tbl[HDA_MAX_CODEC_ADDRESS + 1];
333 bool chip_init:1; /* h/w initialized */
336 bool aligned_mmio:1; /* aligned MMIO access */
337 bool sync_write:1; /* sync after verb write */
338 bool use_posbuf:1; /* use position buffer */
339 bool snoop:1; /* enable snooping */
340 bool align_bdle_4k:1; /* BDLE align 4K boundary */
341 bool reverse_assign:1; /* assign devices in reverse order */
342 bool corbrp_self_clear:1; /* CORBRP clears itself after reset */
343 bool polling_mode:1;
344 bool needs_damn_long_delay:1;
381 static inline void snd_hdac_codec_link_up(struct hdac_device *codec) in snd_hdac_codec_link_up() argument
383 set_bit(codec->addr, &codec->bus->codec_powered); in snd_hdac_codec_link_up()
386 static inline void snd_hdac_codec_link_down(struct hdac_device *codec) in snd_hdac_codec_link_down() argument
388 clear_bit(codec->addr, &codec->bus->codec_powered); in snd_hdac_codec_link_down()
416 #define snd_hdac_aligned_mmio(bus) (bus)->aligned_mmio
460 snd_hdac_reg_writeb(chip, (chip)->remap_addr + (reg), value)
462 snd_hdac_reg_readb(chip, (chip)->remap_addr + (reg))
464 snd_hdac_reg_writew(chip, (chip)->remap_addr + (reg), value)
466 snd_hdac_reg_readw(chip, (chip)->remap_addr + (reg))
468 snd_hdac_reg_writel(chip, (chip)->remap_addr + (reg), value)
470 snd_hdac_reg_readl(chip, (chip)->remap_addr + (reg))
498 * HD-audio stream
521 * controller and the codec
527 bool opened:1;
528 bool running:1;
529 bool prepared:1;
530 bool no_period_wakeup:1;
531 bool locked:1;
532 bool stripe:1; /* apply stripe control */
580 snd_hdac_reg_writel((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg, value)
582 snd_hdac_reg_writew((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg, value)
584 snd_hdac_reg_writeb((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg, value)
586 snd_hdac_reg_readl((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
588 snd_hdac_reg_readw((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
590 snd_hdac_reg_readb((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
608 #define snd_hdac_dsp_lock_init(dev) mutex_init(&(dev)->dsp_mutex)
609 #define snd_hdac_dsp_lock(dev) mutex_lock(&(dev)->dsp_mutex)
610 #define snd_hdac_dsp_unlock(dev) mutex_unlock(&(dev)->dsp_mutex)
611 #define snd_hdac_stream_is_locked(dev) ((dev)->locked)
650 array->elem_size = size; in snd_array_init()
651 array->alloc_align = align; in snd_array_init()
656 return array->list + idx * array->elem_size; in snd_array_elem()
661 return (unsigned long)(ptr - array->list) / array->elem_size; in snd_array_index()
666 for ((idx) = 0, (ptr) = (array)->list; (idx) < (array)->used; \