#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/kobject.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/sysfs.h>
#include <linux/types.h>
#include <linux/dma/imx-dma.h>
#include <sound/dmaengine_pcm.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <sound/tlv.h>
#include <sound/core.h>
#include "fsl_micfil.h"
#include "fsl_utils.h"
#define MICFIL_OSR_DEFAULT …
enum quality { … };
struct fsl_micfil { … };
struct fsl_micfil_soc_data { … };
static struct fsl_micfil_soc_data fsl_micfil_imx8mm = …;
static struct fsl_micfil_soc_data fsl_micfil_imx8mp = …;
static struct fsl_micfil_soc_data fsl_micfil_imx93 = …;
static const struct of_device_id fsl_micfil_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, fsl_micfil_dt_ids);
static const char * const micfil_quality_select_texts[] = …;
static const struct soc_enum fsl_micfil_quality_enum = …;
static DECLARE_TLV_DB_SCALE(gain_tlv, 0, 100, 0);
static int micfil_set_quality(struct fsl_micfil *micfil)
{ … }
static int micfil_quality_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int micfil_quality_set(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const char * const micfil_hwvad_enable[] = …;
static const char * const micfil_hwvad_init_mode[] = …;
static const char * const micfil_hwvad_hpf_texts[] = …;
static const char * const micfil_dc_remover_texts[] = …;
static const struct soc_enum hwvad_enable_enum = …;
static const struct soc_enum hwvad_init_mode_enum = …;
static const struct soc_enum hwvad_hpf_enum = …;
static const struct soc_enum fsl_micfil_dc_remover_enum = …;
static int micfil_put_dc_remover_state(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int micfil_get_dc_remover_state(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int hwvad_put_enable(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int hwvad_get_enable(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int hwvad_put_init_mode(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int hwvad_get_init_mode(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int hwvad_detected(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new fsl_micfil_snd_controls[] = …;
static int fsl_micfil_use_verid(struct device *dev)
{ … }
static int fsl_micfil_reset(struct device *dev)
{ … }
static int fsl_micfil_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int fsl_micfil_configure_hwvad_interrupts(struct fsl_micfil *micfil, int enable)
{ … }
static int fsl_micfil_init_hwvad_energy_mode(struct fsl_micfil *micfil)
{ … }
static int fsl_micfil_init_hwvad_envelope_mode(struct fsl_micfil *micfil)
{ … }
static int fsl_micfil_hwvad_enable(struct fsl_micfil *micfil)
{ … }
static int fsl_micfil_hwvad_disable(struct fsl_micfil *micfil)
{ … }
static int fsl_micfil_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *dai)
{ … }
static int fsl_micfil_reparent_rootclk(struct fsl_micfil *micfil, unsigned int sample_rate)
{ … }
static int fsl_micfil_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int fsl_micfil_dai_probe(struct snd_soc_dai *cpu_dai)
{ … }
static const struct snd_soc_dai_ops fsl_micfil_dai_ops = …;
static struct snd_soc_dai_driver fsl_micfil_dai = …;
static const struct snd_soc_component_driver fsl_micfil_component = …;
static const struct reg_default fsl_micfil_reg_defaults[] = …;
static bool fsl_micfil_readable_reg(struct device *dev, unsigned int reg)
{ … }
static bool fsl_micfil_writeable_reg(struct device *dev, unsigned int reg)
{ … }
static bool fsl_micfil_volatile_reg(struct device *dev, unsigned int reg)
{ … }
static const struct regmap_config fsl_micfil_regmap_config = …;
static irqreturn_t micfil_isr(int irq, void *devid)
{ … }
static irqreturn_t micfil_err_isr(int irq, void *devid)
{ … }
static irqreturn_t voice_detected_fn(int irq, void *devid)
{ … }
static irqreturn_t hwvad_isr(int irq, void *devid)
{ … }
static irqreturn_t hwvad_err_isr(int irq, void *devid)
{ … }
static int fsl_micfil_runtime_suspend(struct device *dev);
static int fsl_micfil_runtime_resume(struct device *dev);
static int fsl_micfil_probe(struct platform_device *pdev)
{ … }
static void fsl_micfil_remove(struct platform_device *pdev)
{ … }
static int fsl_micfil_runtime_suspend(struct device *dev)
{ … }
static int fsl_micfil_runtime_resume(struct device *dev)
{ … }
static const struct dev_pm_ops fsl_micfil_pm_ops = …;
static struct platform_driver fsl_micfil_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;