linux/sound/soc/atmel/mchp-pdmc.c

// SPDX-License-Identifier: GPL-2.0
//
// Driver for Microchip Pulse Density Microphone Controller (PDMC) interfaces
//
// Copyright (C) 2019-2022 Microchip Technology Inc. and its subsidiaries
//
// Author: Codrin Ciubotariu <[email protected]>

#include <dt-bindings/sound/microchip,pdmc.h>

#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>

#include <sound/core.h>
#include <sound/dmaengine_pcm.h>
#include <sound/pcm_params.h>
#include <sound/tlv.h>

/*
 * ---- PDMC Register map ----
 */
#define MCHP_PDMC_CR
#define MCHP_PDMC_MR
#define MCHP_PDMC_CFGR
#define MCHP_PDMC_RHR
#define MCHP_PDMC_IER
#define MCHP_PDMC_IDR
#define MCHP_PDMC_IMR
#define MCHP_PDMC_ISR
#define MCHP_PDMC_VER

/*
 * ---- Control Register (Write-only) ----
 */
#define MCHP_PDMC_CR_SWRST

/*
 * ---- Mode Register (Read/Write) ----
 */
#define MCHP_PDMC_MR_PDMCEN_MASK
#define MCHP_PDMC_MR_PDMCEN(ch)

#define MCHP_PDMC_MR_OSR_MASK
#define MCHP_PDMC_MR_OSR64
#define MCHP_PDMC_MR_OSR128
#define MCHP_PDMC_MR_OSR256

#define MCHP_PDMC_MR_SINCORDER_MASK

#define MCHP_PDMC_MR_SINC_OSR_MASK
#define MCHP_PDMC_MR_SINC_OSR_DIS
#define MCHP_PDMC_MR_SINC_OSR_8
#define MCHP_PDMC_MR_SINC_OSR_16
#define MCHP_PDMC_MR_SINC_OSR_32
#define MCHP_PDMC_MR_SINC_OSR_64
#define MCHP_PDMC_MR_SINC_OSR_128
#define MCHP_PDMC_MR_SINC_OSR_256

#define MCHP_PDMC_MR_CHUNK_MASK

/*
 * ---- Configuration Register (Read/Write) ----
 */
#define MCHP_PDMC_CFGR_BSSEL_MASK
#define MCHP_PDMC_CFGR_BSSEL(ch)

#define MCHP_PDMC_CFGR_PDMSEL_MASK
#define MCHP_PDMC_CFGR_PDMSEL(ch)

/*
 * ---- Interrupt Enable/Disable/Mask/Status Registers ----
 */
#define MCHP_PDMC_IR_RXRDY
#define MCHP_PDMC_IR_RXEMPTY
#define MCHP_PDMC_IR_RXFULL
#define MCHP_PDMC_IR_RXCHUNK
#define MCHP_PDMC_IR_RXUDR
#define MCHP_PDMC_IR_RXOVR

/*
 * ---- Version Register (Read-only) ----
 */
#define MCHP_PDMC_VER_VERSION

#define MCHP_PDMC_MAX_CHANNELS
#define MCHP_PDMC_DS_NO
#define MCHP_PDMC_EDGE_NO

struct mic_map {};

struct mchp_pdmc_chmap {};

struct mchp_pdmc {};

static const char *const mchp_pdmc_sinc_filter_order_text[] =;

static const unsigned int mchp_pdmc_sinc_filter_order_values[] =;

static const struct soc_enum mchp_pdmc_sinc_filter_order_enum =;

static int mchp_pdmc_sinc_order_get(struct snd_kcontrol *kcontrol,
				    struct snd_ctl_elem_value *uvalue)
{}

static int mchp_pdmc_sinc_order_put(struct snd_kcontrol *kcontrol,
				    struct snd_ctl_elem_value *uvalue)
{}

static int mchp_pdmc_af_get(struct snd_kcontrol *kcontrol,
			    struct snd_ctl_elem_value *uvalue)
{}

static int mchp_pdmc_af_put(struct snd_kcontrol *kcontrol,
			    struct snd_ctl_elem_value *uvalue)
{}

