linux/sound/soc/codecs/cs35l41.c

// SPDX-License-Identifier: GPL-2.0
//
// cs35l41.c -- CS35l41 ALSA SoC audio driver
//
// Copyright 2017-2021 Cirrus Logic, Inc.
//
// Author: David Rhodes <[email protected]>

#include <linux/acpi.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/pm_runtime.h>
#include <linux/property.h>
#include <sound/initval.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/tlv.h>

#include "cs35l41.h"

static const char * const cs35l41_supplies[CS35L41_NUM_SUPPLIES] =;

struct cs35l41_pll_sysclk_config {};

static const struct cs35l41_pll_sysclk_config cs35l41_pll_sysclk[] =;

struct cs35l41_fs_mon_config {};

static const struct cs35l41_fs_mon_config cs35l41_fs_mon[] =;

static int cs35l41_get_fs_mon_config_index(int freq)
{}

static const DECLARE_TLV_DB_RANGE(dig_vol_tlv,
		0, 0, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 1),
		1, 913, TLV_DB_MINMAX_ITEM(-10200, 1200));
static DECLARE_TLV_DB_SCALE(amp_gain_tlv, 50, 100, 0);

static const struct snd_kcontrol_new dre_ctrl =;

static const char * const cs35l41_pcm_sftramp_text[] =;

static SOC_ENUM_SINGLE_DECL(pcm_sft_ramp,
			    CS35L41_AMP_DIG_VOL_CTRL, 0,
			    cs35l41_pcm_sftramp_text);

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

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

static const char * const cs35l41_pcm_source_texts[] =;
static const unsigned int cs35l41_pcm_source_values[] =;
static SOC_VALUE_ENUM_SINGLE_DECL(cs35l41_pcm_source_enum,
				  CS35L41_DAC_PCM1_SRC,
				  0, CS35L41_ASP_SOURCE_MASK,
				  cs35l41_pcm_source_texts,
				  cs35l41_pcm_source_values);

static const struct snd_kcontrol_new pcm_source_mux =;

static const char * const cs35l41_tx_input_texts[] =;

static const unsigned int cs35l41_tx_input_values[] =;

static SOC_VALUE_ENUM_SINGLE_DECL(cs35l41_asptx1_enum,
				  CS35L41_ASP_TX1_SRC,
				  0, CS35L41_ASP_SOURCE_MASK,
				  cs35l41_tx_input_texts,
				  cs35l41_tx_input_values);

static const struct snd_kcontrol_new asp_tx1_mux =;

static SOC_VALUE_ENUM_SINGLE_DECL(cs35l41_asptx2_enum,
				  CS35L41_ASP_TX2_SRC,
				  0, CS35L41_ASP_SOURCE_MASK,
				  cs35l41_tx_input_texts,
				  cs35l41_tx_input_values);

static const struct snd_kcontrol_new asp_tx2_mux =;

static SOC_VALUE_ENUM_SINGLE_DECL(cs35l41_asptx3_enum,
				  CS35L41_ASP_TX3_SRC,
				  0, CS35L41_ASP_SOURCE_MASK,
				  cs35l41_tx_input_texts,
				  cs35l41_tx_input_values);

static const struct snd_kcontrol_new asp_tx3_mux =;

static SOC_VALUE_ENUM_SINGLE_DECL(cs35l41_asptx4_enum,
				  CS35L41_ASP_TX4_SRC,
				  0, CS35L41_ASP_SOURCE_MASK,
				  cs35l41_tx_input_texts,
				  cs35l41_tx_input_values);

static const struct snd_kcontrol_new asp_tx4_mux =;

static SOC_VALUE_ENUM_SINGLE_DECL(cs35l41_dsprx1_enum,
				  CS35L41_DSP1_RX1_SRC,
				  0, CS35L41_ASP_SOURCE_MASK,
				  cs35l41_tx_input_texts,
				  cs35l41_tx_input_values);

static const struct snd_kcontrol_new dsp_rx1_mux =;

static SOC_VALUE_ENUM_SINGLE_DECL(cs35l41_dsprx2_enum,
				  CS35L41_DSP1_RX2_SRC,
				  0, CS35L41_ASP_SOURCE_MASK,
				  cs35l41_tx_input_texts,
				  cs35l41_tx_input_values);

static const struct snd_kcontrol_new dsp_rx2_mux =;

static const struct snd_kcontrol_new cs35l41_aud_controls[] =;

static void cs35l41_boost_enable(struct cs35l41_private *cs35l41, unsigned int enable)
{}


static void cs35l41_error_release(struct cs35l41_private *cs35l41, unsigned int irq_err_bit,
				  unsigned int rel_err_bit)
{}

static irqreturn_t cs35l41_irq(int irq, void *data)
{}

static const struct reg_sequence cs35l41_pup_patch[] =;

static const struct reg_sequence cs35l41_pdn_patch[] =;

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

static const struct snd_soc_dapm_widget cs35l41_dapm_widgets[] =;

static const struct snd_soc_dapm_route cs35l41_audio_map[] =;

static int cs35l41_set_channel_map(struct snd_soc_dai *dai, unsigned int tx_n,
				   const unsigned int *tx_slot,
				   unsigned int rx_n, const unsigned int *rx_slot)
{}

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

struct cs35l41_global_fs_config {};

static const struct cs35l41_global_fs_config cs35l41_fs_rates[] =;

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

static int cs35l41_get_clk_config(int freq)
{}

static const unsigned int cs35l41_src_rates[] =;

static const struct snd_pcm_hw_constraint_list cs35l41_constraints =;

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

static int cs35l41_component_set_sysclk(struct snd_soc_component *component,
					int clk_id, int source,
					unsigned int freq, int dir)
{}

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

static int cs35l41_set_pdata(struct cs35l41_private *cs35l41)
{}

static const struct snd_soc_dapm_route cs35l41_ext_bst_routes[] =;

static const struct snd_soc_dapm_widget cs35l41_ext_bst_widget[] =;

static int cs35l41_component_probe(struct snd_soc_component *component)
{}

static void cs35l41_component_remove(struct snd_soc_component *component)
{}

static const struct snd_soc_dai_ops cs35l41_ops =;

static struct snd_soc_dai_driver cs35l41_dai[] =;

static const struct snd_soc_component_driver soc_component_dev_cs35l41 =;

static int cs35l41_handle_pdata(struct device *dev, struct cs35l41_hw_cfg *hw_cfg)
{}

static int cs35l41_dsp_init(struct cs35l41_private *cs35l41)
{}

static int cs35l41_acpi_get_name(struct cs35l41_private *cs35l41)
{}

int cs35l41_probe(struct cs35l41_private *cs35l41, const struct cs35l41_hw_cfg *hw_cfg)
{}
EXPORT_SYMBOL_GPL();

void cs35l41_remove(struct cs35l41_private *cs35l41)
{}
EXPORT_SYMBOL_GPL();

static int cs35l41_runtime_suspend(struct device *dev)
{}

static int cs35l41_runtime_resume(struct device *dev)
{}

static int cs35l41_sys_suspend(struct device *dev)
{}

static int cs35l41_sys_suspend_noirq(struct device *dev)
{}

static int cs35l41_sys_resume_noirq(struct device *dev)
{}

static int cs35l41_sys_resume(struct device *dev)
{}

EXPORT_GPL_DEV_PM_OPS(cs35l41_pm_ops) =;

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