linux/sound/soc/amd/acp-da7219-max98357a.c

// SPDX-License-Identifier: MIT
//
// Machine driver for AMD ACP Audio engine using DA7219, RT5682 & MAX98357 codec
//
//Copyright 2017-2021 Advanced Micro Devices, Inc.

#include <sound/core.h>
#include <sound/soc.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc-dapm.h>
#include <sound/jack.h>
#include <linux/clk.h>
#include <linux/gpio.h>
#include <linux/module.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/driver.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/acpi.h>

#include "acp.h"
#include "../codecs/da7219.h"
#include "../codecs/rt5682.h"

#define CZ_PLAT_CLK
#define DUAL_CHANNEL
#define RT5682_PLL_FREQ

static struct snd_soc_jack cz_jack;
static struct snd_soc_jack_pin cz_jack_pins[] =;

static struct clk *da7219_dai_wclk;
static struct clk *da7219_dai_bclk;
static struct clk *rt5682_dai_wclk;
static struct clk *rt5682_dai_bclk;

void *acp_soc_is_rltk_max(struct device *dev);

static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
{}

static int da7219_clk_enable(struct snd_pcm_substream *substream)
{}

static void da7219_clk_disable(void)
{}

static int cz_rt5682_init(struct snd_soc_pcm_runtime *rtd)
{}

static int rt5682_clk_enable(struct snd_pcm_substream *substream)
{}

static void rt5682_clk_disable(void)
{}

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 cz_da7219_play_startup(struct snd_pcm_substream *substream)
{}

static int cz_da7219_cap_startup(struct snd_pcm_substream *substream)
{}

static int cz_max_startup(struct snd_pcm_substream *substream)
{}

static int cz_dmic0_startup(struct snd_pcm_substream *substream)
{}

static int cz_dmic1_startup(struct snd_pcm_substream *substream)
{}

static void cz_da7219_shutdown(struct snd_pcm_substream *substream)
{}

static int cz_rt5682_play_startup(struct snd_pcm_substream *substream)
{}

static int cz_rt5682_cap_startup(struct snd_pcm_substream *substream)
{}

static int cz_rt5682_max_startup(struct snd_pcm_substream *substream)
{}

static int cz_rt5682_dmic0_startup(struct snd_pcm_substream *substream)
{}

static int cz_rt5682_dmic1_startup(struct snd_pcm_substream *substream)
{}

static void cz_rt5682_shutdown(struct snd_pcm_substream *substream)
{}

static const struct snd_soc_ops cz_da7219_play_ops =;

static const struct snd_soc_ops cz_da7219_cap_ops =;

static const struct snd_soc_ops cz_max_play_ops =;

static const struct snd_soc_ops cz_dmic0_cap_ops =;

static const struct snd_soc_ops cz_dmic1_cap_ops =;

static const struct snd_soc_ops cz_rt5682_play_ops =;

static const struct snd_soc_ops cz_rt5682_cap_ops =;

static const struct snd_soc_ops cz_rt5682_max_play_ops =;

static const struct snd_soc_ops cz_rt5682_dmic0_cap_ops =;

static const struct snd_soc_ops cz_rt5682_dmic1_cap_ops =;

SND_SOC_DAILINK_DEF(designware1,
	DAILINK_COMP_ARRAY(COMP_CPU("designware-i2s.1.auto")));
SND_SOC_DAILINK_DEF(designware2,
	DAILINK_COMP_ARRAY(COMP_CPU("designware-i2s.2.auto")));
SND_SOC_DAILINK_DEF(designware3,
	DAILINK_COMP_ARRAY(COMP_CPU("designware-i2s.3.auto")));

SND_SOC_DAILINK_DEF(dlgs,
	DAILINK_COMP_ARRAY(COMP_CODEC("i2c-DLGS7219:00", "da7219-hifi")));
SND_SOC_DAILINK_DEF(rt5682,
	DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC5682:00", "rt5682-aif1")));
SND_SOC_DAILINK_DEF(mx,
	DAILINK_COMP_ARRAY(COMP_CODEC("MX98357A:00", "HiFi")));
SND_SOC_DAILINK_DEF(adau,
	DAILINK_COMP_ARRAY(COMP_CODEC("ADAU7002:00", "adau7002-hifi")));

SND_SOC_DAILINK_DEF(platform,
	DAILINK_COMP_ARRAY(COMP_PLATFORM("acp_audio_dma.0.auto")));

static struct snd_soc_dai_link cz_dai_7219_98357[] =;

static struct snd_soc_dai_link cz_dai_5682_98357[] =;

static const struct snd_soc_dapm_widget cz_widgets[] =;

static const struct snd_soc_dapm_route cz_audio_route[] =;

static const struct snd_soc_dapm_route cz_rt5682_audio_route[] =;

static const struct snd_kcontrol_new cz_mc_controls[] =;

static struct snd_soc_card cz_card =;

static struct snd_soc_card cz_rt5682_card =;

void *acp_soc_is_rltk_max(struct device *dev)
{}

static struct regulator_consumer_supply acp_da7219_supplies[] =;

static struct regulator_init_data acp_da7219_data =;

static struct regulator_config acp_da7219_cfg =;

static const struct regulator_ops acp_da7219_ops =;

static const struct regulator_desc acp_da7219_desc =;

static int cz_probe(struct platform_device *pdev)
{}

#ifdef CONFIG_ACPI
static const struct acpi_device_id cz_audio_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, cz_audio_acpi_match);
#endif

static struct platform_driver cz_pcm_driver =;

module_platform_driver();

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