linux/sound/soc/codecs/wm8737.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * wm8737.c  --  WM8737 ALSA SoC Audio driver
 *
 * Copyright 2010 Wolfson Microelectronics plc
 *
 * Author: Mark Brown <[email protected]>
 */

#include <linux/mod_devicetable.h>
#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/regulator/consumer.h>
#include <linux/spi/spi.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 "wm8737.h"

#define WM8737_NUM_SUPPLIES
static const char *wm8737_supply_names[WM8737_NUM_SUPPLIES] =;

/* codec private data */
struct wm8737_priv {};

static const struct reg_default wm8737_reg_defaults[] =;

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

static int wm8737_reset(struct snd_soc_component *component)
{}

static const DECLARE_TLV_DB_RANGE(micboost_tlv,
	0, 0, TLV_DB_SCALE_ITEM(1300, 0, 0),
	1, 1, TLV_DB_SCALE_ITEM(1800, 0, 0),
	2, 2, TLV_DB_SCALE_ITEM(2800, 0, 0),
	3, 3, TLV_DB_SCALE_ITEM(3300, 0, 0)
);
static const DECLARE_TLV_DB_SCALE(pga_tlv, -9750, 50, 1);
static const DECLARE_TLV_DB_SCALE(adc_tlv, -600, 600, 0);
static const DECLARE_TLV_DB_SCALE(ng_tlv, -7800, 600, 0);
static const DECLARE_TLV_DB_SCALE(alc_max_tlv, -1200, 600, 0);
static const DECLARE_TLV_DB_SCALE(alc_target_tlv, -1800, 100, 0);

static const char *micbias_enum_text[] =;

static SOC_ENUM_SINGLE_DECL(micbias_enum,
			    WM8737_MIC_PREAMP_CONTROL, 0, micbias_enum_text);

static const char *low_cutoff_text[] =;

static SOC_ENUM_SINGLE_DECL(low_3d,
			    WM8737_3D_ENHANCE, 6, low_cutoff_text);

static const char *high_cutoff_text[] =;

static SOC_ENUM_SINGLE_DECL(high_3d,
			    WM8737_3D_ENHANCE, 5, high_cutoff_text);

static const char *alc_fn_text[] =;

static SOC_ENUM_SINGLE_DECL(alc_fn,
			    WM8737_ALC1, 7, alc_fn_text);

static const char *alc_hold_text[] =;

static SOC_ENUM_SINGLE_DECL(alc_hold,
			    WM8737_ALC2, 0, alc_hold_text);

static const char *alc_atk_text[] =;

static SOC_ENUM_SINGLE_DECL(alc_atk,
			    WM8737_ALC3, 0, alc_atk_text);

static const char *alc_dcy_text[] =;

static SOC_ENUM_SINGLE_DECL(alc_dcy,
			    WM8737_ALC3, 4, alc_dcy_text);

static const struct snd_kcontrol_new wm8737_snd_controls[] =;

static const char *linsel_text[] =;

static SOC_ENUM_SINGLE_DECL(linsel_enum,
			    WM8737_AUDIO_PATH_L, 7, linsel_text);

static const struct snd_kcontrol_new linsel_mux =;


static const char *rinsel_text[] =;

static SOC_ENUM_SINGLE_DECL(rinsel_enum,
			    WM8737_AUDIO_PATH_R, 7, rinsel_text);

static const struct snd_kcontrol_new rinsel_mux =;

static const char *bypass_text[] =;

static SOC_ENUM_SINGLE_DECL(lbypass_enum,
			    WM8737_MIC_PREAMP_CONTROL, 2, bypass_text);

static const struct snd_kcontrol_new lbypass_mux =;


static SOC_ENUM_SINGLE_DECL(rbypass_enum,
			    WM8737_MIC_PREAMP_CONTROL, 3, bypass_text);

static const struct snd_kcontrol_new rbypass_mux =;

static const struct snd_soc_dapm_widget wm8737_dapm_widgets[] =;

static const struct snd_soc_dapm_route intercon[] =;

/* codec mclk clock divider coefficients */
static const struct {} coeff_div[] =;

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

static int wm8737_set_dai_sysclk(struct snd_soc_dai *codec_dai,
				 int clk_id, unsigned int freq, int dir)
{}


static int wm8737_set_dai_fmt(struct snd_soc_dai *codec_dai,
		unsigned int fmt)
{}

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

#define WM8737_RATES

#define WM8737_FORMATS

static const struct snd_soc_dai_ops wm8737_dai_ops =;

static struct snd_soc_dai_driver wm8737_dai =;

static int wm8737_probe(struct snd_soc_component *component)
{}

static const struct snd_soc_component_driver soc_component_dev_wm8737 =;

static const struct of_device_id wm8737_of_match[] =;

MODULE_DEVICE_TABLE(of, wm8737_of_match);

static const struct regmap_config wm8737_regmap =;

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

static const struct i2c_device_id wm8737_i2c_id[] =;
MODULE_DEVICE_TABLE(i2c, wm8737_i2c_id);

static struct i2c_driver wm8737_i2c_driver =;
#endif

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

static struct spi_driver wm8737_spi_driver =;
#endif /* CONFIG_SPI_MASTER */

static int __init wm8737_modinit(void)
{}
module_init();

static void __exit wm8737_exit(void)
{}
module_exit(wm8737_exit);

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