linux/sound/soc/meson/axg-pdm.c

// SPDX-License-Identifier: (GPL-2.0 OR MIT)
//
// Copyright (c) 2018 BayLibre, SAS.
// Author: Jerome Brunet <[email protected]>

#include <linux/clk.h>
#include <linux/module.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/regmap.h>
#include <sound/soc.h>
#include <sound/soc-dai.h>
#include <sound/pcm_params.h>

#define PDM_CTRL
#define PDM_CTRL_EN
#define PDM_CTRL_OUT_MODE
#define PDM_CTRL_BYPASS_MODE
#define PDM_CTRL_RST_FIFO
#define PDM_CTRL_CHAN_RSTN_MASK
#define PDM_CTRL_CHAN_RSTN(x)
#define PDM_CTRL_CHAN_EN_MASK
#define PDM_CTRL_CHAN_EN(x)
#define PDM_HCIC_CTRL1
#define PDM_FILTER_EN
#define PDM_HCIC_CTRL1_GAIN_SFT_MASK
#define PDM_HCIC_CTRL1_GAIN_SFT(x)
#define PDM_HCIC_CTRL1_GAIN_MULT_MASK
#define PDM_HCIC_CTRL1_GAIN_MULT(x)
#define PDM_HCIC_CTRL1_DSR_MASK
#define PDM_HCIC_CTRL1_DSR(x)
#define PDM_HCIC_CTRL1_STAGE_NUM_MASK
#define PDM_HCIC_CTRL1_STAGE_NUM(x)
#define PDM_HCIC_CTRL2
#define PDM_F1_CTRL
#define PDM_LPF_ROUND_MODE_MASK
#define PDM_LPF_ROUND_MODE(x)
#define PDM_LPF_DSR_MASK
#define PDM_LPF_DSR(x)
#define PDM_LPF_STAGE_NUM_MASK
#define PDM_LPF_STAGE_NUM(x)
#define PDM_LPF_MAX_STAGE
#define PDM_LPF_NUM
#define PDM_F2_CTRL
#define PDM_F3_CTRL
#define PDM_HPF_CTRL
#define PDM_HPF_SFT_STEPS_MASK
#define PDM_HPF_SFT_STEPS(x)
#define PDM_HPF_OUT_FACTOR_MASK
#define PDM_HPF_OUT_FACTOR(x)
#define PDM_CHAN_CTRL
#define PDM_CHAN_CTRL_POINTER_WIDTH
#define PDM_CHAN_CTRL_POINTER_MAX
#define PDM_CHAN_CTRL_NUM
#define PDM_CHAN_CTRL1
#define PDM_COEFF_ADDR
#define PDM_COEFF_DATA
#define PDM_CLKG_CTRL
#define PDM_STS

struct axg_pdm_lpf {};

struct axg_pdm_hcic {};

struct axg_pdm_hpf {};

struct axg_pdm_filters {};

struct axg_pdm_cfg {};

struct axg_pdm {};

static void axg_pdm_enable(struct regmap *map)
{}

static void axg_pdm_disable(struct regmap *map)
{}

static void axg_pdm_filters_enable(struct regmap *map, bool enable)
{}

static int axg_pdm_trigger(struct snd_pcm_substream *substream, int cmd,
			   struct snd_soc_dai *dai)
{}

static unsigned int axg_pdm_get_os(struct axg_pdm *priv)
{}

static int axg_pdm_set_sysclk(struct axg_pdm *priv, unsigned int os,
			      unsigned int rate)
{}

static int axg_pdm_set_sample_pointer(struct axg_pdm *priv)
{}

static void axg_pdm_set_channel_mask(struct axg_pdm *priv,
				     unsigned int channels)
{}

static int axg_pdm_hw_params(struct snd_pcm_substream *substream,
			     struct snd_pcm_hw_params *params,
			     struct snd_soc_dai *dai)
{}

static int axg_pdm_startup(struct snd_pcm_substream *substream,
			   struct snd_soc_dai *dai)
{}

static void axg_pdm_shutdown(struct snd_pcm_substream *substream,
			     struct snd_soc_dai *dai)
{}

static void axg_pdm_set_hcic_ctrl(struct axg_pdm *priv)
{}

static void axg_pdm_set_lpf_ctrl(struct axg_pdm *priv, unsigned int index)
{}

static void axg_pdm_set_hpf_ctrl(struct axg_pdm *priv)
{}

static int axg_pdm_set_lpf_filters(struct axg_pdm *priv)
{}

static int axg_pdm_dai_probe(struct snd_soc_dai *dai)
{}

static int axg_pdm_dai_remove(struct snd_soc_dai *dai)
{}

static const struct snd_soc_dai_ops axg_pdm_dai_ops =;

static struct snd_soc_dai_driver axg_pdm_dai_drv =;

static const struct snd_soc_component_driver axg_pdm_component_drv =;

static const struct regmap_config axg_pdm_regmap_cfg =;

static const unsigned int lpf1_default_tap[] =;

static const unsigned int lpf2_default_tap[] =;

static const unsigned int lpf3_default_tap[] =;

/*
 * These values are sane defaults for the axg platform:
 * - OS = 64
 * - Latency = 38700 (?)
 *
 * TODO: There is a lot of different HCIC, LPFs and HPF configurations possible.
 *       the configuration may depend on the dmic used by the platform, the
 *       expected tradeoff between latency and quality, etc ... If/When other
 *       settings are required, we should add a fw interface to this driver to
 *       load new filter settings.
 */
static const struct axg_pdm_filters axg_default_filters =;

static const struct axg_pdm_cfg axg_pdm_config =;

static const struct of_device_id axg_pdm_of_match[] =;
MODULE_DEVICE_TABLE(of, axg_pdm_of_match);

static int axg_pdm_probe(struct platform_device *pdev)
{}

static struct platform_driver axg_pdm_pdrv =;
module_platform_driver();

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