linux/sound/soc/codecs/rt715-sdca.c

// SPDX-License-Identifier: GPL-2.0-only
//
// rt715-sdca.c -- rt715 ALSA SoC audio driver
//
// Copyright(c) 2020 Realtek Semiconductor Corp.
//
//
//

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/pm_runtime.h>
#include <linux/pm.h>
#include <linux/soundwire/sdw.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/sdw.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include <linux/soundwire/sdw_registers.h>

#include "rt715-sdca.h"

static int rt715_sdca_index_write(struct rt715_sdca_priv *rt715,
		unsigned int nid, unsigned int reg, unsigned int value)
{}

static int rt715_sdca_index_read(struct rt715_sdca_priv *rt715,
		unsigned int nid, unsigned int reg, unsigned int *value)
{}

static int rt715_sdca_index_update_bits(struct rt715_sdca_priv *rt715,
	unsigned int nid, unsigned int reg, unsigned int mask, unsigned int val)
{}

static inline unsigned int rt715_sdca_vol_gain(unsigned int u_ctrl_val,
		unsigned int vol_max, unsigned int vol_gain_sft)
{}

static inline unsigned int rt715_sdca_boost_gain(unsigned int u_ctrl_val,
		unsigned int b_max, unsigned int b_gain_sft)
{}

static inline unsigned int rt715_sdca_get_gain(unsigned int reg_val,
		unsigned int gain_sft)
{}

/* SDCA Volume/Boost control */
static int rt715_sdca_set_amp_gain_put(struct snd_kcontrol *kcontrol,
		struct snd_ctl_elem_value *ucontrol)
{}

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

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

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

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

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

static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -1725, 75, 0);
static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, 0, 1000, 0);

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

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

static int rt715_sdca_fu_info(struct snd_kcontrol *kcontrol,
	struct snd_ctl_elem_info *uinfo)
{}

#define RT715_SDCA_PR_VALUE(xreg_base, xcount, xmax, xshift, xinvert)

#define RT715_SDCA_FU_CTRL(xname, reg_base, xshift, xmax, xinvert, xcount)

#define SOC_DOUBLE_R_EXT(xname, reg_left, reg_right, xshift, xmax, xinvert,\
	 xhandler_get, xhandler_put)

#define RT715_SDCA_EXT_TLV(xname, reg_base, xhandler_get,\
	 xhandler_put, tlv_array, xcount, xmax)

#define RT715_SDCA_BOOST_EXT_TLV(xname, reg_base, xhandler_get,\
	 xhandler_put, tlv_array, xcount, xmax)

static const struct snd_kcontrol_new rt715_sdca_snd_controls[] =;

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

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

static const char * const adc_22_23_mux_text[] =;

/*
 * Due to mux design for nid 24 (MUX_IN3)/25 (MUX_IN4), connection index 0 and
 * 1 will be connected to the same dmic source, therefore we skip index 1 to
 * avoid misunderstanding on usage of dapm routing.
 */
static int rt715_adc_24_25_values[] =;

static const char * const adc_24_mux_text[] =;

static const char * const adc_25_mux_text[] =;

static SOC_ENUM_SINGLE_DECL(rt715_adc22_enum, SND_SOC_NOPM, 0,
	adc_22_23_mux_text);

static SOC_ENUM_SINGLE_DECL(rt715_adc23_enum, SND_SOC_NOPM, 0,
	adc_22_23_mux_text);

static SOC_VALUE_ENUM_SINGLE_DECL(rt715_adc24_enum,
	SND_SOC_NOPM, 0, 0xf,
	adc_24_mux_text, rt715_adc_24_25_values);
static SOC_VALUE_ENUM_SINGLE_DECL(rt715_adc25_enum,
	SND_SOC_NOPM, 0, 0xf,
	adc_25_mux_text, rt715_adc_24_25_values);

static const struct snd_kcontrol_new rt715_adc22_mux =;

static const struct snd_kcontrol_new rt715_adc23_mux =;

static const struct snd_kcontrol_new rt715_adc24_mux =;

static const struct snd_kcontrol_new rt715_adc25_mux =;

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

static const struct snd_soc_dapm_widget rt715_sdca_dapm_widgets[] =;

static const struct snd_soc_dapm_route rt715_sdca_audio_map[] =;

static int rt715_sdca_probe(struct snd_soc_component *component)
{}

static const struct snd_soc_component_driver soc_codec_dev_rt715_sdca =;

static int rt715_sdca_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
				int direction)
{}

static void rt715_sdca_shutdown(struct snd_pcm_substream *substream,
				struct snd_soc_dai *dai)

{}

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

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

#define RT715_STEREO_RATES
#define RT715_FORMATS

static const struct snd_soc_dai_ops rt715_sdca_ops =;

static struct snd_soc_dai_driver rt715_sdca_dai[] =;

/* Bus clock frequency */
#define RT715_CLK_FREQ_9600000HZ
#define RT715_CLK_FREQ_12000000HZ
#define RT715_CLK_FREQ_6000000HZ
#define RT715_CLK_FREQ_4800000HZ
#define RT715_CLK_FREQ_2400000HZ
#define RT715_CLK_FREQ_12288000HZ

int rt715_sdca_init(struct device *dev, struct regmap *mbq_regmap,
	struct regmap *regmap, struct sdw_slave *slave)
{}

int rt715_sdca_io_init(struct device *dev, struct sdw_slave *slave)
{}

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