linux/sound/soc/amd/ps/ps-sdw-dma.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * AMD ALSA SoC Pink Sardine SoundWire DMA Driver
 *
 * Copyright 2023 Advanced Micro Devices, Inc.
 */

#include <linux/err.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-dai.h>
#include <linux/pm_runtime.h>
#include <linux/soundwire/sdw_amd.h>
#include "acp63.h"

#define DRV_NAME

static struct sdw_dma_ring_buf_reg sdw0_dma_ring_buf_reg[ACP63_SDW0_DMA_MAX_STREAMS] =;

/*
 * SDW1 instance supports one TX stream and one RX stream.
 * For TX/RX streams DMA registers programming for SDW1 instance, it uses ACP_P1_AUDIO1 register
 * set as per hardware register documentation
 */
static struct sdw_dma_ring_buf_reg sdw1_dma_ring_buf_reg[ACP63_SDW1_DMA_MAX_STREAMS] =;

static u32 sdw0_dma_enable_reg[ACP63_SDW0_DMA_MAX_STREAMS] =;

/*
 * SDW1 instance supports one TX stream and one RX stream.
 * For TX/RX streams DMA enable register programming for SDW1 instance,
 * it uses ACP_SW1_AUDIO1_TX_EN and ACP_SW1_AUDIO1_RX_EN registers
 * as per hardware register documentation.
 */
static u32 sdw1_dma_enable_reg[ACP63_SDW1_DMA_MAX_STREAMS] =;

static const struct snd_pcm_hardware acp63_sdw_hardware_playback =;

static const struct snd_pcm_hardware acp63_sdw_hardware_capture =;

static void acp63_enable_disable_sdw_dma_interrupts(void __iomem *acp_base, bool enable)
{}

static void acp63_config_dma(struct acp_sdw_dma_stream *stream, void __iomem *acp_base,
			     u32 stream_id)
{}

static int acp63_configure_sdw_ringbuffer(void __iomem *acp_base, u32 stream_id, u32 size,
					  u32 manager_instance)
{}

static int acp63_sdw_dma_open(struct snd_soc_component *component,
			      struct snd_pcm_substream *substream)
{}

static int acp63_sdw_dma_hw_params(struct snd_soc_component *component,
				   struct snd_pcm_substream *substream,
				   struct snd_pcm_hw_params *params)
{}

static u64 acp63_sdw_get_byte_count(struct acp_sdw_dma_stream *stream, void __iomem *acp_base)
{}

static snd_pcm_uframes_t acp63_sdw_dma_pointer(struct snd_soc_component *comp,
					       struct snd_pcm_substream *substream)
{}

static int acp63_sdw_dma_new(struct snd_soc_component *component,
			     struct snd_soc_pcm_runtime *rtd)
{}

static int acp63_sdw_dma_close(struct snd_soc_component *component,
			       struct snd_pcm_substream *substream)
{}

static int acp63_sdw_dma_enable(struct snd_pcm_substream *substream,
				void __iomem *acp_base, bool sdw_dma_enable)
{}

static int acp63_sdw_dma_trigger(struct snd_soc_component *comp,
				 struct snd_pcm_substream *substream,
				 int cmd)
{}

static const struct snd_soc_component_driver acp63_sdw_component =;

static int acp63_sdw_platform_probe(struct platform_device *pdev)
{}

static void acp63_sdw_platform_remove(struct platform_device *pdev)
{}

static int acp_restore_sdw_dma_config(struct sdw_dma_dev_data *sdw_data)
{}

static int __maybe_unused acp63_sdw_pcm_resume(struct device *dev)
{}

static const struct dev_pm_ops acp63_pm_ops =;

static struct platform_driver acp63_sdw_dma_driver =;

module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_ALIAS();