#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 "acp63.h"
#define DRV_NAME …
static int pdm_gain = …;
module_param(pdm_gain, int, 0644);
MODULE_PARM_DESC(…) …;
static const struct snd_pcm_hardware acp63_pdm_hardware_capture = …;
static void acp63_init_pdm_ring_buffer(u32 physical_addr, u32 buffer_size,
u32 watermark_size, void __iomem *acp_base)
{ … }
static void acp63_enable_pdm_clock(void __iomem *acp_base)
{ … }
static void acp63_enable_pdm_interrupts(struct pdm_dev_data *adata)
{ … }
static void acp63_disable_pdm_interrupts(struct pdm_dev_data *adata)
{ … }
static bool acp63_check_pdm_dma_status(void __iomem *acp_base)
{ … }
static int acp63_start_pdm_dma(void __iomem *acp_base)
{ … }
static int acp63_stop_pdm_dma(void __iomem *acp_base)
{ … }
static void acp63_config_dma(struct pdm_stream_instance *rtd, int direction)
{ … }
static int acp63_pdm_dma_open(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ … }
static int acp63_pdm_dma_hw_params(struct snd_soc_component *component,
struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{ … }
static u64 acp63_pdm_get_byte_count(struct pdm_stream_instance *rtd,
int direction)
{ … }
static snd_pcm_uframes_t acp63_pdm_dma_pointer(struct snd_soc_component *comp,
struct snd_pcm_substream *stream)
{ … }
static int acp63_pdm_dma_new(struct snd_soc_component *component,
struct snd_soc_pcm_runtime *rtd)
{ … }
static int acp63_pdm_dma_close(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ … }
static int acp63_pdm_dai_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai)
{ … }
static const struct snd_soc_dai_ops acp63_pdm_dai_ops = …;
static struct snd_soc_dai_driver acp63_pdm_dai_driver = …;
static const struct snd_soc_component_driver acp63_pdm_component = …;
static int acp63_pdm_audio_probe(struct platform_device *pdev)
{ … }
static void acp63_pdm_audio_remove(struct platform_device *pdev)
{ … }
static int __maybe_unused acp63_pdm_resume(struct device *dev)
{ … }
static int __maybe_unused acp63_pdm_suspend(struct device *dev)
{ … }
static int __maybe_unused acp63_pdm_runtime_resume(struct device *dev)
{ … }
static const struct dev_pm_ops acp63_pdm_pm_ops = …;
static struct platform_driver acp63_pdm_dma_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;