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

// SPDX-License-Identifier: GPL-2.0-only
/*
 *  bytcr_rt5651.c - ASoc Machine driver for Intel Byt CR platform
 *  (derived from bytcr_rt5640.c)
 *
 *  Copyright (C) 2015 Intel Corp
 *  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

#include <linux/init.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/acpi.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/dmi.h>
#include <linux/input.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/machine.h>
#include <linux/slab.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/rt5651.h"
#include "../atom/sst-atom-controls.h"
#include "../common/soc-intel-quirks.h"

enum {};

enum {};

enum {};

enum {};

#define BYT_RT5651_MAP(quirk)
#define BYT_RT5651_JDSRC(quirk)
#define BYT_RT5651_OVCD_TH(quirk)
#define BYT_RT5651_OVCD_SF(quirk)
#define BYT_RT5651_DMIC_EN
#define BYT_RT5651_MCLK_EN
#define BYT_RT5651_MCLK_25MHZ
#define BYT_RT5651_SSP2_AIF2
#define BYT_RT5651_SSP0_AIF1
#define BYT_RT5651_SSP0_AIF2
#define BYT_RT5651_HP_LR_SWAPPED
#define BYT_RT5651_MONO_SPEAKER
#define BYT_RT5651_JD_NOT_INV

#define BYT_RT5651_DEFAULT_QUIRKS

/* jack-detect-source + inv + dmic-en + ovcd-th + -sf + terminating entry */
#define MAX_NO_PROPS

struct byt_rt5651_private {};

static const struct acpi_gpio_mapping *byt_rt5651_gpios;

/* Default: jack-detect on JD1_1, internal mic on in2, headsetmic on in3 */
static unsigned long byt_rt5651_quirk =;

static int quirk_override =;
module_param_named(quirk, quirk_override, int, 0444);
MODULE_PARM_DESC();

static void log_quirks(struct device *dev)
{}

#define BYT_CODEC_DAI1
#define BYT_CODEC_DAI2

static int byt_rt5651_prepare_and_enable_pll1(struct snd_soc_dai *codec_dai,
					      int rate, int bclk_ratio)
{}

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

static int rt5651_ext_amp_power_event(struct snd_soc_dapm_widget *w,
	struct snd_kcontrol *kcontrol, int event)
{}

static const struct snd_soc_dapm_widget byt_rt5651_widgets[] =;

static const struct snd_soc_dapm_route byt_rt5651_audio_map[] =;

static const struct snd_soc_dapm_route byt_rt5651_intmic_dmic_map[] =;

static const struct snd_soc_dapm_route byt_rt5651_intmic_in1_map[] =;

static const struct snd_soc_dapm_route byt_rt5651_intmic_in2_map[] =;

static const struct snd_soc_dapm_route byt_rt5651_intmic_in1_in2_map[] =;

static const struct snd_soc_dapm_route byt_rt5651_ssp0_aif1_map[] =;

static const struct snd_soc_dapm_route byt_rt5651_ssp0_aif2_map[] =;

static const struct snd_soc_dapm_route byt_rt5651_ssp2_aif1_map[] =;

static const struct snd_soc_dapm_route byt_rt5651_ssp2_aif2_map[] =;

static const struct snd_kcontrol_new byt_rt5651_controls[] =;

static struct snd_soc_jack_pin bytcr_jack_pins[] =;

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

static const struct acpi_gpio_params pov_p1006w_hp_detect =;
static const struct acpi_gpio_params pov_p1006w_ext_amp_en =;

static const struct acpi_gpio_mapping byt_rt5651_pov_p1006w_gpios[] =;

static int byt_rt5651_pov_p1006w_quirk_cb(const struct dmi_system_id *id)
{}

static int byt_rt5651_quirk_cb(const struct dmi_system_id *id)
{}

static const struct dmi_system_id byt_rt5651_quirk_table[] =;

/*
 * Note this MUST be called before snd_soc_register_card(), so that the props
 * are in place before the codec component driver's probe function parses them.
 */
static int byt_rt5651_add_codec_device_props(struct device *i2c_dev,
					     struct byt_rt5651_private *priv)
{}

static int byt_rt5651_init(struct snd_soc_pcm_runtime *runtime)
{}

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

static const unsigned int rates_48000[] =;

static const struct snd_pcm_hw_constraint_list constraints_48000 =;

static int byt_rt5651_aif1_startup(struct snd_pcm_substream *substream)
{}

static const struct snd_soc_ops byt_rt5651_aif1_ops =;

static const struct snd_soc_ops byt_rt5651_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-10EC5651:00", "rt5651-aif1")));

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

static struct snd_soc_dai_link byt_rt5651_dais[] =;

/* SoC card */
static char byt_rt5651_codec_name[SND_ACPI_I2C_ID_LEN];
#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES)
static char byt_rt5651_long_name[50]; /* = "bytcr-rt5651-*-spk-*-mic[-swapped-hp]" */
#endif
static char byt_rt5651_components[50]; /* = "cfg-spk:* cfg-mic:*" */

static int byt_rt5651_suspend(struct snd_soc_card *card)
{}

static int byt_rt5651_resume(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

static struct snd_soc_card byt_rt5651_card =;

static const struct acpi_gpio_params ext_amp_enable_gpios =;

static const struct acpi_gpio_mapping cht_rt5651_gpios[] =;

struct acpi_chan_package {};

static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
{}

static void snd_byt_rt5651_mc_remove(struct platform_device *pdev)
{}

static struct platform_driver snd_byt_rt5651_mc_driver =;

module_platform_driver();

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