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

// SPDX-License-Identifier: GPL-2.0-only
/*
 *  bytcr_wm5102.c - ASoc Machine driver for Intel Baytrail platforms with a
 *                   Wolfson Microelectronics WM5102 codec
 *
 *  Copyright (C) 2020 Hans de Goede <[email protected]>
 *  Loosely based on bytcr_rt5640.c which is:
 *  Copyright (C) 2014-2020 Intel Corp
 *  Author: Subhransu S. Prusty <[email protected]>
 */

#include <linux/acpi.h>
#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/platform_data/x86/soc.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/spi/spi.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/wm5102.h"
#include "../atom/sst-atom-controls.h"

#define WM5102_MAX_SYSCLK_4K
#define WM5102_MAX_SYSCLK_11025

struct byt_wm5102_private {};

#define BYT_WM5102_IN_MAP
#define BYT_WM5102_OUT_MAP
#define BYT_WM5102_SSP2
#define BYT_WM5102_MCLK_19_2MHZ

enum {};

/* Note these values are pre-shifted for easy use of setting quirks */
enum {};

static unsigned long quirk;

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

static void log_quirks(struct device *dev)
{}

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

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

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

static const struct snd_soc_dapm_widget byt_wm5102_widgets[] =;

static const struct snd_soc_dapm_route byt_wm5102_audio_map[] =;

static const struct snd_soc_dapm_route bytcr_wm5102_ssp0_map[] =;

static const struct snd_soc_dapm_route bytcr_wm5102_ssp2_map[] =;

static const struct snd_soc_dapm_route byt_wm5102_spk_spk_map[] =;

static const struct snd_soc_dapm_route byt_wm5102_spk_hpout2_map[] =;

static const struct snd_soc_dapm_route byt_wm5102_intmic_in3l_hsmic_in1l_map[] =;

static const struct snd_soc_dapm_route byt_wm5102_intmic_in1l_hsmic_in2l_map[] =;

static const struct snd_kcontrol_new byt_wm5102_controls[] =;

static struct snd_soc_jack_pin byt_wm5102_pins[] =;

static int byt_wm5102_init(struct snd_soc_pcm_runtime *runtime)
{}

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

static int byt_wm5102_aif1_startup(struct snd_pcm_substream *substream)
{}

static const struct snd_soc_ops byt_wm5102_aif1_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(ssp0_port,
	DAILINK_COMP_ARRAY(COMP_CPU("ssp0-port")));

SND_SOC_DAILINK_DEF(ssp0_codec,
	DAILINK_COMP_ARRAY(COMP_CODEC(
	/*
	 * Note there is no need to overwrite the codec-name as is done in
	 * other bytcr machine drivers, because the codec is a MFD child-dev.
	 */
	"wm5102-codec",
	"wm5102-aif1")));

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

static struct snd_soc_dai_link byt_wm5102_dais[] =;

/* 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 byt_wm5102_card =;

static char byt_wm5102_components[64]; /* = "cfg-spk:* cfg-int-mic:* cfg-hs-mic:* ..." */

static int snd_byt_wm5102_mc_probe(struct platform_device *pdev)
{}

static void snd_byt_wm5102_mc_remove(struct platform_device *pdev)
{}

static struct platform_driver snd_byt_wm5102_mc_driver =;

module_platform_driver();

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