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

// SPDX-License-Identifier: GPL-2.0-only
/*
 *  cht_bsw_rt5672.c - ASoc Machine driver for Intel Cherryview-based platforms
 *                     Cherrytrail and Braswell, with RT5672 codec.
 *
 *  Copyright (C) 2014 Intel Corp
 *  Author: Subhransu S. Prusty <[email protected]>
 *          Mengdong Lin <[email protected]>
 */

#include <linux/gpio/consumer.h>
#include <linux/input.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/clk.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/jack.h>
#include <sound/soc-acpi.h>
#include "../../codecs/rt5670.h"
#include "../atom/sst-atom-controls.h"
#include "../common/soc-intel-quirks.h"


/* The platform clock #3 outputs 19.2Mhz clock to codec as I2S MCLK */
#define CHT_PLAT_CLK_3_HZ
#define CHT_CODEC_DAI

struct cht_mc_private {};

/* Headset jack detection DAPM pins */
static struct snd_soc_jack_pin cht_bsw_headset_pins[] =;

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

static const struct snd_soc_dapm_widget cht_dapm_widgets[] =;

static const struct snd_soc_dapm_route cht_audio_map[] =;

static const struct snd_soc_dapm_route cht_audio_ssp0_map[] =;

static const struct snd_soc_dapm_route cht_audio_ssp2_map[] =;

static const struct snd_kcontrol_new cht_mc_controls[] =;

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

static const struct acpi_gpio_params headset_gpios =;

static const struct acpi_gpio_mapping cht_rt5672_gpios[] =;

static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
{}

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

static int cht_aif1_startup(struct snd_pcm_substream *substream)
{}

static const struct snd_soc_ops cht_aif1_ops =;

static const struct snd_soc_ops cht_be_ssp2_ops =;

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

SND_SOC_DAILINK_DEF(media,
	DAILINK_COMP_ARRAY(COMP_CPU("media-cpu-dai")));

SND_SOC_DAILINK_DEF(deepbuffer,
	DAILINK_COMP_ARRAY(COMP_CPU("deepbuffer-cpu-dai")));

SND_SOC_DAILINK_DEF(ssp2_port,
	DAILINK_COMP_ARRAY(COMP_CPU("ssp2-port")));
SND_SOC_DAILINK_DEF(ssp2_codec,
	DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC5670:00",
				      "rt5670-aif1")));

SND_SOC_DAILINK_DEF(platform,
	DAILINK_COMP_ARRAY(COMP_PLATFORM("sst-mfld-platform")));

static struct snd_soc_dai_link cht_dailink[] =;

static int cht_suspend_pre(struct snd_soc_card *card)
{}

static int cht_resume_post(struct snd_soc_card *card)
{}

/* use space before codec name to simplify card ID, and simplify driver name */
#define SOF_CARD_NAME
#define SOF_DRIVER_NAME

#define CARD_NAME
#define DRIVER_NAME

/* SoC card */
static struct snd_soc_card snd_soc_card_cht =;

#define RT5672_I2C_DEFAULT

static int snd_cht_mc_probe(struct platform_device *pdev)
{}

static struct platform_driver snd_cht_mc_driver =;

module_platform_driver();

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