linux/sound/soc/codecs/wm8995.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * wm8995.c  --  WM8995 ALSA SoC Audio driver
 *
 * Copyright 2010 Wolfson Microelectronics plc
 *
 * Author: Dimitris Papastamos <[email protected]>
 *
 * Based on wm8994.c and wm_hubs.c by Mark Brown
 */

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/i2c.h>
#include <linux/regmap.h>
#include <linux/spi/spi.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/initval.h>
#include <sound/tlv.h>

#include "wm8995.h"

#define WM8995_NUM_SUPPLIES
static const char *wm8995_supply_names[WM8995_NUM_SUPPLIES] =;

static const struct reg_default wm8995_reg_defaults[] =;

struct fll_config {};

struct wm8995_priv {};

/*
 * We can't use the same notifier block for more than one supply and
 * there's no way I can see to get from a callback to the caller
 * except container_of().
 */
#define WM8995_REGULATOR_EVENT(n)

WM8995_REGULATOR_EVENT()
WM8995_REGULATOR_EVENT()
WM8995_REGULATOR_EVENT()
WM8995_REGULATOR_EVENT()
WM8995_REGULATOR_EVENT()
WM8995_REGULATOR_EVENT()
WM8995_REGULATOR_EVENT()
WM8995_REGULATOR_EVENT()

static const DECLARE_TLV_DB_SCALE(digital_tlv, -7200, 75, 1);
static const DECLARE_TLV_DB_SCALE(in1lr_pga_tlv, -1650, 150, 0);
static const DECLARE_TLV_DB_SCALE(in1l_boost_tlv, 0, 600, 0);
static const DECLARE_TLV_DB_SCALE(sidetone_tlv, -3600, 150, 0);

static const char *in1l_text[] =;

static SOC_ENUM_SINGLE_DECL(in1l_enum, WM8995_LEFT_LINE_INPUT_CONTROL,
			    2, in1l_text);

static const char *in1r_text[] =;

static SOC_ENUM_SINGLE_DECL(in1r_enum, WM8995_LEFT_LINE_INPUT_CONTROL,
			    0, in1r_text);

static const char *dmic_src_text[] =;

static SOC_ENUM_SINGLE_DECL(dmic_src1_enum, WM8995_POWER_MANAGEMENT_5,
			    8, dmic_src_text);
static SOC_ENUM_SINGLE_DECL(dmic_src2_enum, WM8995_POWER_MANAGEMENT_5,
			    6, dmic_src_text);

static const struct snd_kcontrol_new wm8995_snd_controls[] =;

static void wm8995_update_class_w(struct snd_soc_component *component)
{}

static int check_clk_sys(struct snd_soc_dapm_widget *source,
			 struct snd_soc_dapm_widget *sink)
{}

static int wm8995_put_class_w(struct snd_kcontrol *kcontrol,
			      struct snd_ctl_elem_value *ucontrol)
{}

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

static void dc_servo_cmd(struct snd_soc_component *component,
			 unsigned int reg, unsigned int val, unsigned int mask)
{}

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

static int configure_aif_clock(struct snd_soc_component *component, int aif)
{}

static int configure_clock(struct snd_soc_component *component)
{}

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

static const char *sidetone_text[] =;

static SOC_ENUM_SINGLE_DECL(sidetone1_enum, WM8995_SIDETONE, 0, sidetone_text);

static const struct snd_kcontrol_new sidetone1_mux =;

static SOC_ENUM_SINGLE_DECL(sidetone2_enum, WM8995_SIDETONE, 1, sidetone_text);

static const struct snd_kcontrol_new sidetone2_mux =;

static const struct snd_kcontrol_new aif1adc1l_mix[] =;

static const struct snd_kcontrol_new aif1adc1r_mix[] =;

static const struct snd_kcontrol_new aif1adc2l_mix[] =;

static const struct snd_kcontrol_new aif1adc2r_mix[] =;

static const struct snd_kcontrol_new dac1l_mix[] =;

static const struct snd_kcontrol_new dac1r_mix[] =;

static const struct snd_kcontrol_new aif2dac2l_mix[] =;

