#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/regmap.h>
#include <linux/delay.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/initval.h>
#include <sound/soc.h>
#include <sound/tlv.h>
#define JZ4740_REG_CODEC_1 …
#define JZ4740_REG_CODEC_2 …
#define JZ4740_CODEC_1_LINE_ENABLE …
#define JZ4740_CODEC_1_MIC_ENABLE …
#define JZ4740_CODEC_1_SW1_ENABLE …
#define JZ4740_CODEC_1_ADC_ENABLE …
#define JZ4740_CODEC_1_SW2_ENABLE …
#define JZ4740_CODEC_1_DAC_ENABLE …
#define JZ4740_CODEC_1_VREF_DISABLE …
#define JZ4740_CODEC_1_VREF_AMP_DISABLE …
#define JZ4740_CODEC_1_VREF_PULLDOWN …
#define JZ4740_CODEC_1_VREF_LOW_CURRENT …
#define JZ4740_CODEC_1_VREF_HIGH_CURRENT …
#define JZ4740_CODEC_1_HEADPHONE_DISABLE …
#define JZ4740_CODEC_1_HEADPHONE_AMP_CHANGE_ANY …
#define JZ4740_CODEC_1_HEADPHONE_CHARGE …
#define JZ4740_CODEC_1_HEADPHONE_PULLDOWN …
#define JZ4740_CODEC_1_HEADPHONE_POWERDOWN_M …
#define JZ4740_CODEC_1_HEADPHONE_POWERDOWN …
#define JZ4740_CODEC_1_SUSPEND …
#define JZ4740_CODEC_1_RESET …
#define JZ4740_CODEC_1_LINE_ENABLE_OFFSET …
#define JZ4740_CODEC_1_MIC_ENABLE_OFFSET …
#define JZ4740_CODEC_1_SW1_ENABLE_OFFSET …
#define JZ4740_CODEC_1_ADC_ENABLE_OFFSET …
#define JZ4740_CODEC_1_SW2_ENABLE_OFFSET …
#define JZ4740_CODEC_1_DAC_ENABLE_OFFSET …
#define JZ4740_CODEC_1_HEADPHONE_DISABLE_OFFSET …
#define JZ4740_CODEC_1_HEADPHONE_POWERDOWN_OFFSET …
#define JZ4740_CODEC_2_INPUT_VOLUME_MASK …
#define JZ4740_CODEC_2_SAMPLE_RATE_MASK …
#define JZ4740_CODEC_2_MIC_BOOST_GAIN_MASK …
#define JZ4740_CODEC_2_HEADPHONE_VOLUME_MASK …
#define JZ4740_CODEC_2_INPUT_VOLUME_OFFSET …
#define JZ4740_CODEC_2_SAMPLE_RATE_OFFSET …
#define JZ4740_CODEC_2_MIC_BOOST_GAIN_OFFSET …
#define JZ4740_CODEC_2_HEADPHONE_VOLUME_OFFSET …
static const struct reg_default jz4740_codec_reg_defaults[] = …;
struct jz4740_codec { … };
static const DECLARE_TLV_DB_RANGE(jz4740_mic_tlv,
0, 2, TLV_DB_SCALE_ITEM(0, 600, 0),
3, 3, TLV_DB_SCALE_ITEM(2000, 0, 0)
);
static const DECLARE_TLV_DB_SCALE(jz4740_out_tlv, 0, 200, 0);
static const DECLARE_TLV_DB_SCALE(jz4740_in_tlv, -3450, 150, 0);
static const struct snd_kcontrol_new jz4740_codec_controls[] = …;
static const struct snd_kcontrol_new jz4740_codec_output_controls[] = …;
static const struct snd_kcontrol_new jz4740_codec_input_controls[] = …;
static const struct snd_soc_dapm_widget jz4740_codec_dapm_widgets[] = …;
static const struct snd_soc_dapm_route jz4740_codec_dapm_routes[] = …;
static int jz4740_codec_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
{ … }
static const struct snd_soc_dai_ops jz4740_codec_dai_ops = …;
static struct snd_soc_dai_driver jz4740_codec_dai = …;
static void jz4740_codec_wakeup(struct regmap *regmap)
{ … }
static int jz4740_codec_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
static int jz4740_codec_dev_probe(struct snd_soc_component *component)
{ … }
static const struct snd_soc_component_driver soc_codec_dev_jz4740_codec = …;
static const struct regmap_config jz4740_codec_regmap_config = …;
static int jz4740_codec_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id jz4740_codec_of_matches[] = …;
MODULE_DEVICE_TABLE(of, jz4740_codec_of_matches);
static struct platform_driver jz4740_codec_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;