Ignore:
Timestamp:
Apr 19, 2025, 8:08:37 PM (4 months ago)
Author:
David Azarewicz
Message:

Merge in changes from 6.6-LTS branch.
Fixed additional 25+ problems.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/include/sound/hdaudio.h

    r695 r772  
    1010#include <linux/interrupt.h>
    1111#include <linux/io.h>
     12#include <linux/io-64-nonatomic-lo-hi.h>
     13#include <linux/iopoll.h>
     14#include <linux/pci.h>
    1215#include <linux/pm_runtime.h>
    1316#include <linux/timecounter.h>
     
    9396        bool caps_overwriting:1; /* caps overwrite being in process */
    9497        bool cache_coef:1;      /* cache COEF read/write too */
     98        unsigned int registered:1; /* codec was registered */
    9599};
    96100
     
    121125void snd_hdac_device_unregister(struct hdac_device *codec);
    122126int snd_hdac_device_set_chip_name(struct hdac_device *codec, const char *name);
    123 int snd_hdac_codec_modalias(struct hdac_device *hdac, char *buf, size_t size);
     127int snd_hdac_codec_modalias(const struct hdac_device *hdac, char *buf, size_t size);
    124128
    125129int snd_hdac_refresh_widgets(struct hdac_device *codec);
     
    356360        bool polling_mode:1;
    357361        bool needs_damn_long_delay:1;
     362        bool not_use_interrupts:1;      /* prohibiting the RIRB IRQ */
     363        bool access_sdnctl_in_dword:1;  /* accessing the sdnctl register by dword */
    358364
    359365        int poll_count;
     
    460466#define snd_hdac_reg_writel(bus, addr, val)     writel(val, addr)
    461467#define snd_hdac_reg_readl(bus, addr)   readl(addr)
     468#define snd_hdac_reg_writeq(bus, addr, val)     writeq(val, addr)
     469#define snd_hdac_reg_readq(bus, addr)           readq(addr)
    462470
    463471/*
     
    502510                             (snd_hdac_chip_readb(chip, reg) & ~(mask)) | (val))
    503511
     512/* update register macro */
     513#define snd_hdac_updatel(addr, reg, mask, val)          \
     514        writel(((readl(addr + reg) & ~(mask)) | (val)), addr + reg)
     515
     516#define snd_hdac_updatew(addr, reg, mask, val)          \
     517        writew(((readw(addr + reg) & ~(mask)) | (val)), addr + reg)
     518
    504519/*
    505520 * HD-audio stream
     
    521536
    522537        void __iomem *sd_addr;  /* stream descriptor pointer */
     538
     539        void __iomem *spib_addr; /* software position in buffers stream pointer */
     540        void __iomem *fifo_addr; /* software position Max fifos stream pointer */
     541
     542        void __iomem *dpibr_addr; /* DMA position in buffer resume pointer */
     543        u32 dpib;               /* DMA position in buffer */
     544        u32 lpib;               /* Linear position in buffer */
    523545
    524546        u32 sd_int_sta_mask;    /* stream int status mask */
     
    561583struct hdac_stream *snd_hdac_stream_assign(struct hdac_bus *bus,
    562584                                           struct snd_pcm_substream *substream);
     585void snd_hdac_stream_release_locked(struct hdac_stream *azx_dev);
    563586void snd_hdac_stream_release(struct hdac_stream *azx_dev);
    564587struct hdac_stream *snd_hdac_get_stream(struct hdac_bus *bus,
     
    570593int snd_hdac_stream_set_params(struct hdac_stream *azx_dev,
    571594                                unsigned int format_val);
    572 void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start);
    573 void snd_hdac_stream_clear(struct hdac_stream *azx_dev);
     595void snd_hdac_stream_start(struct hdac_stream *azx_dev);
    574596void snd_hdac_stream_stop(struct hdac_stream *azx_dev);
     597void snd_hdac_stop_streams(struct hdac_bus *bus);
     598void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus);
    575599void snd_hdac_stream_reset(struct hdac_stream *azx_dev);
    576600void snd_hdac_stream_sync_trigger(struct hdac_stream *azx_dev, bool set,
     
    582606int snd_hdac_get_stream_stripe_ctl(struct hdac_bus *bus,
    583607                                struct snd_pcm_substream *substream);
     608
     609void snd_hdac_stream_spbcap_enable(struct hdac_bus *chip,
     610                                   bool enable, int index);
     611int snd_hdac_stream_set_spib(struct hdac_bus *bus,
     612                             struct hdac_stream *azx_dev, u32 value);
     613int snd_hdac_stream_get_spbmaxfifo(struct hdac_bus *bus,
     614                                   struct hdac_stream *azx_dev);
     615void snd_hdac_stream_drsm_enable(struct hdac_bus *bus,
     616                                 bool enable, int index);
     617int snd_hdac_stream_wait_drsm(struct hdac_stream *azx_dev);
     618int snd_hdac_stream_set_dpibr(struct hdac_bus *bus,
     619                              struct hdac_stream *azx_dev, u32 value);
     620int snd_hdac_stream_set_lpib(struct hdac_stream *azx_dev, u32 value);
    584621
    585622/*
     
    599636#define snd_hdac_stream_readb(dev, reg) \
    600637        snd_hdac_reg_readb((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
     638#define snd_hdac_stream_readb_poll(dev, reg, val, cond, delay_us, timeout_us) \
     639        read_poll_timeout_atomic(snd_hdac_reg_readb, val, cond, delay_us, timeout_us, \
     640                                 false, (dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
     641#define snd_hdac_stream_readl_poll(dev, reg, val, cond, delay_us, timeout_us) \
     642        read_poll_timeout_atomic(snd_hdac_reg_readl, val, cond, delay_us, timeout_us, \
     643                                 false, (dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
    601644
    602645/* update a register, pass without AZX_REG_ prefix */
     
    677720             (ptr) = snd_array_elem(array, ++(idx)))
    678721
     722/*
     723 * Device matching
     724 */
     725
     726#ifndef TARGET_OS2
     727#define HDA_CONTROLLER_IS_HSW(pci) (pci_match_id((struct pci_device_id []){ \
     728                        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_HSW_0) }, \
     729                        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_HSW_2) }, \
     730                        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_HSW_3) }, \
     731                        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_BDW) }, \
     732                        { } \
     733                }, pci))
     734
     735#define HDA_CONTROLLER_IS_APL(pci) (pci_match_id((struct pci_device_id []){ \
     736                        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_APL) }, \
     737                        { } \
     738                }, pci))
     739
     740#define HDA_CONTROLLER_IN_GPU(pci) (pci_match_id((struct pci_device_id []){ \
     741                        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_DG1) }, \
     742                        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_DG2_0) }, \
     743                        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_DG2_1) }, \
     744                        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_DG2_2) }, \
     745                        { } \
     746                }, pci) || HDA_CONTROLLER_IS_HSW(pci))
     747#else
     748#define HDA_CONTROLLER_IS_HSW(pci) 0
     749#define HDA_CONTROLLER_IS_APL(pci) 0
     750#define HDA_CONTROLLER_IN_GPU(pci) 0
     751#endif
    679752#endif /* __SOUND_HDAUDIO_H */
Note: See TracChangeset for help on using the changeset viewer.