#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include "tegra186_asrc.h"
#include "tegra_cif.h"
#define ASRC_STREAM_SOURCE_SELECT(id) …
#define ASRC_STREAM_REG(reg, id) …
#define ASRC_STREAM_REG_DEFAULTS(id) …
static const struct reg_default tegra186_asrc_reg_defaults[] = …;
static void tegra186_asrc_lock_stream(struct tegra186_asrc *asrc,
unsigned int id)
{ … }
static int __maybe_unused tegra186_asrc_runtime_suspend(struct device *dev)
{ … }
static int __maybe_unused tegra186_asrc_runtime_resume(struct device *dev)
{ … }
static int tegra186_asrc_set_audio_cif(struct tegra186_asrc *asrc,
struct snd_pcm_hw_params *params,
unsigned int reg)
{ … }
static int tegra186_asrc_in_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int tegra186_asrc_out_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int tegra186_asrc_get_ratio_source(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int tegra186_asrc_put_ratio_source(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int tegra186_asrc_get_ratio_int(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int tegra186_asrc_put_ratio_int(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int tegra186_asrc_get_ratio_frac(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int tegra186_asrc_put_ratio_frac(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int tegra186_asrc_get_hwcomp_disable(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int tegra186_asrc_put_hwcomp_disable(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int tegra186_asrc_get_input_threshold(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int tegra186_asrc_put_input_threshold(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int tegra186_asrc_get_output_threshold(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int tegra186_asrc_put_output_threshold(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int tegra186_asrc_widget_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static const struct snd_soc_dai_ops tegra186_asrc_in_dai_ops = …;
static const struct snd_soc_dai_ops tegra186_asrc_out_dai_ops = …;
#define IN_DAI(id) …
#define OUT_DAI(id) …
static struct snd_soc_dai_driver tegra186_asrc_dais[] = …;
static const struct snd_soc_dapm_widget tegra186_asrc_widgets[] = …;
#define ASRC_STREAM_ROUTE(id, sname) …
#define ASRC_ROUTE(id) …
#define ASRC_RATIO_ROUTE(sname) …
static const struct snd_soc_dapm_route tegra186_asrc_routes[] = …;
static const char * const tegra186_asrc_ratio_source_text[] = …;
#define ASRC_SOURCE_DECL(name, id) …
ASRC_SOURCE_DECL(src_select1, 0);
ASRC_SOURCE_DECL(src_select2, 1);
ASRC_SOURCE_DECL(src_select3, 2);
ASRC_SOURCE_DECL(src_select4, 3);
ASRC_SOURCE_DECL(src_select5, 4);
ASRC_SOURCE_DECL(src_select6, 5);
#define SOC_SINGLE_EXT_FRAC(xname, xregbase, xmax, xget, xput) …
static const struct snd_kcontrol_new tegra186_asrc_controls[] = …;
static const struct snd_soc_component_driver tegra186_asrc_cmpnt = …;
static bool tegra186_asrc_wr_reg(struct device *dev, unsigned int reg)
{ … }
static bool tegra186_asrc_rd_reg(struct device *dev, unsigned int reg)
{ … }
static bool tegra186_asrc_volatile_reg(struct device *dev, unsigned int reg)
{ … }
static const struct regmap_config tegra186_asrc_regmap_config = …;
static const struct of_device_id tegra186_asrc_of_match[] = …;
MODULE_DEVICE_TABLE(of, tegra186_asrc_of_match);
static int tegra186_asrc_platform_probe(struct platform_device *pdev)
{ … }
static void tegra186_asrc_platform_remove(struct platform_device *pdev)
{ … }
static const struct dev_pm_ops tegra186_asrc_pm_ops = …;
static struct platform_driver tegra186_asrc_driver = …;
module_platform_driver(…) …
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;