linux/sound/soc/amd/acp/acp-mach-common.c

// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
//
// This file is provided under a dual BSD/GPLv2 license. When using or
// redistributing this file, you may do so under either license.
//
// Copyright(c) 2021, 2023 Advanced Micro Devices, Inc.
//
// Authors: Ajit Kumar Pandey <[email protected]>
//	    Vijendar Mukunda <[email protected]>
//

/*
 * Machine Driver Interface for ACP HW block
 */

#include <sound/core.h>
#include <sound/jack.h>
#include <sound/pcm_params.h>
#include <sound/soc-dapm.h>
#include <sound/soc.h>
#include <linux/input.h>
#include <linux/module.h>

#include "../../codecs/rt5682.h"
#include "../../codecs/rt1019.h"
#include "../../codecs/rt5682s.h"
#include "../../codecs/nau8825.h"
#include "../../codecs/nau8821.h"
#include "acp-mach.h"

#define PCO_PLAT_CLK
#define RT5682_PLL_FREQ
#define DUAL_CHANNEL
#define FOUR_CHANNEL
#define NAU8821_CODEC_DAI
#define NAU8821_BCLK
#define NAU8821_FREQ_OUT
#define MAX98388_CODEC_DAI

#define TDM_MODE_ENABLE

const struct dmi_system_id acp_quirk_table[] =;
EXPORT_SYMBOL_GPL();

static const unsigned int channels[] =;

static const unsigned int rates[] =;

static const struct snd_pcm_hw_constraint_list constraints_rates =;

static const struct snd_pcm_hw_constraint_list constraints_channels =;

static int acp_clk_enable(struct acp_card_drvdata *drvdata,
			  unsigned int srate, unsigned int bclk_ratio)
{}

