#include <linux/bitops.h>
#include <linux/regmap.h>
#include <sound/pcm_params.h>
#include "mt8365-afe-clk.h"
#include "mt8365-afe-common.h"
#define IIR_RATIOVER …
#define IIR_INV_COEF …
#define IIR_NO_NEED …
struct mtk_afe_i2s_priv { … };
enum { … };
static const struct mtk_afe_i2s_priv mt8365_i2s_priv[DAI_I2S_NUM] = …;
static const u32 *get_iir_coef(unsigned int input_fs,
unsigned int output_fs, unsigned int *count)
{ … }
static int mt8365_dai_set_config(struct mtk_base_afe *afe,
struct mtk_afe_i2s_priv *i2s_data,
bool is_input, unsigned int rate,
int bit_width)
{ … }
int mt8365_afe_set_i2s_out(struct mtk_base_afe *afe,
unsigned int rate, int bit_width)
{ … }
static int mt8365_afe_set_2nd_i2s_asrc(struct mtk_base_afe *afe,
unsigned int rate_in,
unsigned int rate_out,
unsigned int width,
unsigned int mono,
int o16bit, int tracking)
{ … }
static int mt8365_afe_set_2nd_i2s_asrc_enable(struct mtk_base_afe *afe,
bool enable)
{ … }
void mt8365_afe_set_i2s_out_enable(struct mtk_base_afe *afe, bool enable)
{ … }
static void mt8365_dai_set_enable(struct mtk_base_afe *afe,
struct mtk_afe_i2s_priv *i2s_data,
bool is_input, bool enable)
{ … }
static int mt8365_dai_i2s_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static void mt8365_dai_i2s_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int mt8365_dai_i2s_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int mt8365_afe_2nd_i2s_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int mt8365_afe_2nd_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{ … }
static const struct snd_soc_dai_ops mt8365_afe_i2s_ops = …;
static const struct snd_soc_dai_ops mt8365_afe_2nd_i2s_ops = …;
static struct snd_soc_dai_driver mtk_dai_i2s_driver[] = …;
static const char * const fmi2sin_text[] = …;
static SOC_ENUM_SINGLE_VIRT_DECL(fmi2sin_enum, fmi2sin_text);
static const struct snd_kcontrol_new fmi2sin_mux = …;
static const struct snd_kcontrol_new i2s_o03_o04_enable_ctl = …;
static const struct snd_soc_dapm_widget mtk_dai_i2s_widgets[] = …;
static const struct snd_soc_dapm_route mtk_dai_i2s_routes[] = …;
static int mt8365_dai_i2s_set_priv(struct mtk_base_afe *afe)
{ … }
int mt8365_dai_i2s_register(struct mtk_base_afe *afe)
{ … }