linux/sound/soc/mediatek/mt8186/mt8186-mt6366.c

// SPDX-License-Identifier: GPL-2.0
//
// mt8186-mt6366.c
//	--  MT8186-MT6366 ALSA SoC machine driver
//
// Copyright (c) 2022 MediaTek Inc.
// Author: Jiaxin Yu <[email protected]>
//
// Copyright (c) 2024 Collabora Ltd.
//                    AngeloGioacchino Del Regno <[email protected]>
//

#include <linux/gpio/consumer.h>
#include <linux/input.h>
#include <linux/module.h>
#include <linux/of.h>
#include <sound/jack.h>
#include <sound/pcm_params.h>
#include <sound/rt5682.h>
#include <sound/soc.h>

#include "../../codecs/da7219.h"
#include "../../codecs/mt6358.h"
#include "../../codecs/rt5682.h"
#include "../common/mtk-afe-platform-driver.h"
#include "../common/mtk-dsp-sof-common.h"
#include "../common/mtk-soc-card.h"
#include "../common/mtk-soundcard-driver.h"
#include "mt8186-afe-common.h"
#include "mt8186-afe-clk.h"
#include "mt8186-afe-gpio.h"
#include "mt8186-mt6366-common.h"

#define RT1019_CODEC_DAI
#define RT1019_DEV0_NAME

#define RT5682S_CODEC_DAI
#define RT5682S_DEV0_NAME

#define DA7219_CODEC_DAI
#define DA7219_DEV_NAME

#define SOF_DMA_DL1
#define SOF_DMA_DL2
#define SOF_DMA_UL1
#define SOF_DMA_UL2

#define DA7219_CODEC_PRESENT

struct mt8186_mt6366_rt1019_rt5682s_priv {};

enum mt8186_jacks {};

/* Headset jack detection DAPM pins */
static struct snd_soc_jack_pin mt8186_jack_pins[] =;

static struct snd_soc_codec_conf mt8186_mt6366_rt1019_rt5682s_codec_conf[] =;

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

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

static const char * const dmic_mux_text[] =;

static SOC_ENUM_SINGLE_DECL(mt8186_dmic_enum,
			    SND_SOC_NOPM, 0, dmic_mux_text);

static const struct snd_kcontrol_new mt8186_dmic_mux_control =;

static const struct snd_soc_dapm_widget dmic_widgets[] =;

static const struct snd_soc_dapm_route dmic_map[] =;

static int primary_codec_init(struct snd_soc_pcm_runtime *rtd)
{}

static int mt8186_headset_codec_init(struct snd_soc_pcm_runtime *rtd)
{}

static int mt8186_da7219_i2s_hw_params(struct snd_pcm_substream *substream,
				       struct snd_pcm_hw_params *params)
{}

static int mt8186_da7219_i2s_hw_free(struct snd_pcm_substream *substream)
{}

static const struct snd_soc_ops mt8186_da7219_i2s_ops =;

static int mt8186_rt5682s_i2s_hw_params(struct snd_pcm_substream *substream,
					struct snd_pcm_hw_params *params)
{}

static const struct snd_soc_ops mt8186_rt5682s_i2s_ops =;

static int mt8186_mt6366_rt1019_rt5682s_hdmi_init(struct snd_soc_pcm_runtime *rtd)
{}

static int mt8186_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
				  struct snd_pcm_hw_params *params,
				  snd_pcm_format_t fmt)
{}

static int mt8186_i2s_hw_params_24le_fixup(struct snd_soc_pcm_runtime *rtd,
					   struct snd_pcm_hw_params *params)
{}

static int mt8186_i2s_hw_params_32le_fixup(struct snd_soc_pcm_runtime *rtd,
					   struct snd_pcm_hw_params *params)
{}

/* fixup the BE DAI link to match any values from topology */
static int mt8186_sof_dai_link_fixup(struct snd_soc_pcm_runtime *rtd,
				     struct snd_pcm_hw_params *params)
{}

/* FE */
SND_SOC_DAILINK_DEFS();

SND_SOC_DAILINK_DEFS();

SND_SOC_DAILINK_DEFS();

SND_SOC_DAILINK_DEFS();

SND_SOC_DAILINK_DEFS();

SND_SOC_DAILINK_DEFS();

SND_SOC_DAILINK_DEFS();

SND_SOC_DAILINK_DEFS();

SND_SOC_DAILINK_DEFS();

SND_SOC_DAILINK_DEFS();

SND_SOC_DAILINK_DEFS();

SND_SOC_DAILINK_DEFS();

SND_SOC_DAILINK_DEFS();

SND_SOC_DAILINK_DEFS();

SND_SOC_DAILINK_DEFS();

SND_SOC_DAILINK_DEFS();

/* hostless */
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();

/* BE */
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();

/* hostless */
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();
SND_SOC_DAILINK_DEFS();

SND_SOC_DAILINK_DEFS();

SND_SOC_DAILINK_DEFS();

SND_SOC_DAILINK_DEFS();

static const struct sof_conn_stream g_sof_conn_streams[] =;

static struct snd_soc_dai_link mt8186_mt6366_rt1019_rt5682s_dai_links[] =;

static const struct snd_soc_dapm_widget
mt8186_mt6366_da7219_max98357_widgets[] =;

static const struct snd_soc_dapm_widget
mt8186_mt6366_rt1019_rt5682s_widgets[] =;

static const struct snd_soc_dapm_route
mt8186_mt6366_rt1019_rt5682s_routes[] =;

static const struct snd_soc_dapm_route mt8186_mt6366_rt5650_routes[] =;

static const struct snd_kcontrol_new mt8186_mt6366_da7219_max98357_controls[] =;

static const struct snd_kcontrol_new
mt8186_mt6366_rt1019_rt5682s_controls[] =;

static struct snd_soc_card mt8186_mt6366_da7219_max98357_soc_card =;

static struct snd_soc_card mt8186_mt6366_rt1019_rt5682s_soc_card =;

static struct snd_soc_card mt8186_mt6366_rt5682s_max98360_soc_card =;

static struct snd_soc_card mt8186_mt6366_rt5650_soc_card =;

static int mt8186_mt6366_legacy_probe(struct mtk_soc_card_data *soc_card_data)
{}

static int mt8186_mt6366_soc_card_probe(struct mtk_soc_card_data *soc_card_data, bool legacy)
{}

static const unsigned int mt8186_pcm_playback_channels[] =;
static const unsigned int mt8186_pcm_capture_channels[] =;
static const unsigned int mt8186_pcm_rates[] =;

static const struct snd_pcm_hw_constraint_list mt8186_rate_constraint =;

static const struct mtk_pcm_constraints_data mt8186_pcm_constraints[MTK_CONSTRAINT_CAPTURE + 1] =;

static const struct mtk_sof_priv mt8186_sof_priv =;

static const struct mtk_soundcard_pdata mt8186_mt6366_da7219_max98357_pdata =;

static const struct mtk_soundcard_pdata mt8186_mt6366_rt1019_rt5682s_pdata =;

static const struct mtk_soundcard_pdata mt8186_mt6366_rt5682s_max98360_pdata =;

static const struct mtk_soundcard_pdata mt8186_mt6366_rt5650_pdata =;

#if IS_ENABLED(CONFIG_OF)
static const struct of_device_id mt8186_mt6366_dt_match[] =;
MODULE_DEVICE_TABLE(of, mt8186_mt6366_dt_match);
#endif

static struct platform_driver mt8186_mt6366_driver =;

module_platform_driver();

/* Module information */
MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();
MODULE_ALIAS();