#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/i2c.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 <linux/regulator/consumer.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 <sound/hda_verbs.h>
#include "rt715.h"
static int rt715_index_write(struct regmap *regmap, unsigned int reg,
unsigned int value)
{ … }
static int rt715_index_write_nid(struct regmap *regmap,
unsigned int nid, unsigned int reg, unsigned int value)
{ … }
static int rt715_index_read_nid(struct regmap *regmap,
unsigned int nid, unsigned int reg, unsigned int *value)
{ … }
static int rt715_index_update_bits(struct regmap *regmap, unsigned int nid,
unsigned int reg, unsigned int mask, unsigned int val)
{ … }
static void rt715_reset(struct regmap *regmap)
{ … }
static void rt715_get_gain(struct rt715_priv *rt715, unsigned int addr_h,
unsigned int addr_l, unsigned int val_h,
unsigned int *r_val, unsigned int *l_val)
{ … }
static int rt715_set_amp_gain_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt715_set_amp_gain_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt715_set_main_switch_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt715_set_main_switch_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt715_set_main_vol_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt715_set_main_vol_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_switch_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int rt715_vol_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
#define SOC_DOUBLE_R_EXT(xname, reg_left, reg_right, xshift, xmax, xinvert,\
xhandler_get, xhandler_put) …
#define RT715_MAIN_SWITCH_EXT(xname, xhandler_get, xhandler_put) …
#define RT715_MAIN_VOL_EXT_TLV(xname, xhandler_get, xhandler_put, tlv_array) …
static const struct snd_kcontrol_new rt715_snd_controls[] = …;
static int rt715_mux_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt715_mux_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const char * const adc_22_23_mux_text[] = …;
static const unsigned 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, RT715_MUX_IN1, 0, adc_22_23_mux_text);
static SOC_ENUM_SINGLE_DECL(
rt715_adc23_enum, RT715_MUX_IN2, 0, adc_22_23_mux_text);
static SOC_VALUE_ENUM_SINGLE_DECL(rt715_adc24_enum,
RT715_MUX_IN3, 0, 0xf,
adc_24_mux_text, rt715_adc_24_25_values);
static SOC_VALUE_ENUM_SINGLE_DECL(rt715_adc25_enum,
RT715_MUX_IN4, 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 const struct snd_soc_dapm_widget rt715_dapm_widgets[] = …;
static const struct snd_soc_dapm_route rt715_audio_map[] = …;
static int rt715_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
static int rt715_probe(struct snd_soc_component *component)
{ … }
static const struct snd_soc_component_driver soc_codec_dev_rt715 = …;
static int rt715_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
int direction)
{ … }
static void rt715_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int rt715_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int rt715_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_ops = …;
static struct snd_soc_dai_driver rt715_dai[] = …;
#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_clock_config(struct device *dev)
{ … }
int rt715_init(struct device *dev, struct regmap *sdw_regmap,
struct regmap *regmap, struct sdw_slave *slave)
{ … }
int rt715_io_init(struct device *dev, struct sdw_slave *slave)
{ … }
MODULE_DESCRIPTION(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;