linux/sound/soc/mediatek/mt8186/mt8186-dai-tdm.c

// SPDX-License-Identifier: GPL-2.0
//
// MediaTek ALSA SoC Audio DAI TDM Control
//
// Copyright (c) 2022 MediaTek Inc.
// Author: Jiaxin Yu <[email protected]>

#include <linux/regmap.h>
#include <sound/pcm_params.h>

#include "mt8186-afe-clk.h"
#include "mt8186-afe-common.h"
#include "mt8186-afe-gpio.h"
#include "mt8186-interconnection.h"

#define TDM_HD_EN_W_NAME
#define TDM_MCLK_EN_W_NAME
#define MTK_AFE_TDM_KCONTROL_NAME

struct mtk_afe_tdm_priv {};

enum {};

enum {};

enum {};

enum {};

static unsigned int get_tdm_lrck_width(snd_pcm_format_t format,
				       unsigned int mode)
{}

static unsigned int get_tdm_ch_fixup(unsigned int channels)
{}

static unsigned int get_tdm_ch_per_sdata(unsigned int mode,
					 unsigned int channels)
{}

enum {};

static int get_tdm_id_by_name(const char *name)
{}

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

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

/* dai component */
/* tdm virtual mux to output widget */
static const char * const tdm_mux_map[] =;

static int tdm_mux_map_value[] =;

static SOC_VALUE_ENUM_SINGLE_AUTODISABLE_DECL(tdm_mux_map_enum,
					      SND_SOC_NOPM,
					      0,
					      1,
					      tdm_mux_map,
					      tdm_mux_map_value);

static const struct snd_kcontrol_new tdm_in_mux_control =;

static const struct snd_soc_dapm_widget mtk_dai_tdm_widgets[] =;

static int mtk_afe_tdm_mclk_connect(struct snd_soc_dapm_widget *source,
				    struct snd_soc_dapm_widget *sink)
{}

static int mtk_afe_tdm_mclk_apll_connect(struct snd_soc_dapm_widget *source,
					 struct snd_soc_dapm_widget *sink)
{}

static int mtk_afe_tdm_hd_connect(struct snd_soc_dapm_widget *source,
				  struct snd_soc_dapm_widget *sink)
{}

static int mtk_afe_tdm_apll_connect(struct snd_soc_dapm_widget *source,
				    struct snd_soc_dapm_widget *sink)
{}

/* low jitter control */
static const char * const mt8186_tdm_hd_str[] =;

static const struct soc_enum mt8186_tdm_enum[] =;

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

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

static const struct snd_kcontrol_new mtk_dai_tdm_controls[] =;

static const struct snd_soc_dapm_route mtk_dai_tdm_routes[] =;

/* dai ops */
static int mtk_dai_tdm_cal_mclk(struct mtk_base_afe *afe,
				struct mtk_afe_tdm_priv *tdm_priv,
				int freq)
{}

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

static int mtk_dai_tdm_set_sysclk(struct snd_soc_dai *dai,
				  int clk_id, unsigned int freq, int dir)
{}

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

static int mtk_dai_tdm_set_tdm_slot(struct snd_soc_dai *dai,
				    unsigned int tx_mask,
				    unsigned int rx_mask,
				    int slots,
				    int slot_width)
{}

static const struct snd_soc_dai_ops mtk_dai_tdm_ops =;

/* dai driver */
#define MTK_TDM_RATES

#define MTK_TDM_FORMATS

static struct snd_soc_dai_driver mtk_dai_tdm_driver[] =;

static struct mtk_afe_tdm_priv *init_tdm_priv_data(struct mtk_base_afe *afe)
{}

int mt8186_dai_tdm_register(struct mtk_base_afe *afe)
{}