linux/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Intel Kabylake I2S Machine Driver with MAXIM98927
 * RT5514 and RT5663 Codecs
 *
 * Copyright (C) 2017, Intel Corporation
 *
 * Modified from:
 *   Intel Kabylake I2S Machine driver supporting MAXIM98927 and
 *   RT5663 codecs
 */

#include <linux/input.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <sound/core.h>
#include <sound/jack.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-acpi.h>
#include "../../codecs/rt5514.h"
#include "../../codecs/rt5663.h"
#include "../../codecs/hdac_hdmi.h"
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/clkdev.h>

#define KBL_REALTEK_CODEC_DAI
#define KBL_REALTEK_DMIC_CODEC_DAI
#define KBL_MAXIM_CODEC_DAI
#define MAXIM_DEV0_NAME
#define MAXIM_DEV1_NAME
#define RT5514_DEV_NAME
#define RT5663_DEV_NAME
#define RT5514_AIF1_BCLK_FREQ
#define RT5514_AIF1_SYSCLK_FREQ
#define NAME_SIZE

#define DMIC_CH(p)


static struct snd_soc_card kabylake_audio_card;
static const struct snd_pcm_hw_constraint_list *dmic_constraints;

struct kbl_hdmi_pcm {};

struct kbl_codec_private {};

enum {};

static const struct snd_kcontrol_new kabylake_controls[] =;

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

static const struct snd_soc_dapm_widget kabylake_widgets[] =;

static struct snd_soc_jack_pin jack_pins[] =;

static const struct snd_soc_dapm_route kabylake_map[] =;

static struct snd_soc_codec_conf max98927_codec_conf[] =;


static int kabylake_rt5663_fe_init(struct snd_soc_pcm_runtime *rtd)
{}

static int kabylake_rt5663_codec_init(struct snd_soc_pcm_runtime *rtd)
{}

static int kabylake_hdmi_init(struct snd_soc_pcm_runtime *rtd, int device)
{}

static int kabylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd)
{}

static int kabylake_hdmi2_init(struct snd_soc_pcm_runtime *rtd)
{}

static const unsigned int rates[] =;

static const struct snd_pcm_hw_constraint_list constraints_rates =;

static const unsigned int channels[] =;

static const struct snd_pcm_hw_constraint_list constraints_channels =;

static int kbl_fe_startup(struct snd_pcm_substream *substream)
{}

static const struct snd_soc_ops kabylake_rt5663_fe_ops =;

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

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

static const struct snd_soc_ops kabylake_rt5663_ops =;

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

static const struct snd_soc_ops kabylake_ssp0_ops =;

static const unsigned int channels_dmic[] =;

static const struct snd_pcm_hw_constraint_list constraints_dmic_channels =;

static const unsigned int dmic_2ch[] =;

static const struct snd_pcm_hw_constraint_list constraints_dmic_2ch =;

static int kabylake_dmic_startup(struct snd_pcm_substream *substream)
{}

static const struct snd_soc_ops kabylake_dmic_ops =;

SND_SOC_DAILINK_DEF(dummy,
	DAILINK_COMP_ARRAY(COMP_DUMMY()));

SND_SOC_DAILINK_DEF(system,
	DAILINK_COMP_ARRAY(COMP_CPU("System Pin")));

SND_SOC_DAILINK_DEF(system2,
	DAILINK_COMP_ARRAY(COMP_CPU("System Pin2")));

SND_SOC_DAILINK_DEF(echoref,
	DAILINK_COMP_ARRAY(COMP_CPU("Echoref Pin")));

SND_SOC_DAILINK_DEF(spi_cpu,
	DAILINK_COMP_ARRAY(COMP_CPU("spi-PRP0001:00")));
SND_SOC_DAILINK_DEF(spi_platform,
	DAILINK_COMP_ARRAY(COMP_PLATFORM("spi-PRP0001:00")));

SND_SOC_DAILINK_DEF(dmic,
	DAILINK_COMP_ARRAY(COMP_CPU("DMIC Pin")));

SND_SOC_DAILINK_DEF(hdmi1,
	DAILINK_COMP_ARRAY(COMP_CPU("HDMI1 Pin")));

SND_SOC_DAILINK_DEF(hdmi2,
	DAILINK_COMP_ARRAY(COMP_CPU("HDMI2 Pin")));

SND_SOC_DAILINK_DEF(ssp0_pin,
	DAILINK_COMP_ARRAY(COMP_CPU("SSP0 Pin")));
SND_SOC_DAILINK_DEF();

SND_SOC_DAILINK_DEF(ssp1_pin,
	DAILINK_COMP_ARRAY(COMP_CPU("SSP1 Pin")));
SND_SOC_DAILINK_DEF(ssp1_codec,
	DAILINK_COMP_ARRAY(COMP_CODEC(RT5663_DEV_NAME, KBL_REALTEK_CODEC_DAI)));

SND_SOC_DAILINK_DEF(idisp1_pin,
	DAILINK_COMP_ARRAY(COMP_CPU("iDisp1 Pin")));
SND_SOC_DAILINK_DEF(idisp1_codec,
	DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi1")));

SND_SOC_DAILINK_DEF(idisp2_pin,
	DAILINK_COMP_ARRAY(COMP_CPU("iDisp2 Pin")));
SND_SOC_DAILINK_DEF(idisp2_codec,
	DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi2")));

SND_SOC_DAILINK_DEF(platform,
	DAILINK_COMP_ARRAY(COMP_PLATFORM("0000:00:1f.3")));

/* kabylake digital audio interface glue - connects codec <--> CPU */
static struct snd_soc_dai_link kabylake_dais[] =;

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

static int kabylake_card_late_probe(struct snd_soc_card *card)
{}

/*
 * kabylake audio machine driver for  MAX98927 + RT5514 + RT5663
 */
static struct snd_soc_card kabylake_audio_card =;

static int kabylake_audio_probe(struct platform_device *pdev)
{}

static const struct platform_device_id kbl_board_ids[] =;
MODULE_DEVICE_TABLE(platform, kbl_board_ids);

static struct platform_driver kabylake_audio =;

module_platform_driver()

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