linux/sound/soc/amd/ps/acp63.h

/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * AMD ALSA SoC PDM Driver
 *
 * Copyright (C) 2022, 2023 Advanced Micro Devices, Inc. All rights reserved.
 */

#include <linux/soundwire/sdw_amd.h>
#include <sound/acp63_chip_offset_byte.h>

#define ACP_DEVICE_ID
#define ACP63_REG_START
#define ACP63_REG_END

#define ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK
#define ACP_PGFSM_CNTL_POWER_ON_MASK
#define ACP_PGFSM_CNTL_POWER_OFF_MASK
#define ACP_PGFSM_STATUS_MASK
#define ACP_POWERED_ON
#define ACP_POWER_ON_IN_PROGRESS
#define ACP_POWERED_OFF
#define ACP_POWER_OFF_IN_PROGRESS

#define ACP_ERROR_MASK
#define ACP_EXT_INTR_STAT_CLEAR_MASK
#define PDM_DMA_STAT

#define PDM_DMA_INTR_MASK
#define ACP_ERROR_STAT
#define PDM_DECIMATION_FACTOR
#define ACP_PDM_CLK_FREQ_MASK
#define ACP_WOV_GAIN_CONTROL
#define ACP_PDM_ENABLE
#define ACP_PDM_DISABLE
#define ACP_PDM_DMA_EN_STATUS
#define TWO_CH
#define DELAY_US
#define ACP_COUNTER

#define ACP_SRAM_PTE_OFFSET
#define PAGE_SIZE_4K_ENABLE
#define PDM_PTE_OFFSET
#define PDM_MEM_WINDOW_START

#define CAPTURE_MIN_NUM_PERIODS
#define CAPTURE_MAX_NUM_PERIODS
#define CAPTURE_MAX_PERIOD_SIZE
#define CAPTURE_MIN_PERIOD_SIZE

#define MAX_BUFFER
#define MIN_BUFFER

/* time in ms for runtime suspend delay */
#define ACP_SUSPEND_DELAY_MS

#define ACP_DMIC_DEV

#define ACP63_DMIC_ADDR
#define ACP63_SDW_ADDR
#define AMD_SDW_MAX_MANAGERS

/* time in ms for acp timeout */
#define ACP_TIMEOUT

#define ACP_SDW0_STAT
#define ACP_SDW1_STAT
#define ACP_ERROR_IRQ

#define ACP_AUDIO0_TX_THRESHOLD
#define ACP_AUDIO1_TX_THRESHOLD
#define ACP_AUDIO2_TX_THRESHOLD
#define ACP_AUDIO0_RX_THRESHOLD
#define ACP_AUDIO1_RX_THRESHOLD
#define ACP_AUDIO2_RX_THRESHOLD
#define ACP_P1_AUDIO1_TX_THRESHOLD
#define ACP_P1_AUDIO1_RX_THRESHOLD
#define ACP_SDW_DMA_IRQ_MASK
#define ACP_P1_SDW_DMA_IRQ_MASK
#define ACP63_SDW0_DMA_MAX_STREAMS
#define ACP63_SDW1_DMA_MAX_STREAMS
#define ACP_P1_AUDIO_TX_THRESHOLD

/*
 * Below entries describes SDW0 instance DMA stream id and DMA irq bit mapping
 * in ACP_EXTENAL_INTR_CNTL register.
 * Stream id		IRQ Bit
 * 0 (SDW0_AUDIO0_TX)	28
 * 1 (SDW0_AUDIO1_TX)	26
 * 2 (SDW0_AUDIO2_TX)	24
 * 3 (SDW0_AUDIO0_RX)	27
 * 4 (SDW0_AUDIO1_RX)	25
 * 5 (SDW0_AUDIO2_RX)	23
 */
#define SDW0_DMA_TX_IRQ_MASK(i)
#define SDW0_DMA_RX_IRQ_MASK(i)

/*
 * Below entries describes SDW1 instance DMA stream id and DMA irq bit mapping
 * in ACP_EXTENAL_INTR_CNTL1 register.
 * Stream id		IRQ Bit
 * 0 (SDW1_AUDIO1_TX)	6
 * 1 (SDW1_AUDIO1_RX)	5
 */
#define SDW1_DMA_IRQ_MASK(i)

#define ACP_DELAY_US
#define ACP_SDW_RING_BUFF_ADDR_OFFSET
#define SDW0_MEM_WINDOW_START
#define ACP_SDW_SRAM_PTE_OFFSET
#define SDW0_PTE_OFFSET
#define SDW_FIFO_SIZE
#define SDW_DMA_SIZE
#define ACP_SDW0_FIFO_OFFSET
#define ACP_SDW_PTE_OFFSET
#define SDW_FIFO_OFFSET
#define SDW_PTE_OFFSET(i)
#define ACP_SDW_FIFO_OFFSET(i)
#define SDW_MEM_WINDOW_START(i)

#define SDW_PLAYBACK_MIN_NUM_PERIODS
#define SDW_PLAYBACK_MAX_NUM_PERIODS
#define SDW_PLAYBACK_MAX_PERIOD_SIZE
#define SDW_PLAYBACK_MIN_PERIOD_SIZE
#define SDW_CAPTURE_MIN_NUM_PERIODS
#define SDW_CAPTURE_MAX_NUM_PERIODS
#define SDW_CAPTURE_MAX_PERIOD_SIZE
#define SDW_CAPTURE_MIN_PERIOD_SIZE

#define SDW_MAX_BUFFER
#define SDW_MIN_BUFFER

enum acp_config {};

enum amd_sdw0_channel {};

enum amd_sdw1_channel {};

struct pdm_stream_instance {};

struct pdm_dev_data {};

struct sdw_dma_dev_data {};

struct acp_sdw_dma_stream {};

acp_sdw_dma_count;

struct sdw_dma_ring_buf_reg {};

/**
 * struct acp63_dev_data - acp pci driver context
 * @acp63_base: acp mmio base
 * @res: resource
 * @pdm_dev: ACP PDM controller platform device
 * @dmic_codec: platform device for DMIC Codec
 * sdw_dma_dev: platform device for SoundWire DMA controller
 * @mach_dev: platform device for machine driver to support ACP PDM/SoundWire configuration
 * @acp_lock: used to protect acp common registers
 * @info: SoundWire AMD information found in ACPI tables
 * @sdw: SoundWire context for all SoundWire manager instances
 * @machine: ACPI machines for SoundWire interface
 * @is_sdw_dev: flag set to true when any SoundWire manager instances are available
 * @is_pdm_dev: flag set to true when ACP PDM controller exists
 * @is_pdm_config: flat set to true when PDM configuration is selected from BIOS
 * @is_sdw_config: flag set to true when SDW configuration is selected from BIOS
 * @sdw_en_stat: flag set to true when any one of the SoundWire manager instance is enabled
 * @addr: pci ioremap address
 * @reg_range: ACP reigister range
 * @sdw0-dma_intr_stat: DMA interrupt status array for SoundWire manager-SW0 instance
 * @sdw_dma_intr_stat: DMA interrupt status array for SoundWire manager-SW1 instance
 */

struct acp63_dev_data {};

int snd_amd_acp_find_config(struct pci_dev *pci);