static const struct snd_kcontrol_new aif2dac2r_mix[] =;

static const struct snd_kcontrol_new in1l_pga =;

static const struct snd_kcontrol_new in1r_pga =;

static const char *adc_mux_text[] =;

static SOC_ENUM_SINGLE_VIRT_DECL(adc_enum, adc_mux_text);

static const struct snd_kcontrol_new adcl_mux =;

static const struct snd_kcontrol_new adcr_mux =;

static const char *spk_src_text[] =;

static SOC_ENUM_SINGLE_DECL(spk1l_src_enum, WM8995_LEFT_PDM_SPEAKER_1,
			    0, spk_src_text);
static SOC_ENUM_SINGLE_DECL(spk1r_src_enum, WM8995_RIGHT_PDM_SPEAKER_1,
			    0, spk_src_text);
static SOC_ENUM_SINGLE_DECL(spk2l_src_enum, WM8995_LEFT_PDM_SPEAKER_2,
			    0, spk_src_text);
static SOC_ENUM_SINGLE_DECL(spk2r_src_enum, WM8995_RIGHT_PDM_SPEAKER_2,
			    0, spk_src_text);

static const struct snd_kcontrol_new spk1l_mux =;
static const struct snd_kcontrol_new spk1r_mux =;
static const struct snd_kcontrol_new spk2l_mux =;
static const struct snd_kcontrol_new spk2r_mux =;

static const struct snd_soc_dapm_widget wm8995_dapm_widgets[] =;

static const struct snd_soc_dapm_route wm8995_intercon[] =;

static bool wm8995_readable(struct device *dev, unsigned int reg)
{}

static bool wm8995_volatile(struct device *dev, unsigned int reg)
{}

static int wm8995_aif_mute(struct snd_soc_dai *dai, int mute, int direction)
{}

static int wm8995_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{}

static const int srs[] =;

static const int fs_ratios[] =;

static const int bclk_divs[] =;

static int wm8995_hw_params(struct snd_pcm_substream *substream,
			    struct snd_pcm_hw_params *params,
			    struct snd_soc_dai *dai)
{}

static int wm8995_set_tristate(struct snd_soc_dai *codec_dai, int tristate)
{}

/* The size in bits of the FLL divide multiplied by 10
 * to allow rounding later */
#define FIXED_FLL_SIZE

struct fll_div {};

static int wm8995_get_fll_config(struct fll_div *fll,
				 int freq_in, int freq_out)
{}

static int wm8995_set_fll(struct snd_soc_dai *dai, int id,
			  int src, unsigned int freq_in,
			  unsigned int freq_out)
{}

static int wm8995_set_dai_sysclk(struct snd_soc_dai *dai,
				 int clk_id, unsigned int freq, int dir)
{}

static int wm8995_set_bias_level(struct snd_soc_component *component,
				 enum snd_soc_bias_level level)
{}

static int wm8995_probe(struct snd_soc_component *component)
{}

#define WM8995_FORMATS

static const struct snd_soc_dai_ops wm8995_aif1_dai_ops =;

static const struct snd_soc_dai_ops wm8995_aif2_dai_ops =;

static const struct snd_soc_dai_ops wm8995_aif3_dai_ops =;

static struct snd_soc_dai_driver wm8995_dai[] =;

static const struct snd_soc_component_driver soc_component_dev_wm8995 =;

static const struct regmap_config wm8995_regmap =;

#if defined(CONFIG_SPI_MASTER)
static int wm8995_spi_probe(struct spi_device *spi)
{}

static struct spi_driver wm8995_spi_driver =;
#endif

#if IS_ENABLED(CONFIG_I2C)
static int wm8995_i2c_probe(struct i2c_client *i2c)
{}

static const struct i2c_device_id wm8995_i2c_id[] =;

MODULE_DEVICE_TABLE(i2c, wm8995_i2c_id);

static struct i2c_driver wm8995_i2c_driver =;
#endif

static int __init wm8995_modinit(void)
{}

module_init();

static void __exit wm8995_exit(void)
{}

module_exit(wm8995_exit);

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