linux/sound/soc/codecs/tas2562.c

// SPDX-License-Identifier: GPL-2.0
//
// Driver for the Texas Instruments TAS2562 CODEC
// Copyright (C) 2019 Texas Instruments Inc.


#include <linux/module.h>
#include <linux/errno.h>
#include <linux/device.h>
#include <linux/i2c.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/gpio/consumer.h>
#include <linux/regulator/consumer.h>
#include <linux/delay.h>

#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/tlv.h>

#include "tas2562.h"

#define TAS2562_FORMATS

/* DVC equation involves floating point math
 * round(10^(volume in dB/20)*2^30)
 * so create a lookup table for 2dB step
 */
static const unsigned int float_vol_db_lookup[] =;

struct tas2562_data {};

enum tas256x_model {};

static int tas2562_set_samplerate(struct tas2562_data *tas2562, int samplerate)
{}

static int tas2562_set_dai_tdm_slot(struct snd_soc_dai *dai,
		unsigned int tx_mask, unsigned int rx_mask,
		int slots, int slot_width)
{}

static int tas2562_set_bitwidth(struct tas2562_data *tas2562, int bitwidth)
{}

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

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

static int tas2562_update_pwr_ctrl(struct tas2562_data *tas2562)
{}

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

static int tas2562_codec_probe(struct snd_soc_component *component)
{}

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

static int tas2562_resume(struct snd_soc_component *component)
{}
#else
#define tas2562_suspend
#define tas2562_resume
#endif

static const char * const tas2562_ASI1_src[] =;

static SOC_ENUM_SINGLE_DECL(tas2562_ASI1_src_enum, TAS2562_TDM_CFG2, 4,
			    tas2562_ASI1_src);

static const struct snd_kcontrol_new tas2562_asi1_mux =;

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

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

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

/* Digital Volume Control. From 0 dB to -110 dB in 1 dB steps */
static const DECLARE_TLV_DB_SCALE(dvc_tlv, -11000, 100, 0);

static DECLARE_TLV_DB_SCALE(tas2562_dac_tlv, 850, 50, 0);

static const struct snd_kcontrol_new isense_switch =;

static const struct snd_kcontrol_new vsense_switch =;

static const struct snd_kcontrol_new tas2562_snd_controls[] =;

static const struct snd_soc_dapm_widget tas2110_dapm_widgets[] =;

static const struct snd_soc_dapm_route tas2110_audio_map[] =;

static const struct snd_soc_component_driver soc_component_dev_tas2110 =;

static const struct snd_soc_dapm_widget tas2562_dapm_widgets[] =;

static const struct snd_soc_dapm_route tas2562_audio_map[] =;

static const struct snd_soc_component_driver soc_component_dev_tas2562 =;

static const struct snd_soc_dai_ops tas2562_speaker_dai_ops =;

static struct snd_soc_dai_driver tas2562_dai[] =;

static const struct regmap_range_cfg tas2562_ranges[] =;

static const struct reg_default tas2562_reg_defaults[] =;

static const struct regmap_config tas2562_regmap_config =;

static int tas2562_parse_dt(struct tas2562_data *tas2562)
{}

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

static int tas2562_probe(struct i2c_client *client)
{}

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

static struct i2c_driver tas2562_i2c_driver =;

module_i2c_driver();

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