/* Declare RT5682 codec components */
SND_SOC_DAILINK_DEF(rt5682,
	DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC5682:00", "rt5682-aif1")));

static struct snd_soc_jack rt5682_jack;
static struct snd_soc_jack_pin rt5682_jack_pins[] =;

static const struct snd_kcontrol_new rt5682_controls[] =;

static const struct snd_soc_dapm_widget rt5682_widgets[] =;

static const struct snd_soc_dapm_route rt5682_map[] =;

/* Define card ops for RT5682 CODEC */
static int acp_card_rt5682_init(struct snd_soc_pcm_runtime *rtd)
{}

static int acp_card_hs_startup(struct snd_pcm_substream *substream)
{}

static void acp_card_shutdown(struct snd_pcm_substream *substream)
{}

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

static const struct snd_soc_ops acp_card_rt5682_ops =;

/* Define RT5682S CODEC component*/
SND_SOC_DAILINK_DEF(rt5682s,
		    DAILINK_COMP_ARRAY(COMP_CODEC("i2c-RTL5682:00", "rt5682s-aif1")));

static struct snd_soc_jack rt5682s_jack;
static struct snd_soc_jack_pin rt5682s_jack_pins[] =;

static const struct snd_kcontrol_new rt5682s_controls[] =;

static const struct snd_soc_dapm_widget rt5682s_widgets[] =;

static const struct snd_soc_dapm_route rt5682s_map[] =;

static int acp_card_rt5682s_init(struct snd_soc_pcm_runtime *rtd)
{}

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

static const struct snd_soc_ops acp_card_rt5682s_ops =;

static const unsigned int dmic_channels[] =;

static const struct snd_pcm_hw_constraint_list dmic_constraints_channels =;

static int acp_card_dmic_startup(struct snd_pcm_substream *substream)
{}

static const struct snd_soc_ops acp_card_dmic_ops =;

/* Declare RT1019 codec components */
SND_SOC_DAILINK_DEF();

static const struct snd_kcontrol_new rt1019_controls[] =;

static const struct snd_soc_dapm_widget rt1019_widgets[] =;

static const struct snd_soc_dapm_route rt1019_map_lr[] =;

static struct snd_soc_codec_conf rt1019_conf[] =;

static int acp_card_rt1019_init(struct snd_soc_pcm_runtime *rtd)
{}

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

static int acp_card_amp_startup(struct snd_pcm_substream *substream)
{}

static const struct snd_soc_ops acp_card_rt1019_ops =;

/* Declare Maxim codec components */
SND_SOC_DAILINK_DEF(max98360a,
	DAILINK_COMP_ARRAY(COMP_CODEC("MX98360A:00", "HiFi")));

static const struct snd_kcontrol_new max98360a_controls[] =;

static const struct snd_soc_dapm_widget max98360a_widgets[] =;

static const struct snd_soc_dapm_route max98360a_map[] =;

static int acp_card_maxim_init(struct snd_soc_pcm_runtime *rtd)
{}

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

static const struct snd_soc_ops acp_card_maxim_ops =;

SND_SOC_DAILINK_DEF();

static const struct snd_kcontrol_new max98388_controls[] =;

static const struct snd_soc_dapm_widget max98388_widgets[] =;

static const struct snd_soc_dapm_route max98388_map[] =;

static struct snd_soc_codec_conf max98388_conf[] =;

static const unsigned int max98388_format[] =;

static struct snd_pcm_hw_constraint_list constraints_sample_bits_max =;

static int acp_card_max98388_startup(struct snd_pcm_substream *substream)
{}

static int acp_card_max98388_init(struct snd_soc_pcm_runtime *rtd)
{}

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

static const struct snd_soc_ops acp_max98388_ops =;

/* Declare nau8825 codec components */
SND_SOC_DAILINK_DEF(nau8825,
		    DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10508825:00", "nau8825-hifi")));

static struct snd_soc_jack nau8825_jack;
static struct snd_soc_jack_pin nau8825_jack_pins[] =;

static const struct snd_kcontrol_new nau8825_controls[] =;

static const struct snd_soc_dapm_widget nau8825_widgets[] =;

static const struct snd_soc_dapm_route nau8825_map[] =;

static int acp_card_nau8825_init(struct snd_soc_pcm_runtime *rtd)
{}

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

static int acp_nau8825_startup(struct snd_pcm_substream *substream)
{}

static const struct snd_soc_ops acp_card_nau8825_ops =;

static int platform_clock_control(struct snd_soc_dapm_widget *w,
				  struct snd_kcontrol *k, int  event)
{}

static struct snd_soc_jack nau8821_jack;
static struct snd_soc_jack_pin nau8821_jack_pins[] =;

static const struct snd_kcontrol_new nau8821_controls[] =;

static const struct snd_soc_dapm_widget nau8821_widgets[] =;

static const struct snd_soc_dapm_route nau8821_audio_route[] =;

static const unsigned int nau8821_format[] =;

static struct snd_pcm_hw_constraint_list constraints_sample_bits =;

static int acp_8821_init(struct snd_soc_pcm_runtime *rtd)
{}

static int acp_8821_startup(struct snd_pcm_substream *substream)
{}

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

static const struct snd_soc_ops acp_8821_ops =;

SND_SOC_DAILINK_DEF(nau8821,
		    DAILINK_COMP_ARRAY(COMP_CODEC("i2c-NVTN2020:00",
						  NAU8821_CODEC_DAI)));

/* Declare DMIC codec components */
SND_SOC_DAILINK_DEF(dmic_codec,
		DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", "dmic-hifi")));

/* Declare ACP CPU components */
static struct snd_soc_dai_link_component platform_component[] =;

static struct snd_soc_dai_link_component platform_rmb_component[] =;

static struct snd_soc_dai_link_component platform_acp63_component[] =;

static struct snd_soc_dai_link_component platform_acp70_component[] =;

static struct snd_soc_dai_link_component sof_component[] =;

SND_SOC_DAILINK_DEF(i2s_sp,
	DAILINK_COMP_ARRAY(COMP_CPU("acp-i2s-sp")));
SND_SOC_DAILINK_DEF(i2s_hs,
		    DAILINK_COMP_ARRAY(COMP_CPU("acp-i2s-hs")));
SND_SOC_DAILINK_DEF(sof_sp,
	DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-sp")));
SND_SOC_DAILINK_DEF(sof_sp_virtual,
	DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-sp-virtual")));
SND_SOC_DAILINK_DEF(sof_hs,
		    DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-hs")));
SND_SOC_DAILINK_DEF(sof_hs_virtual,
	DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-hs-virtual")));
SND_SOC_DAILINK_DEF(sof_bt,
		    DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-bt")));
SND_SOC_DAILINK_DEF(sof_dmic,
	DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-dmic")));
SND_SOC_DAILINK_DEF(pdm_dmic,
	DAILINK_COMP_ARRAY(COMP_CPU("acp-pdm-dmic")));

static int acp_rtk_set_bias_level(struct snd_soc_card *card,
				  struct snd_soc_dapm_context *dapm,
				  enum snd_soc_bias_level level)
{}

int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
{}
EXPORT_SYMBOL_NS_GPL();

int acp_legacy_dai_links_create(struct snd_soc_card *card)
{}
EXPORT_SYMBOL_NS_GPL();

MODULE_DESCRIPTION();
MODULE_LICENSE();