linux/sound/soc/codecs/pcm512x.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Driver for the PCM512x CODECs
 *
 * Author:	Mark Brown <[email protected]>
 *		Copyright 2014 Linaro Ltd
 */


#include <linux/init.h>
#include <linux/module.h>
#include <linux/clk.h>
#include <linux/kernel.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/gcd.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/pcm_params.h>
#include <sound/tlv.h>

#include "pcm512x.h"

#define PCM512x_NUM_SUPPLIES
static const char * const pcm512x_supply_names[PCM512x_NUM_SUPPLIES] =;

struct pcm512x_priv {};

/*
 * We can't use the same notifier block for more than one supply and
 * there's no way I can see to get from a callback to the caller
 * except container_of().
 */
#define PCM512x_REGULATOR_EVENT(n)

PCM512x_REGULATOR_EVENT()
PCM512x_REGULATOR_EVENT()
PCM512x_REGULATOR_EVENT()

static const struct reg_default pcm512x_reg_defaults[] =;

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

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

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

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

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

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

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

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

static const DECLARE_TLV_DB_SCALE(digital_tlv, -10350, 50, 1);
static const DECLARE_TLV_DB_SCALE(analog_tlv, -600, 600, 0);
static const DECLARE_TLV_DB_SCALE(boost_tlv, 0, 80, 0);

static const char * const pcm512x_dsp_program_texts[] =;

static const unsigned int pcm512x_dsp_program_values[] =;

static SOC_VALUE_ENUM_SINGLE_DECL(pcm512x_dsp_program,
				  PCM512x_DSP_PROGRAM, 0, 0x1f,
				  pcm512x_dsp_program_texts,
				  pcm512x_dsp_program_values);

static const char * const pcm512x_clk_missing_text[] =;

static const struct soc_enum pcm512x_clk_missing =;

static const char * const pcm512x_autom_text[] =;

static const struct soc_enum pcm512x_autom_l =;

static const struct soc_enum pcm512x_autom_r =;

static const char * const pcm512x_ramp_rate_text[] =;

static const struct soc_enum pcm512x_vndf =;

static const struct soc_enum pcm512x_vnuf =;

static const struct soc_enum pcm512x_vedf =;

static const char * const pcm512x_ramp_step_text[] =;

static const struct soc_enum pcm512x_vnds =;

static const struct soc_enum pcm512x_vnus =;

static const struct soc_enum pcm512x_veds =;

static int pcm512x_update_mute(struct pcm512x_priv *pcm512x)
{}

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

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

static const struct snd_kcontrol_new pcm512x_controls[] =;

static const struct snd_soc_dapm_widget pcm512x_dapm_widgets[] =;

static const struct snd_soc_dapm_route pcm512x_dapm_routes[] =;

static unsigned long pcm512x_pll_max(struct pcm512x_priv *pcm512x)
{}

static unsigned long pcm512x_dsp_max(struct pcm512x_priv *pcm512x)
{}

static unsigned long pcm512x_dac_max(struct pcm512x_priv *pcm512x,
				     unsigned long rate)
{}

static unsigned long pcm512x_sck_max(struct pcm512x_priv *pcm512x)
{}

static unsigned long pcm512x_ncp_target(struct pcm512x_priv *pcm512x,
					unsigned long dac_rate)
{}

static const u32 pcm512x_dai_rates[] =;

static const struct snd_pcm_hw_constraint_list constraints_slave =;

static int pcm512x_hw_rule_rate(struct snd_pcm_hw_params *params,
				struct snd_pcm_hw_rule *rule)
{}

static int pcm512x_dai_startup_master(struct snd_pcm_substream *substream,
				      struct snd_soc_dai *dai)
{}

static int pcm512x_dai_startup_slave(struct snd_pcm_substream *substream,
				     struct snd_soc_dai *dai)
{}

static int pcm512x_dai_startup(struct snd_pcm_substream *substream,
			       struct snd_soc_dai *dai)
{}

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

static unsigned long pcm512x_find_sck(struct snd_soc_dai *dai,
				      unsigned long bclk_rate)
{}

/* pll_rate = pllin_rate * R * J.D / P
 * 1 <= R <= 16
 * 1 <= J <= 63
 * 0 <= D <= 9999
 * 1 <= P <= 15
 * 64 MHz <= pll_rate <= 100 MHz
 * if D == 0
 *     1 MHz <= pllin_rate / P <= 20 MHz
 * else if D > 0
 *     6.667 MHz <= pllin_rate / P <= 20 MHz
 *     4 <= J <= 11
 *     R = 1
 */
static int pcm512x_find_pll_coeff(struct snd_soc_dai *dai,
				  unsigned long pllin_rate,
				  unsigned long pll_rate)
{}

static unsigned long pcm512x_pllin_dac_rate(struct snd_soc_dai *dai,
					    unsigned long osr_rate,
					    unsigned long pllin_rate)
{}

static int pcm512x_set_dividers(struct snd_soc_dai *dai,
				struct snd_pcm_hw_params *params)
{}

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

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

static int pcm512x_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio)
{}

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

static const struct snd_soc_dai_ops pcm512x_dai_ops =;

static struct snd_soc_dai_driver pcm512x_dai =;

static const struct snd_soc_component_driver pcm512x_component_driver =;

static const struct regmap_range_cfg pcm512x_range =;

const struct regmap_config pcm512x_regmap =;
EXPORT_SYMBOL_GPL();

int pcm512x_probe(struct device *dev, struct regmap *regmap)
{}
EXPORT_SYMBOL_GPL();

void pcm512x_remove(struct device *dev)
{}
EXPORT_SYMBOL_GPL();

#ifdef CONFIG_PM
static int pcm512x_suspend(struct device *dev)
{}

static int pcm512x_resume(struct device *dev)
{}
#endif

const struct dev_pm_ops pcm512x_pm_ops =;
EXPORT_SYMBOL_GPL();

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