#include <linux/module.h>
#include <linux/clk.h>
#include <linux/of.h>
#include <linux/pm_runtime.h>
#include <linux/rational.h>
#include <linux/regmap.h>
#include <linux/reset.h>
#include <sound/dmaengine_pcm.h>
#include <sound/pcm_params.h>
#include "rockchip_pdm.h"
#define PDM_DMA_BURST_SIZE …
#define PDM_SIGNOFF_CLK_RATE …
#define PDM_PATH_MAX …
enum rk_pdm_version { … };
struct rk_pdm_dev { … };
struct rk_pdm_clkref { … };
struct rk_pdm_ds_ratio { … };
static struct rk_pdm_clkref clkref[] = …;
static struct rk_pdm_ds_ratio ds_ratio[] = …;
static unsigned int get_pdm_clk(struct rk_pdm_dev *pdm, unsigned int sr,
unsigned int *clk_src, unsigned int *clk_out)
{ … }
static unsigned int get_pdm_ds_ratio(unsigned int sr)
{ … }
static unsigned int get_pdm_cic_ratio(unsigned int clk)
{ … }
static unsigned int samplerate_to_bit(unsigned int samplerate)
{ … }
static inline struct rk_pdm_dev *to_info(struct snd_soc_dai *dai)
{ … }
static void rockchip_pdm_rxctrl(struct rk_pdm_dev *pdm, int on)
{ … }
static int rockchip_pdm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int rockchip_pdm_set_fmt(struct snd_soc_dai *cpu_dai,
unsigned int fmt)
{ … }
static int rockchip_pdm_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *dai)
{ … }
static int rockchip_pdm_dai_probe(struct snd_soc_dai *dai)
{ … }
static const struct snd_soc_dai_ops rockchip_pdm_dai_ops = …;
#define ROCKCHIP_PDM_RATES …
#define ROCKCHIP_PDM_FORMATS …
static struct snd_soc_dai_driver rockchip_pdm_dai = …;
static const struct snd_soc_component_driver rockchip_pdm_component = …;
static int rockchip_pdm_runtime_suspend(struct device *dev)
{ … }
static int rockchip_pdm_runtime_resume(struct device *dev)
{ … }
static bool rockchip_pdm_wr_reg(struct device *dev, unsigned int reg)
{ … }
static bool rockchip_pdm_rd_reg(struct device *dev, unsigned int reg)
{ … }
static bool rockchip_pdm_volatile_reg(struct device *dev, unsigned int reg)
{ … }
static bool rockchip_pdm_precious_reg(struct device *dev, unsigned int reg)
{ … }
static const struct reg_default rockchip_pdm_reg_defaults[] = …;
static const struct regmap_config rockchip_pdm_regmap_config = …;
static const struct of_device_id rockchip_pdm_match[] __maybe_unused = …;
MODULE_DEVICE_TABLE(of, rockchip_pdm_match);
static int rockchip_pdm_path_parse(struct rk_pdm_dev *pdm, struct device_node *node)
{ … }
static int rockchip_pdm_probe(struct platform_device *pdev)
{ … }
static void rockchip_pdm_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int rockchip_pdm_suspend(struct device *dev)
{ … }
static int rockchip_pdm_resume(struct device *dev)
{ … }
#endif
static const struct dev_pm_ops rockchip_pdm_pm_ops = …;
static struct platform_driver rockchip_pdm_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;