static int mchp_pdmc_chmap_ctl_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{}

static inline struct snd_pcm_substream *
mchp_pdmc_chmap_substream(struct mchp_pdmc_chmap *info, unsigned int idx)
{}

static struct snd_pcm_chmap_elem *mchp_pdmc_chmap_get(struct snd_pcm_substream *substream,
						      struct mchp_pdmc_chmap *ch_info)
{}

static int mchp_pdmc_chmap_ctl_get(struct snd_kcontrol *kcontrol,
				   struct snd_ctl_elem_value *ucontrol)
{}

static int mchp_pdmc_chmap_ctl_put(struct snd_kcontrol *kcontrol,
				   struct snd_ctl_elem_value *ucontrol)
{}

static void mchp_pdmc_chmap_ctl_private_free(struct snd_kcontrol *kcontrol)
{}

static int mchp_pdmc_chmap_ctl_tlv(struct snd_kcontrol *kcontrol, int op_flag,
				   unsigned int size, unsigned int __user *tlv)
{}

static const struct snd_kcontrol_new mchp_pdmc_snd_controls[] =;

static int mchp_pdmc_close(struct snd_soc_component *component,
			   struct snd_pcm_substream *substream)
{}

static int mchp_pdmc_open(struct snd_soc_component *component,
			  struct snd_pcm_substream *substream)
{}

static const struct snd_soc_component_driver mchp_pdmc_dai_component =;

static const unsigned int mchp_pdmc_1mic[] =;
static const unsigned int mchp_pdmc_2mic[] =;
static const unsigned int mchp_pdmc_3mic[] =;
static const unsigned int mchp_pdmc_4mic[] =;

static const struct snd_pcm_hw_constraint_list mchp_pdmc_chan_constr[] =;

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

static int mchp_pdmc_dai_probe(struct snd_soc_dai *dai)
{}

static int mchp_pdmc_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{}

static u32 mchp_pdmc_mr_set_osr(int audio_filter_en, unsigned int osr)
{}

static inline int mchp_pdmc_period_to_maxburst(int period_size)
{}

static struct snd_pcm_chmap_elem mchp_pdmc_std_chmaps[] =;

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

static void mchp_pdmc_noise_filter_workaround(struct mchp_pdmc *dd)
{}

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

static int mchp_pdmc_add_chmap_ctls(struct snd_pcm *pcm, struct mchp_pdmc *dd)
{}

static int mchp_pdmc_pcm_new(struct snd_soc_pcm_runtime *rtd,
			     struct snd_soc_dai *dai)
{}

static const struct snd_soc_dai_ops mchp_pdmc_dai_ops =;

static struct snd_soc_dai_driver mchp_pdmc_dai =;

/* PDMC interrupt handler */
static irqreturn_t mchp_pdmc_interrupt(int irq, void *dev_id)
{}

/* regmap configuration */
static bool mchp_pdmc_readable_reg(struct device *dev, unsigned int reg)
{}

static bool mchp_pdmc_writeable_reg(struct device *dev, unsigned int reg)
{}

static bool mchp_pdmc_volatile_reg(struct device *dev, unsigned int reg)
{}

static bool mchp_pdmc_precious_reg(struct device *dev, unsigned int reg)
{}

static const struct regmap_config mchp_pdmc_regmap_config =;

static int mchp_pdmc_dt_init(struct mchp_pdmc *dd)
{}

/* used to clean the channel index found on RHR's MSB */
static int mchp_pdmc_process(struct snd_pcm_substream *substream,
			     int channel, unsigned long hwoff,
			     unsigned long bytes)
{}

static struct snd_dmaengine_pcm_config mchp_pdmc_config =;

static int mchp_pdmc_runtime_suspend(struct device *dev)
{}

static int mchp_pdmc_runtime_resume(struct device *dev)
{}

static int mchp_pdmc_probe(struct platform_device *pdev)
{}

static void mchp_pdmc_remove(struct platform_device *pdev)
{}

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

static const struct dev_pm_ops mchp_pdmc_pm_ops =;

static struct platform_driver mchp_pdmc_driver =;
module_platform_driver();

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