#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/gpio/consumer.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/input.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/soc.h>
#include <sound/soc-dapm.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include "cs4265.h"
struct cs4265_private { … };
static const struct reg_default cs4265_reg_defaults[] = …;
static bool cs4265_readable_register(struct device *dev, unsigned int reg)
{ … }
static bool cs4265_volatile_register(struct device *dev, unsigned int reg)
{ … }
static DECLARE_TLV_DB_SCALE(pga_tlv, -1200, 50, 0);
static DECLARE_TLV_DB_SCALE(dac_tlv, -12750, 50, 0);
static const char * const digital_input_mux_text[] = …;
static SOC_ENUM_SINGLE_DECL(digital_input_mux_enum, CS4265_SIG_SEL, 7,
digital_input_mux_text);
static const struct snd_kcontrol_new digital_input_mux = …;
static const char * const mic_linein_text[] = …;
static SOC_ENUM_SINGLE_DECL(mic_linein_enum, CS4265_ADC_CTL2, 0,
mic_linein_text);
static const char * const cam_mode_text[] = …;
static SOC_ENUM_SINGLE_DECL(cam_mode_enum, CS4265_SPDIF_CTL1, 5,
cam_mode_text);
static const char * const cam_mono_stereo_text[] = …;
static SOC_ENUM_SINGLE_DECL(spdif_mono_stereo_enum, CS4265_SPDIF_CTL2, 2,
cam_mono_stereo_text);
static const char * const mono_select_text[] = …;
static SOC_ENUM_SINGLE_DECL(spdif_mono_select_enum, CS4265_SPDIF_CTL2, 0,
mono_select_text);
static const struct snd_kcontrol_new mic_linein_mux = …;
static const struct snd_kcontrol_new loopback_ctl = …;
static const struct snd_kcontrol_new spdif_switch = …;
static const struct snd_kcontrol_new dac_switch = …;
static const struct snd_kcontrol_new cs4265_snd_controls[] = …;
static const struct snd_soc_dapm_widget cs4265_dapm_widgets[] = …;
static const struct snd_soc_dapm_route cs4265_audio_map[] = …;
struct cs4265_clk_para { … };
static const struct cs4265_clk_para clk_map_table[] = …;
static int cs4265_get_clk_index(int mclk, int rate)
{ … }
static int cs4265_set_sysclk(struct snd_soc_dai *codec_dai, int clk_id,
unsigned int freq, int dir)
{ … }
static int cs4265_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
{ … }
static int cs4265_mute(struct snd_soc_dai *dai, int mute, int direction)
{ … }
static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int cs4265_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
#define CS4265_RATES …
#define CS4265_FORMATS …
static const struct snd_soc_dai_ops cs4265_ops = …;
static struct snd_soc_dai_driver cs4265_dai[] = …;
static const struct snd_soc_component_driver soc_component_cs4265 = …;
static const struct regmap_config cs4265_regmap = …;
static int cs4265_i2c_probe(struct i2c_client *i2c_client)
{ … }
static void cs4265_i2c_remove(struct i2c_client *i2c)
{ … }
static const struct of_device_id cs4265_of_match[] = …;
MODULE_DEVICE_TABLE(of, cs4265_of_match);
static const struct i2c_device_id cs4265_id[] = …;
MODULE_DEVICE_TABLE(i2c, cs4265_id);
static struct i2c_driver cs4265_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;