linux/sound/soc/codecs/cs4234.c

// SPDX-License-Identifier: GPL-2.0-only
// cs4234.c -- ALSA SoC CS4234 driver
//
// Copyright (C) 2020 Cirrus Logic, Inc. and
//                    Cirrus Logic International Semiconductor Ltd.
//

#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/jiffies.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <sound/soc.h>
#include <sound/tlv.h>
#include <linux/workqueue.h>

#include "cs4234.h"

struct cs4234 {};

/* -89.92dB to +6.02dB with step of 0.38dB */
static const DECLARE_TLV_DB_SCALE(dac_tlv, -8992, 38, 0);

static const char * const cs4234_dac14_delay_text[] =;
static SOC_ENUM_SINGLE_DECL(cs4234_dac14_group_delay, CS4234_TPS_CTRL,
			    CS4234_GRP_DELAY_SHIFT, cs4234_dac14_delay_text);

static const char * const cs4234_noise_gate_text[] =;
static SOC_ENUM_SINGLE_DECL(cs4234_ll_noise_gate, CS4234_LOW_LAT_CTRL1,
			    CS4234_LL_NG_SHIFT, cs4234_noise_gate_text);
static SOC_ENUM_SINGLE_DECL(cs4234_dac14_noise_gate, CS4234_DAC_CTRL1,
			    CS4234_DAC14_NG_SHIFT, cs4234_noise_gate_text);
static SOC_ENUM_SINGLE_DECL(cs4234_dac5_noise_gate, CS4234_DAC_CTRL2,
			    CS4234_DAC5_NG_SHIFT, cs4234_noise_gate_text);

static const char * const cs4234_dac5_config_fltr_sel_text[] =;
static SOC_ENUM_SINGLE_DECL(cs4234_dac5_config_fltr_sel, CS4234_DAC_CTRL1,
			    CS4234_DAC5_CFG_FLTR_SHIFT,
			    cs4234_dac5_config_fltr_sel_text);

static const char * const cs4234_mute_delay_text[] =;
static SOC_ENUM_SINGLE_DECL(cs4234_mute_delay, CS4234_VOLUME_MODE,
			    CS4234_MUTE_DELAY_SHIFT, cs4234_mute_delay_text);

static const char * const cs4234_minmax_delay_text[] =;
static SOC_ENUM_SINGLE_DECL(cs4234_min_delay, CS4234_VOLUME_MODE,
			    CS4234_MIN_DELAY_SHIFT, cs4234_minmax_delay_text);
static SOC_ENUM_SINGLE_DECL(cs4234_max_delay, CS4234_VOLUME_MODE,
			    CS4234_MAX_DELAY_SHIFT, cs4234_minmax_delay_text);

static int cs4234_dac14_grp_delay_put(struct snd_kcontrol *kctrl,
				      struct snd_ctl_elem_value *uctrl)
{}

static void cs4234_vq_ramp_done(struct work_struct *work)
{}

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

static const struct snd_soc_dapm_widget cs4234_dapm_widgets[] =;

static const struct snd_soc_dapm_route cs4234_dapm_routes[] =;

static const struct snd_kcontrol_new cs4234_snd_controls[] =;

static int cs4234_dai_set_fmt(struct snd_soc_dai *codec_dai, unsigned int format)
{}

static int cs4234_dai_hw_params(struct snd_pcm_substream *sub,
				struct snd_pcm_hw_params *params,
				struct snd_soc_dai *dai)
{}

/* Scale MCLK rate by 64 to avoid overflow in the ratnum calculation */
#define CS4234_MCLK_SCALE

static const struct snd_ratnum cs4234_dividers[] =;

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

static int cs4234_dai_startup(struct snd_pcm_substream *sub, struct snd_soc_dai *dai)
{}

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

static const struct snd_soc_dai_ops cs4234_dai_ops =;

static struct snd_soc_dai_driver cs4234_dai[] =;

static const struct reg_default cs4234_default_reg[] =;

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

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

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

static const struct snd_soc_component_driver soc_component_cs4234 =;

static const struct regmap_config cs4234_regmap =;

static const char * const cs4234_core_supplies[] =;

static void cs4234_shutdown(struct cs4234 *cs4234)
{}

static int cs4234_powerup(struct cs4234 *cs4234)
{}

static int cs4234_i2c_probe(struct i2c_client *i2c_client)
{}

static void cs4234_i2c_remove(struct i2c_client *i2c_client)
{}

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

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

static const struct dev_pm_ops cs4234_pm =;

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

static struct i2c_driver cs4234_i2c_driver =;
module_i2c_driver();

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