linux/sound/soc/codecs/cs530x.c

// SPDX-License-Identifier: GPL-2.0
//
// CS530x CODEC driver
//
// Copyright (C) 2024 Cirrus Logic, Inc. and
//                    Cirrus Logic International Semiconductor Ltd.

#include <sound/core.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <sound/initval.h>
#include <linux/module.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <linux/pm.h>
#include <linux/property.h>
#include <linux/slab.h>
#include <sound/soc.h>
#include <sound/tlv.h>

#include "cs530x.h"

#define CS530X_MAX_ADC_CH
#define CS530X_MIN_ADC_CH

static const char *cs530x_supply_names[CS530X_NUM_SUPPLIES] =;

static const struct reg_default cs530x_reg_defaults[] =;

static bool cs530x_read_and_write_regs(unsigned int reg)
{}

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

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

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

static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -1270, 50, 0);

static const char * const cs530x_in_filter_text[] =;

static SOC_ENUM_SINGLE_DECL(cs530x_in_filter_enum, CS530X_IN_FILTER,
			    CS530X_IN_FILTER_SHIFT,
			    cs530x_in_filter_text);

static const char * const cs530x_in_4ch_sum_text[] =;

static SOC_ENUM_SINGLE_DECL(cs530x_in_sum_ch4_enum, CS530X_IN_RAMP_SUM,
			    CS530X_IN_SUM_MODE_SHIFT,
			    cs530x_in_4ch_sum_text);

static const struct snd_kcontrol_new cs530x_in_sum_4ch_controls[] =;

static const char * const cs530x_in_8ch_sum_text[] =;

static SOC_ENUM_SINGLE_DECL(cs530x_in_sum_ch8_enum, CS530X_IN_RAMP_SUM,
			    CS530X_IN_SUM_MODE_SHIFT,
			    cs530x_in_8ch_sum_text);

static const struct snd_kcontrol_new cs530x_in_sum_8ch_controls[] =;


static const char * const cs530x_vol_ramp_text[] =;

static SOC_ENUM_SINGLE_DECL(cs530x_ramp_inc_enum, CS530X_IN_RAMP_SUM,
			    CS530X_RAMP_RATE_INC_SHIFT,
			    cs530x_vol_ramp_text);

static SOC_ENUM_SINGLE_DECL(cs530x_ramp_dec_enum, CS530X_IN_RAMP_SUM,
			    CS530X_RAMP_RATE_DEC_SHIFT,
			    cs530x_vol_ramp_text);

static const struct snd_kcontrol_new cs530x_in_1_to_2_controls[] =;

static const struct snd_kcontrol_new cs530x_in_3_to_4_controls[] =;

static const struct snd_kcontrol_new cs530x_in_5_to_8_controls[] =;

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

static const struct snd_kcontrol_new adc12_ctrl =;

static const struct snd_kcontrol_new adc34_ctrl =;

static const struct snd_kcontrol_new adc56_ctrl =;

static const struct snd_kcontrol_new adc78_ctrl =;

static const struct snd_kcontrol_new in_hpf_ctrl =;

/* General DAPM widgets for all devices */
static const struct snd_soc_dapm_widget cs530x_gen_dapm_widgets[] =;

/* ADC's Channels 1 and 2 plus generic ADC DAPM events */
static const struct snd_soc_dapm_widget cs530x_adc_ch12_dapm_widgets[] =;

/* ADC's Channels 3 and 4 */
static const struct snd_soc_dapm_widget cs530x_adc_ch34_dapm_widgets[] =;

/* ADC's Channels 5 to 8 */
static const struct snd_soc_dapm_widget cs530x_adc_ch58_dapm_widgets[] =;

static const struct snd_soc_dapm_route adc_ch1_2_routes[] =;

static const struct snd_soc_dapm_route adc_ch3_4_routes[] =;

static const struct snd_soc_dapm_route adc_ch5_8_routes[] =;

static void cs530x_add_12_adc_widgets(struct snd_soc_component *component)
{}

static void cs530x_add_34_adc_widgets(struct snd_soc_component *component)
{}

static int cs530x_set_bclk(struct snd_soc_component *component, const int freq)
{}

static int cs530x_set_pll_refclk(struct snd_soc_component *component,
				  const unsigned int freq)
{}

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

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

static bool cs530x_check_mclk_freq(struct snd_soc_component *component,
				   const unsigned int freq)
{}

static int cs530x_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 cs530x_dai_ops =;

static const struct snd_soc_dai_driver cs530x_dai =;

static int cs530x_set_pll(struct snd_soc_component *component, int pll_id,
			   int source, unsigned int freq_in,
			   unsigned int freq_out)
{}

static int cs530x_component_probe(struct snd_soc_component *component)
{}

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

static const struct snd_soc_component_driver soc_component_dev_cs530x =;

const struct regmap_config cs530x_regmap =;
EXPORT_SYMBOL_NS_GPL();

static int cs530x_check_device_id(struct cs530x_priv *cs530x)
{}

static int cs530x_parse_device_properties(struct cs530x_priv *cs530x)
{}

int cs530x_probe(struct cs530x_priv *cs530x)
{}
EXPORT_SYMBOL_NS_GPL();

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