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

// SPDX-License-Identifier: GPL-2.0-only
// Copyright(c) 2018-19 Canonical Corporation.

/*
 * Intel Kabylake I2S Machine Driver with RT5660 Codec
 *
 * Modified from:
 *   Intel Kabylake I2S Machine driver supporting MAXIM98357a and
 *   DA7219 codecs
 * Also referred to:
 *   Intel Broadwell I2S Machine driver supporting RT5677 codec
 */

#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/gpio/consumer.h>
#include <linux/acpi.h>
#include <sound/core.h>
#include <sound/jack.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>

#include "../../codecs/hdac_hdmi.h"
#include "../../codecs/rt5660.h"

#define KBL_RT5660_CODEC_DAI
#define DUAL_CHANNEL

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

struct kbl_hdmi_pcm {};

struct kbl_codec_private {};

enum {};

#define GPIO_LINEOUT_MUTE_INDEX
#define GPIO_LINEOUT_DET_INDEX
#define GPIO_LINEIN_DET_INDEX

static const struct acpi_gpio_params lineout_mute_gpio =;
static const struct acpi_gpio_params lineout_det_gpio =;
static const struct acpi_gpio_params mic_det_gpio =;


static const struct acpi_gpio_mapping acpi_rt5660_gpios[] =;

static struct snd_soc_jack_pin lineout_jack_pin =;

static struct snd_soc_jack_pin mic_jack_pin =;

static struct snd_soc_jack_gpio lineout_jack_gpio =;

static struct snd_soc_jack_gpio mic_jack_gpio =;

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

static const struct snd_kcontrol_new kabylake_rt5660_controls[] =;

static const struct snd_soc_dapm_widget kabylake_rt5660_widgets[] =;

static const struct snd_soc_dapm_route kabylake_rt5660_map[] =;

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

static int kabylake_rt5660_codec_init(struct snd_soc_pcm_runtime *rtd)
{}

static void kabylake_rt5660_codec_exit(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_rt5660_hw_params(struct snd_pcm_substream *substream,
	struct snd_pcm_hw_params *params)
{}

static const struct snd_soc_ops kabylake_rt5660_ops =;

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_rt5660_fe_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(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("i2c-10EC3277:00", KBL_RT5660_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(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 rt5660 codec <--> CPU */
static struct snd_soc_dai_link kabylake_rt5660_dais[] =;


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

/* kabylake audio machine driver for rt5660 */
static struct snd_soc_card kabylake_audio_card_rt5660 =;

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