#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/bitfield.h>
#include <linux/err.h>
#include <linux/io.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-dai.h>
#include <linux/pm_runtime.h>
#include "acp6x.h"
#define DRV_NAME …
static int pdm_gain = …;
module_param(pdm_gain, int, 0644);
MODULE_PARM_DESC(…) …;
static const struct snd_pcm_hardware acp6x_pdm_hardware_capture = …;
static void acp6x_init_pdm_ring_buffer(u32 physical_addr, u32 buffer_size,
u32 watermark_size, void __iomem *acp_base)
{ … }
static void acp6x_enable_pdm_clock(void __iomem *acp_base)
{ … }
static void acp6x_enable_pdm_interrupts(void __iomem *acp_base)
{ … }
static void acp6x_disable_pdm_interrupts(void __iomem *acp_base)
{ … }
static bool acp6x_check_pdm_dma_status(void __iomem *acp_base)
{ … }
static int acp6x_start_pdm_dma(void __iomem *acp_base)
{ … }
static int acp6x_stop_pdm_dma(void __iomem *acp_base)
{ … }
static void acp6x_config_dma(struct pdm_stream_instance *rtd, int direction)
{ … }
static int acp6x_pdm_dma_open(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ … }
static int acp6x_pdm_dma_hw_params(struct snd_soc_component *component,
struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{ … }
static u64 acp6x_pdm_get_byte_count(struct pdm_stream_instance *rtd,
int direction)
{ … }
static snd_pcm_uframes_t acp6x_pdm_dma_pointer(struct snd_soc_component *comp,
struct snd_pcm_substream *stream)
{ … }
static int acp6x_pdm_dma_new(struct snd_soc_component *component,
struct snd_soc_pcm_runtime *rtd)
{ … }
static int acp6x_pdm_dma_close(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ … }
static int acp6x_pdm_dai_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai)
{ … }
static const struct snd_soc_dai_ops acp6x_pdm_dai_ops = …;
static struct snd_soc_dai_driver acp6x_pdm_dai_driver = …;
static const struct snd_soc_component_driver acp6x_pdm_component = …;
static int acp6x_pdm_audio_probe(struct platform_device *pdev)
{ … }
static void acp6x_pdm_audio_remove(struct platform_device *pdev)
{ … }
static int __maybe_unused acp6x_pdm_resume(struct device *dev)
{ … }
static int __maybe_unused acp6x_pdm_suspend(struct device *dev)
{ … }
static int __maybe_unused acp6x_pdm_runtime_resume(struct device *dev)
{ … }
static const struct dev_pm_ops acp6x_pdm_pm_ops = …;
static struct platform_driver acp6x_pdm_dma_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;