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

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Intel Broxton-P I2S Machine Driver
 *
 * Copyright (C) 2016, Intel Corporation
 *
 * Modified from:
 *   Intel Skylake I2S Machine driver
 */

#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/hdac_hdmi.h"
#include "../../codecs/da7219.h"
#include "../common/soc-intel-quirks.h"
#include "hda_dsp_common.h"

#define BXT_DIALOG_CODEC_DAI
#define BXT_MAXIM_CODEC_DAI
#define DUAL_CHANNEL
#define QUAD_CHANNEL

static struct snd_soc_jack broxton_headset;
static struct snd_soc_jack broxton_hdmi[3];

struct bxt_hdmi_pcm {};

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

static const struct snd_soc_dapm_widget broxton_widgets[] =;

static const struct snd_soc_dapm_route audio_map[] =;

static struct snd_soc_jack_pin jack_pins[] =;

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

static int broxton_da7219_codec_init(struct snd_soc_pcm_runtime *rtd)
{}

static int broxton_hdmi_init(struct snd_soc_pcm_runtime *rtd)
{}

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

static const struct snd_pcm_hw_constraint_list constraints_channels_quad =;

static int bxt_fe_startup(struct snd_pcm_substream *substream)
{}

static const struct snd_soc_ops broxton_da7219_fe_ops =;

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

static int broxton_dmic_startup(struct snd_pcm_substream *substream)
{}

static const struct snd_soc_ops broxton_dmic_ops =;

static const 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 broxton_refcap_startup(struct snd_pcm_substream *substream)
{
	substream->runtime->hw.channels_max = 1;
	snd_pcm_hw_constraint_list(substream->runtime, 0,
				   SNDRV_PCM_HW_PARAM_CHANNELS,
				   &constraints_refcap);

	return snd_pcm_hw_constraint_list(substream->runtime, 0,
			SNDRV_PCM_HW_PARAM_RATE,
			&constraints_16000);
};

static const struct snd_soc_ops broxton_refcap_ops =;

/* broxton digital audio interface glue - connects codec <--> CPU */
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(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")));

 /* Back End DAI */
SND_SOC_DAILINK_DEF(ssp5_pin,
	DAILINK_COMP_ARRAY(COMP_CPU("SSP5 Pin")));
SND_SOC_DAILINK_DEF(ssp5_codec,
	DAILINK_COMP_ARRAY(COMP_CODEC("MX98357A:00",
				      BXT_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",
				      BXT_DIALOG_CODEC_DAI)));

SND_SOC_DAILINK_DEF(dmic_pin,
	DAILINK_COMP_ARRAY(COMP_CPU("DMIC01 Pin")));

SND_SOC_DAILINK_DEF(dmic16k_pin,
	DAILINK_COMP_ARRAY(COMP_CPU("DMIC16k 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:0e.0")));

static struct snd_soc_dai_link broxton_dais[] =;

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

/* broxton audio machine driver for SPT + da7219 */
static struct snd_soc_card broxton_audio_card =;

static int broxton_audio_probe(struct platform_device *pdev)
{}

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

static struct platform_driver broxton_audio =;
module_platform_driver()

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