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

// SPDX-License-Identifier: GPL-2.0-only
// Copyright(c) 2017-18 Intel Corporation.

/*
 * Intel Kabylake I2S Machine Driver with MAX98357A & DA7219 Codecs
 *
 * 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 "../../codecs/da7219.h"
#include "../../codecs/hdac_hdmi.h"

#define KBL_DIALOG_CODEC_DAI
#define KBL_MAXIM_CODEC_DAI
#define MAXIM_DEV0_NAME
#define DUAL_CHANNEL
#define QUAD_CHANNEL

static struct snd_soc_card *kabylake_audio_card;
static struct snd_soc_jack skylake_hdmi[3];

struct kbl_hdmi_pcm {};

struct kbl_codec_private {};

enum {};

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

static const struct snd_kcontrol_new kabylake_controls[] =;

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 int kabylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
			struct snd_pcm_hw_params *params)
{}

static int kabylake_da7219_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 int kabylake_hdmi3_init(struct snd_soc_pcm_runtime *rtd)
{}

static int kabylake_da7219_fe_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 unsigned int channels_quad[] =;

static struct snd_pcm_hw_constraint_list constraints_channels_quad =;

static int kbl_fe_startup(struct snd_pcm_substream *substream)
{}

static const struct snd_soc_ops kabylake_da7219_fe_ops =;

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

static int kabylake_dmic_startup(struct snd_pcm_substream *substream)
{}

static const struct snd_soc_ops kabylake_dmic_ops =;

static unsigned int rates_16000[] =;

static const struct snd_pcm_hw_constraint_list constraints_16000 =;

static const unsigned int ch_mono[] =;

static const struct snd_pcm_hw_constraint_list constraints_refcap =;

static int kabylake_refcap_startup(struct snd_pcm_substream *substream)
{}

static const struct snd_soc_ops skylake_refcap_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(reference,
	DAILINK_COMP_ARRAY(COMP_CPU("Reference Pin")));

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(hdmi3,
	DAILINK_COMP_ARRAY(COMP_CPU("HDMI3 Pin")));

SND_SOC_DAILINK_DEF(ssp0_pin,
	DAILINK_COMP_ARRAY(COMP_CPU("SSP0 Pin")));
SND_SOC_DAILINK_DEF(ssp0_codec,
	DAILINK_COMP_ARRAY(COMP_CODEC(MAXIM_DEV0_NAME,
				      KBL_MAXIM_CODEC_DAI)));

SND_SOC_DAILINK_DEF(ssp1_pin,
	DAILINK_COMP_ARRAY(COMP_CPU("SSP1 Pin")));
SND_SOC_DAILINK_DEF(ssp1_codec,
	DAILINK_COMP_ARRAY(COMP_CODEC("i2c-DLGS7219:00",
				      KBL_DIALOG_CODEC_DAI)));

SND_SOC_DAILINK_DEF(dmic_pin,
	DAILINK_COMP_ARRAY(COMP_CPU("DMIC01 Pin")));
SND_SOC_DAILINK_DEF(dmic_codec,
	DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", "dmic-hifi")));

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(idisp3_pin,
	DAILINK_COMP_ARRAY(COMP_CPU("iDisp3 Pin")));
SND_SOC_DAILINK_DEF(idisp3_codec,
	DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi3")));

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[] =;

#define NAME_SIZE
static int kabylake_card_late_probe(struct snd_soc_card *card)
{}

/* kabylake audio machine driver for SPT + DA7219 */
static struct snd_soc_card kabylake_audio_card_da7219_m98357a =;

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();