linux/sound/soc/tegra/tegra210_sfc.c

// SPDX-License-Identifier: GPL-2.0-only
//
// tegra210_sfc.c - Tegra210 SFC driver
//
// Copyright (c) 2021-2023 NVIDIA CORPORATION.  All rights reserved.

#include <linux/clk.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.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 "tegra210_sfc.h"
#include "tegra_cif.h"

#define UNSUPP_CONV
#define BYPASS_CONV

static const struct reg_default tegra210_sfc_reg_defaults[] =;

static const int tegra210_sfc_rates[TEGRA210_SFC_NUM_RATES] =;

/* coeff RAM tables required for SFC */
static u32 coef_8to11[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_8to16[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_8to22[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_8to24[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_8to32[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_8to44[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_8to48[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_8to88[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_8to96[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_11to8[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_11to16[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_11to22[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_11to24[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_11to32[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_11to44[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_11to48[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_11to88[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_11to96[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_16to8[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_16to11[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_16to22[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_16to24[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_16to32[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_16to44[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_16to48[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_16to88[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_16to96[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_16to176[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_16to192[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_22to8[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_22to11[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_22to16[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_22to24[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_22to32[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_22to44[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_22to48[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_22to88[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_22to96[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_22to176[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_22to192[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_24to8[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_24to11[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_24to16[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_24to22[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_24to32[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_24to44[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_24to48[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_24to88[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_24to96[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_24to176[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_24to192[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_32to8[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_32to11[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_32to16[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_32to22[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_32to24[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_32to44[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_32to48[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_32to88[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_32to96[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_32to176[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_32to192[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_44to8[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_44to11[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_44to16[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_44to22[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_44to24[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_44to32[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_44to48[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_44to88[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_44to96[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_44to176[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_44to192[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_48to8[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_48to11[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_48to16[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_48to22[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_48to24[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_48to32[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_48to44[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_48to88[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_48to96[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_48to176[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_48to192[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_88to8[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_88to11[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_88to16[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_88to22[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_88to24[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_88to32[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_88to44[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_88to48[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_88to96[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_88to176[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_88to192[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_96to8[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_96to11[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_96to16[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_96to22[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_96to24[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_96to32[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_96to44[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_96to48[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_96to88[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_96to176[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_96to192[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_176to16[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_176to22[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_176to24[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_176to32[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_176to44[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_176to48[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_176to88[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_176to96[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_176to192[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_192to16[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_192to22[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_192to24[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_192to32[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_192to44[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_192to48[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_192to88[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_192to96[TEGRA210_SFC_COEF_RAM_DEPTH] =;

static u32 coef_192to176[TEGRA210_SFC_COEF_RAM_DEPTH] =;

/*
 * Coefficient table for various sample rate conversions. The sample
 * rates available are as per tegra210_sfc_rates[].
 */
static s32 *coef_addr_table[TEGRA210_SFC_NUM_RATES][TEGRA210_SFC_NUM_RATES] =;

static int __maybe_unused tegra210_sfc_runtime_suspend(struct device *dev)
{}

static int __maybe_unused tegra210_sfc_runtime_resume(struct device *dev)
{}

static inline void tegra210_sfc_write_ram(struct regmap *regmap,
					  s32 *data)
{}

static int tegra210_sfc_write_coeff_ram(struct snd_soc_component *cmpnt)
{}

static int tegra210_sfc_set_audio_cif(struct tegra210_sfc *sfc,
				      struct snd_pcm_hw_params *params,
				      unsigned int reg)
{}

static int tegra210_sfc_soft_reset(struct tegra210_sfc *sfc)
{}

static int tegra210_sfc_rate_to_idx(struct device *dev, int rate,
				    int *rate_idx)
{}

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

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

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

static int tegra210_sfc_init(struct snd_soc_dapm_widget *w,
			     struct snd_kcontrol *kcontrol, int event)
{}

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

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

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

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

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

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

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

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

static const struct snd_soc_dai_ops tegra210_sfc_in_dai_ops =;

static const struct snd_soc_dai_ops tegra210_sfc_out_dai_ops =;

static struct snd_soc_dai_driver tegra210_sfc_dais[] =;

static const struct snd_soc_dapm_widget tegra210_sfc_widgets[] =;

#define RESAMPLE_ROUTE(sname)

static const struct snd_soc_dapm_route tegra210_sfc_routes[] =;

static const char * const tegra210_sfc_stereo_conv_text[] =;

static const char * const tegra210_sfc_mono_conv_text[] =;

static const struct soc_enum tegra210_sfc_stereo_conv_enum =;

static const struct soc_enum tegra210_sfc_mono_conv_enum =;

static const struct snd_kcontrol_new tegra210_sfc_controls[] =;

static const struct snd_soc_component_driver tegra210_sfc_cmpnt =;

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

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

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

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

static const struct regmap_config tegra210_sfc_regmap_config =;

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

static int tegra210_sfc_platform_probe(struct platform_device *pdev)
{}

static void tegra210_sfc_platform_remove(struct platform_device *pdev)
{}

static const struct dev_pm_ops tegra210_sfc_pm_ops =;

static struct platform_driver tegra210_sfc_driver =;
module_platform_driver()

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