linux/sound/soc/codecs/es8326.c

// SPDX-License-Identifier: GPL-2.0-only
//
// es8326.c -- es8326 ALSA SoC audio driver
// Copyright Everest Semiconductor Co., Ltd
//
// Authors: David Yang <[email protected]>
//

#include <linux/clk.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <sound/jack.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/tlv.h>
#include "es8326.h"

struct es8326_priv {};

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

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

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

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

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

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

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

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

static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(dac_vol_tlv, -9550, 50, 0);
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(adc_vol_tlv, -9550, 50, 0);
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(adc_analog_pga_tlv, 0, 300, 0);
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(adc_pga_tlv, 0, 600, 0);
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(softramp_rate, 0, 100, 0);
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(drc_target_tlv, -3200, 200, 0);
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(drc_recovery_tlv, -125, 250, 0);

static const char *const winsize[] =;

static const char *const dacpol_txt[] =;

static const char *const hp_spkvol_switch[] =;

static const struct soc_enum dacpol =;
static const struct soc_enum alc_winsize =;
static const struct soc_enum drc_winsize =;
static const struct soc_enum hpvol_spkvol_switch =;

static const struct snd_kcontrol_new es8326_snd_controls[] =;

static const struct snd_soc_dapm_widget es8326_dapm_widgets[] =;

static const struct snd_soc_dapm_route es8326_dapm_routes[] =;

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

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

static const struct regmap_config es8326_regmap_config =;

struct _coeff_div {};

/* codec hifi mclk clock divider coefficients */
/* {ratio, LRCK, MCLK, REG04, REG05, REG06, REG07, REG08, REG09, REG10, REG11} */
static const struct _coeff_div coeff_div_v0[] =;

static const struct _coeff_div coeff_div_v3[] =;

static inline int get_coeff(int mclk, int rate, int array,
				const struct _coeff_div *coeff_div)
{}

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

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

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

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

static int es8326_set_bias_level(struct snd_soc_component *codec,
				 enum snd_soc_bias_level level)
{}

#define es8326_FORMATS

static const struct snd_soc_dai_ops es8326_ops =;

static struct snd_soc_dai_driver es8326_dai =;

static void es8326_enable_micbias(struct snd_soc_component *component)
{}

static void es8326_disable_micbias(struct snd_soc_component *component)
{}

/*
 *	For button detection, set the following in soundcard
 *	snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
 *	snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
 *	snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
 */
static void es8326_jack_button_handler(struct work_struct *work)
{}

static void es8326_jack_detect_handler(struct work_struct *work)
{}

static irqreturn_t es8326_irq(int irq, void *dev_id)
{}

static int es8326_calibrate(struct snd_soc_component *component)
{}

static void es8326_init(struct snd_soc_component *component)
{}

static int es8326_resume(struct snd_soc_component *component)
{}

static int es8326_suspend(struct snd_soc_component *component)
{}

static int es8326_probe(struct snd_soc_component *component)
{}

static void es8326_enable_jack_detect(struct snd_soc_component *component,
				struct snd_soc_jack *jack)
{}

static void es8326_disable_jack_detect(struct snd_soc_component *component)
{}

static int es8326_set_jack(struct snd_soc_component *component,
			struct snd_soc_jack *jack, void *data)
{}

static void es8326_remove(struct snd_soc_component *component)
{}

static const struct snd_soc_component_driver soc_component_dev_es8326 =;

static int es8326_i2c_probe(struct i2c_client *i2c)
{}


static void es8326_i2c_shutdown(struct i2c_client *i2c)
{}

static void es8326_i2c_remove(struct i2c_client *i2c)
{}

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

#ifdef CONFIG_OF
static const struct of_device_id es8326_of_match[] =;
MODULE_DEVICE_TABLE(of, es8326_of_match);
#endif

#ifdef CONFIG_ACPI
static const struct acpi_device_id es8326_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, es8326_acpi_match);
#endif

static struct i2c_driver es8326_i2c_driver =;
module_i2c_driver();

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