linux/sound/pci/hda/hda_controller.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 *  Common functionality for the alsa driver code base for HD Audio.
 */

#ifndef __SOUND_HDA_CONTROLLER_H
#define __SOUND_HDA_CONTROLLER_H

#include <linux/timecounter.h>
#include <linux/interrupt.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/initval.h>
#include <sound/hda_codec.h>
#include <sound/hda_register.h>

#define AZX_MAX_CODECS
#define AZX_DEFAULT_CODECS

/* driver quirks (capabilities) */
/* bits 0-7 are used for indicating driver type */
#define AZX_DCAPS_NO_TCSEL
#define AZX_DCAPS_NO_MSI
#define AZX_DCAPS_SNOOP_MASK
#define AZX_DCAPS_SNOOP_OFF
#ifdef CONFIG_SND_HDA_I915
#define AZX_DCAPS_I915_COMPONENT
#else
#define AZX_DCAPS_I915_COMPONENT
#endif
#define AZX_DCAPS_AMD_ALLOC_FIX
#define AZX_DCAPS_CTX_WORKAROUND
#define AZX_DCAPS_POSFIX_LPIB
#define AZX_DCAPS_AMD_WORKAROUND
#define AZX_DCAPS_NO_64BIT
/* 19 unused */
#define AZX_DCAPS_OLD_SSYNC
#define AZX_DCAPS_NO_ALIGN_BUFSIZE
/* 22 unused */
#define AZX_DCAPS_4K_BDLE_BOUNDARY
/* 24 unused */
#define AZX_DCAPS_COUNT_LPIB_DELAY
#define AZX_DCAPS_PM_RUNTIME
#define AZX_DCAPS_RETRY_PROBE
#define AZX_DCAPS_CORBRP_SELF_CLEAR
#define AZX_DCAPS_NO_MSI64
#define AZX_DCAPS_SEPARATE_STREAM_TAG
#define AZX_DCAPS_PIO_COMMANDS

enum {};

struct azx_dev {};

#define azx_stream(dev)
#define stream_to_azx_dev(s)

struct azx;

/* Functions to read/write to hda registers. */
struct hda_controller_ops {};

struct azx_pcm {};

azx_get_pos_callback_t;
azx_get_delay_callback_t;

struct azx {};

#define azx_bus(chip)
#define bus_to_azx(_bus)

static inline bool azx_snoop(struct azx *chip)
{}

/*
 * macros for easy use
 */

#define azx_writel(chip, reg, value)
#define azx_readl(chip, reg)
#define azx_writew(chip, reg, value)
#define azx_readw(chip, reg)
#define azx_writeb(chip, reg, value)
#define azx_readb(chip, reg)

#define azx_has_pm_runtime(chip)

/* PCM setup */
static inline struct azx_dev *get_azx_dev(struct snd_pcm_substream *substream)
{}
unsigned int azx_get_position(struct azx *chip, struct azx_dev *azx_dev);
unsigned int azx_get_pos_lpib(struct azx *chip, struct azx_dev *azx_dev);
unsigned int azx_get_pos_posbuf(struct azx *chip, struct azx_dev *azx_dev);

/* Stream control. */
void azx_stop_all_streams(struct azx *chip);

/* Allocation functions. */
#define azx_alloc_stream_pages(chip)
#define azx_free_stream_pages(chip)

/* Low level azx interface */
void azx_init_chip(struct azx *chip, bool full_reset);
void azx_stop_chip(struct azx *chip);
#define azx_enter_link_reset(chip)
irqreturn_t azx_interrupt(int irq, void *dev_id);

/* Codec interface */
int azx_bus_init(struct azx *chip, const char *model);
int azx_probe_codecs(struct azx *chip, unsigned int max_slots);
int azx_codec_configure(struct azx *chip);
int azx_init_streams(struct azx *chip);
void azx_free_streams(struct azx *chip);

#endif /* __SOUND_HDA_CONTROLLER_H */