#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/bitfield.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/pm_runtime.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-dai.h>
#include "rn_acp3x.h"
#define DRV_NAME …
static int pdm_gain = …;
module_param(pdm_gain, int, 0644);
MODULE_PARM_DESC(…) …;
static const struct snd_pcm_hardware acp_pdm_hardware_capture = …;
static irqreturn_t pdm_irq_handler(int irq, void *dev_id)
{ … }
static void init_pdm_ring_buffer(u32 physical_addr,
u32 buffer_size,
u32 watermark_size,
void __iomem *acp_base)
{ … }
static void enable_pdm_clock(void __iomem *acp_base)
{ … }
static void enable_pdm_interrupts(void __iomem *acp_base)
{ … }
static void disable_pdm_interrupts(void __iomem *acp_base)
{ … }
static bool check_pdm_dma_status(void __iomem *acp_base)
{ … }
static int start_pdm_dma(void __iomem *acp_base)
{ … }
static int stop_pdm_dma(void __iomem *acp_base)
{ … }
static void config_acp_dma(struct pdm_stream_instance *rtd, int direction)
{ … }
static int acp_pdm_dma_open(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ … }
static int acp_pdm_dma_hw_params(struct snd_soc_component *component,
struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{ … }
static u64 acp_pdm_get_byte_count(struct pdm_stream_instance *rtd,
int direction)
{ … }
static snd_pcm_uframes_t acp_pdm_dma_pointer(struct snd_soc_component *comp,
struct snd_pcm_substream *stream)
{ … }
static int acp_pdm_dma_new(struct snd_soc_component *component,
struct snd_soc_pcm_runtime *rtd)
{ … }
static int acp_pdm_dma_close(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ … }
static int acp_pdm_dai_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai)
{ … }
static const struct snd_soc_dai_ops acp_pdm_dai_ops = …;
static struct snd_soc_dai_driver acp_pdm_dai_driver = …;
static const struct snd_soc_component_driver acp_pdm_component = …;
static int acp_pdm_audio_probe(struct platform_device *pdev)
{ … }
static void acp_pdm_audio_remove(struct platform_device *pdev)
{ … }
static int acp_pdm_resume(struct device *dev)
{ … }
static int acp_pdm_runtime_suspend(struct device *dev)
{ … }
static int acp_pdm_runtime_resume(struct device *dev)
{ … }
static const struct dev_pm_ops acp_pdm_pm_ops = …;
static struct platform_driver acp_pdm_dma_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;