Lines Matching +full:reg +full:- +full:addr
1 /* SPDX-License-Identifier: GPL-2.0 */
3 * HD-audio core stuff
12 #include <linux/io-64-nonatomic-lo-hi.h>
49 * HD-audio codec base device
55 unsigned int addr; /* codec address */ member
121 const char *name, unsigned int addr);
161 * snd_hdac_read_parm - read a codec parameter
166 * Returns -1 for error. If you need to distinguish the error more
174 return _snd_hdac_read_parm(codec, nid, parm, &val) < 0 ? -1 : val; in snd_hdac_read_parm()
187 atomic_inc(&codec->in_pm); in snd_hdac_enter_pm()
193 atomic_dec(&codec->in_pm); in snd_hdac_leave_pm()
198 return atomic_read(&codec->in_pm); in snd_hdac_is_in_pm()
203 return !pm_runtime_suspended(&codec->dev); in snd_hdac_is_power_on()
218 * HD-audio codec base driver
245 int (*get_response)(struct hdac_bus *bus, unsigned int addr,
247 /* notify of codec link power-up/down */
269 dma_addr_t addr; /* physical address of CORB/RIRB buffer */ member
276 * HD-audio bus base driver
295 unsigned long addr; member
309 /* link caddr -> codec */
383 int snd_hdac_bus_exec_verb_unlocked(struct hdac_bus *bus, unsigned int addr,
390 int snd_hdac_bus_get_response(struct hdac_bus *bus, unsigned int addr,
412 unsigned int snd_hdac_aligned_read(void __iomem *addr, unsigned int mask);
413 void snd_hdac_aligned_write(unsigned int val, void __iomem *addr,
415 #define snd_hdac_aligned_mmio(bus) (bus)->aligned_mmio
418 #define snd_hdac_aligned_read(addr, mask) 0 argument
419 #define snd_hdac_aligned_write(val, addr, mask) do {} while (0) argument
422 static inline void snd_hdac_reg_writeb(struct hdac_bus *bus, void __iomem *addr, in snd_hdac_reg_writeb() argument
426 snd_hdac_aligned_write(val, addr, 0xff); in snd_hdac_reg_writeb()
428 writeb(val, addr); in snd_hdac_reg_writeb()
431 static inline void snd_hdac_reg_writew(struct hdac_bus *bus, void __iomem *addr, in snd_hdac_reg_writew() argument
435 snd_hdac_aligned_write(val, addr, 0xffff); in snd_hdac_reg_writew()
437 writew(val, addr); in snd_hdac_reg_writew()
440 static inline u8 snd_hdac_reg_readb(struct hdac_bus *bus, void __iomem *addr) in snd_hdac_reg_readb() argument
443 snd_hdac_aligned_read(addr, 0xff) : readb(addr); in snd_hdac_reg_readb()
446 static inline u16 snd_hdac_reg_readw(struct hdac_bus *bus, void __iomem *addr) in snd_hdac_reg_readw() argument
449 snd_hdac_aligned_read(addr, 0xffff) : readw(addr); in snd_hdac_reg_readw()
452 #define snd_hdac_reg_writel(bus, addr, val) writel(val, addr) argument
453 #define snd_hdac_reg_readl(bus, addr) readl(addr) argument
454 #define snd_hdac_reg_writeq(bus, addr, val) writeq(val, addr) argument
455 #define snd_hdac_reg_readq(bus, addr) readq(addr) argument
460 #define _snd_hdac_chip_writeb(chip, reg, value) \ argument
461 snd_hdac_reg_writeb(chip, (chip)->remap_addr + (reg), value)
462 #define _snd_hdac_chip_readb(chip, reg) \ argument
463 snd_hdac_reg_readb(chip, (chip)->remap_addr + (reg))
464 #define _snd_hdac_chip_writew(chip, reg, value) \ argument
465 snd_hdac_reg_writew(chip, (chip)->remap_addr + (reg), value)
466 #define _snd_hdac_chip_readw(chip, reg) \ argument
467 snd_hdac_reg_readw(chip, (chip)->remap_addr + (reg))
468 #define _snd_hdac_chip_writel(chip, reg, value) \ argument
469 snd_hdac_reg_writel(chip, (chip)->remap_addr + (reg), value)
470 #define _snd_hdac_chip_readl(chip, reg) \ argument
471 snd_hdac_reg_readl(chip, (chip)->remap_addr + (reg))
474 #define snd_hdac_chip_writel(chip, reg, value) \ argument
475 _snd_hdac_chip_writel(chip, AZX_REG_ ## reg, value)
476 #define snd_hdac_chip_writew(chip, reg, value) \ argument
477 _snd_hdac_chip_writew(chip, AZX_REG_ ## reg, value)
478 #define snd_hdac_chip_writeb(chip, reg, value) \ argument
479 _snd_hdac_chip_writeb(chip, AZX_REG_ ## reg, value)
480 #define snd_hdac_chip_readl(chip, reg) \ argument
481 _snd_hdac_chip_readl(chip, AZX_REG_ ## reg)
482 #define snd_hdac_chip_readw(chip, reg) \ argument
483 _snd_hdac_chip_readw(chip, AZX_REG_ ## reg)
484 #define snd_hdac_chip_readb(chip, reg) \ argument
485 _snd_hdac_chip_readb(chip, AZX_REG_ ## reg)
488 #define snd_hdac_chip_updatel(chip, reg, mask, val) \ argument
489 snd_hdac_chip_writel(chip, reg, \
490 (snd_hdac_chip_readl(chip, reg) & ~(mask)) | (val))
491 #define snd_hdac_chip_updatew(chip, reg, mask, val) \ argument
492 snd_hdac_chip_writew(chip, reg, \
493 (snd_hdac_chip_readw(chip, reg) & ~(mask)) | (val))
494 #define snd_hdac_chip_updateb(chip, reg, mask, val) \ argument
495 snd_hdac_chip_writeb(chip, reg, \
496 (snd_hdac_chip_readb(chip, reg) & ~(mask)) | (val))
499 * HD-audio stream
570 unsigned int streams, unsigned int reg);
582 #define snd_hdac_stream_writel(dev, reg, value) \ argument
583 snd_hdac_reg_writel((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg, value)
584 #define snd_hdac_stream_writew(dev, reg, value) \ argument
585 snd_hdac_reg_writew((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg, value)
586 #define snd_hdac_stream_writeb(dev, reg, value) \ argument
587 snd_hdac_reg_writeb((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg, value)
588 #define snd_hdac_stream_readl(dev, reg) \ argument
589 snd_hdac_reg_readl((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
590 #define snd_hdac_stream_readw(dev, reg) \ argument
591 snd_hdac_reg_readw((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
592 #define snd_hdac_stream_readb(dev, reg) \ argument
593 snd_hdac_reg_readb((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
594 #define snd_hdac_stream_readb_poll(dev, reg, val, cond, delay_us, timeout_us) \ argument
596 false, (dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
597 #define snd_hdac_stream_readl_poll(dev, reg, val, cond, delay_us, timeout_us) \ argument
599 false, (dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
602 #define snd_hdac_stream_updatel(dev, reg, mask, val) \ argument
603 snd_hdac_stream_writel(dev, reg, \
604 (snd_hdac_stream_readl(dev, reg) & \
606 #define snd_hdac_stream_updatew(dev, reg, mask, val) \ argument
607 snd_hdac_stream_writew(dev, reg, \
608 (snd_hdac_stream_readw(dev, reg) & \
610 #define snd_hdac_stream_updateb(dev, reg, mask, val) \ argument
611 snd_hdac_stream_writeb(dev, reg, \
612 (snd_hdac_stream_readb(dev, reg) & \
617 #define snd_hdac_dsp_lock_init(dev) mutex_init(&(dev)->dsp_mutex)
618 #define snd_hdac_dsp_lock(dev) mutex_lock(&(dev)->dsp_mutex)
619 #define snd_hdac_dsp_unlock(dev) mutex_unlock(&(dev)->dsp_mutex)
620 #define snd_hdac_stream_is_locked(dev) ((dev)->locked)
659 array->elem_size = size; in snd_array_init()
660 array->alloc_align = align; in snd_array_init()
665 return array->list + idx * array->elem_size; in snd_array_elem()
670 return (unsigned long)(ptr - array->list) / array->elem_size; in snd_array_index()
675 for ((idx) = 0, (ptr) = (array)->list; (idx) < (array)->used; \