linux/sound/soc/codecs/rt9120.c

// SPDX-License-Identifier: GPL-2.0

#include <linux/bits.h>
#include <linux/bitfield.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/tlv.h>

#define RT9120_REG_DEVID
#define RT9120_REG_I2SFMT
#define RT9120_REG_I2SWL
#define RT9120_REG_SDIOSEL
#define RT9120_REG_SYSCTL
#define RT9120_REG_SPKGAIN
#define RT9120_REG_VOLRAMP
#define RT9120_REG_ERRRPT
#define RT9120_REG_MSVOL
#define RT9120_REG_SWRESET
#define RT9120_REG_INTERCFG
#define RT9120_REG_INTERNAL0
#define RT9120_REG_INTERNAL1
#define RT9120_REG_UVPOPT
#define RT9120_REG_DIGCFG

#define RT9120_VID_MASK
#define RT9120_SWRST_MASK
#define RT9120_MUTE_MASK
#define RT9120_I2SFMT_MASK
#define RT9120_I2SFMT_SHIFT
#define RT9120_CFG_FMT_I2S
#define RT9120_CFG_FMT_LEFTJ
#define RT9120_CFG_FMT_RIGHTJ
#define RT9120_CFG_FMT_DSPA
#define RT9120_CFG_FMT_DSPB
#define RT9120_AUDBIT_MASK
#define RT9120_CFG_AUDBIT_16
#define RT9120_CFG_AUDBIT_20
#define RT9120_CFG_AUDBIT_24
#define RT9120_AUDWL_MASK
#define RT9120_CFG_WORDLEN_16
#define RT9120_CFG_WORDLEN_24
#define RT9120_CFG_WORDLEN_32
#define RT9120_DVDD_UVSEL_MASK
#define RT9120_AUTOSYNC_MASK

#define RT9120_VENDOR_ID
#define RT9120S_VENDOR_ID
#define RT9120_RESET_WAITMS
#define RT9120_CHIPON_WAITMS
#define RT9120_AMPON_WAITMS
#define RT9120_AMPOFF_WAITMS
#define RT9120_LVAPP_THRESUV

/* 8000 to 192000 supported , only 176400 not support */
#define RT9120_RATES_MASK
#define RT9120_FMTS_MASK

enum {};

struct rt9120_data {};

/* 11bit [min,max,step] = [-103.9375dB, 24dB, 0.0625dB] */
static const DECLARE_TLV_DB_SCALE(digital_tlv, -1039375, 625, 1);

/* {6, 8, 10, 12, 13, 14, 15, 16}dB */
static const DECLARE_TLV_DB_RANGE(classd_tlv,
	0, 3, TLV_DB_SCALE_ITEM(600, 200, 0),
	4, 7, TLV_DB_SCALE_ITEM(1300, 100, 0)
);

static const char * const sdo_select_text[] =;

static const struct soc_enum sdo_select_enum =;

static const struct snd_kcontrol_new rt9120_snd_controls[] =;

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

static const struct snd_soc_dapm_widget rt9120_dapm_widgets[] =;

static const struct snd_soc_dapm_route rt9120_dapm_routes[] =;

static int rt9120_codec_probe(struct snd_soc_component *comp)
{}

static int rt9120_codec_suspend(struct snd_soc_component *comp)
{}

static int rt9120_codec_resume(struct snd_soc_component *comp)
{}

static const struct snd_soc_component_driver rt9120_component_driver =;

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

static int rt9120_hw_params(struct snd_pcm_substream *substream,
			    struct snd_pcm_hw_params *param,
			    struct snd_soc_dai *dai)
{}

static const struct snd_soc_dai_ops rt9120_dai_ops =;

static struct snd_soc_dai_driver rt9120_dai =;

static const struct regmap_range rt9120_rd_yes_ranges[] =;

static const struct regmap_access_table rt9120_rd_table =;

static const struct regmap_range rt9120_wr_yes_ranges[] =;

static const struct regmap_access_table rt9120_wr_table =;

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

static int rt9120_get_reg_size(unsigned int reg)
{}

static int rt9120_reg_read(void *context, unsigned int reg, unsigned int *val)
{}

static int rt9120_reg_write(void *context, unsigned int reg, unsigned int val)
{}

static const struct reg_default rt9120_reg_defaults[] =;

static const struct regmap_config rt9120_regmap_config =;

static int rt9120_check_vendor_info(struct rt9120_data *data)
{}

static int rt9120_do_register_reset(struct rt9120_data *data)
{}

static int rt9120_probe(struct i2c_client *i2c)
{}

static void rt9120_remove(struct i2c_client *i2c)
{}

static int __maybe_unused rt9120_runtime_suspend(struct device *dev)
{}

static int __maybe_unused rt9120_runtime_resume(struct device *dev)
{}

static const struct dev_pm_ops rt9120_pm_ops =;

static const struct of_device_id __maybe_unused rt9120_device_table[] =;
MODULE_DEVICE_TABLE(of, rt9120_device_table);

static struct i2c_driver rt9120_driver =;
module_i2c_driver();

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