linux/sound/soc/codecs/rt5616.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * rt5616.c  --  RT5616 ALSA SoC audio codec driver
 *
 * Copyright 2015 Realtek Semiconductor Corp.
 * Author: Bard Liao <[email protected]>
 */

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/i2c.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.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 "rl6231.h"
#include "rt5616.h"

#define RT5616_PR_RANGE_BASE
#define RT5616_PR_SPACING

#define RT5616_PR_BASE

static const struct regmap_range_cfg rt5616_ranges[] =;

static const struct reg_sequence init_list[] =;

#define RT5616_INIT_REG_LEN

static const struct reg_default rt5616_reg[] =;

struct rt5616_priv {};

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

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

static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -4650, 150, 0);
static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -65625, 375, 0);
static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0);
static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0);
static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0);

/* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */
static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(bst_tlv,
	0, 0, TLV_DB_SCALE_ITEM(0, 0, 0),
	1, 1, TLV_DB_SCALE_ITEM(2000, 0, 0),
	2, 2, TLV_DB_SCALE_ITEM(2400, 0, 0),
	3, 5, TLV_DB_SCALE_ITEM(3000, 500, 0),
	6, 6, TLV_DB_SCALE_ITEM(4400, 0, 0),
	7, 7, TLV_DB_SCALE_ITEM(5000, 0, 0),
	8, 8, TLV_DB_SCALE_ITEM(5200, 0, 0),
);

static const struct snd_kcontrol_new rt5616_snd_controls[] =;

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

/* Digital Mixer */
static const struct snd_kcontrol_new rt5616_sto1_adc_l_mix[] =;

static const struct snd_kcontrol_new rt5616_sto1_adc_r_mix[] =;

static const struct snd_kcontrol_new rt5616_dac_l_mix[] =;

static const struct snd_kcontrol_new rt5616_dac_r_mix[] =;

static const struct snd_kcontrol_new rt5616_sto_dac_l_mix[] =;

static const struct snd_kcontrol_new rt5616_sto_dac_r_mix[] =;

/* Analog Input Mixer */
static const struct snd_kcontrol_new rt5616_rec_l_mix[] =;

static const struct snd_kcontrol_new rt5616_rec_r_mix[] =;

/* Analog Output Mixer */

static const struct snd_kcontrol_new rt5616_out_l_mix[] =;

static const struct snd_kcontrol_new rt5616_out_r_mix[] =;

static const struct snd_kcontrol_new rt5616_hpo_mix[] =;

static const struct snd_kcontrol_new rt5616_lout_mix[] =;

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

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

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

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

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

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

static const struct snd_soc_dapm_widget rt5616_dapm_widgets[] =;

static const struct snd_soc_dapm_route rt5616_dapm_routes[] =;

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

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

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

static int rt5616_set_dai_pll(struct snd_soc_dai *dai, int pll_id, int source,
			      unsigned int freq_in, unsigned int freq_out)
{}

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

static int rt5616_probe(struct snd_soc_component *component)
{}

#ifdef CONFIG_PM
static int rt5616_suspend(struct snd_soc_component *component)
{}

static int rt5616_resume(struct snd_soc_component *component)
{}
#else
#define rt5616_suspend
#define rt5616_resume
#endif

#define RT5616_STEREO_RATES
#define RT5616_FORMATS

static const struct snd_soc_dai_ops rt5616_aif_dai_ops =;

static struct snd_soc_dai_driver rt5616_dai[] =;

static const struct snd_soc_component_driver soc_component_dev_rt5616 =;

static const struct regmap_config rt5616_regmap =;

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

#if defined(CONFIG_OF)
static const struct of_device_id rt5616_of_match[] =;
MODULE_DEVICE_TABLE(of, rt5616_of_match);
#endif

static int rt5616_i2c_probe(struct i2c_client *i2c)
{}

static void rt5616_i2c_remove(struct i2c_client *i2c)
{}

static void rt5616_i2c_shutdown(struct i2c_client *client)
{}

static struct i2c_driver rt5616_i2c_driver =;
module_i2c_driver();

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