#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/spi/spi.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/tlv.h>
#define CS4341_REG_MODE1 …
#define CS4341_REG_MODE2 …
#define CS4341_REG_MIX …
#define CS4341_REG_VOLA …
#define CS4341_REG_VOLB …
#define CS4341_MODE2_DIF …
#define CS4341_MODE2_DIF_I2S_24 …
#define CS4341_MODE2_DIF_I2S_16 …
#define CS4341_MODE2_DIF_LJ_24 …
#define CS4341_MODE2_DIF_RJ_24 …
#define CS4341_MODE2_DIF_RJ_16 …
#define CS4341_VOLX_MUTE …
struct cs4341_priv { … };
static const struct reg_default cs4341_reg_defaults[] = …;
static int cs4341_set_fmt(struct snd_soc_dai *dai, unsigned int format)
{ … }
static int cs4341_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int cs4341_mute(struct snd_soc_dai *dai, int mute, int direction)
{ … }
static DECLARE_TLV_DB_SCALE(out_tlv, -9000, 100, 0);
static const char * const deemph[] = …;
static const struct soc_enum deemph_enum = …;
static const char * const srzc[] = …;
static const struct soc_enum srzc_enum = …;
static const struct snd_soc_dapm_widget cs4341_dapm_widgets[] = …;
static const struct snd_soc_dapm_route cs4341_routes[] = …;
static const struct snd_kcontrol_new cs4341_controls[] = …;
static const struct snd_soc_dai_ops cs4341_dai_ops = …;
static struct snd_soc_dai_driver cs4341_dai = …;
static const struct snd_soc_component_driver soc_component_cs4341 = …;
static const struct of_device_id __maybe_unused cs4341_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, cs4341_dt_ids);
static int cs4341_probe(struct device *dev)
{ … }
#if IS_ENABLED(CONFIG_I2C)
static int cs4341_i2c_probe(struct i2c_client *i2c)
{ … }
static const struct i2c_device_id cs4341_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, cs4341_i2c_id);
static struct i2c_driver cs4341_i2c_driver = …;
#endif
#if defined(CONFIG_SPI_MASTER)
static bool cs4341_reg_readable(struct device *dev, unsigned int reg)
{ … }
static int cs4341_spi_probe(struct spi_device *spi)
{ … }
static const struct spi_device_id cs4341_spi_ids[] = …;
MODULE_DEVICE_TABLE(spi, cs4341_spi_ids);
static struct spi_driver cs4341_spi_driver = …;
#endif
static int __init cs4341_init(void)
{ … }
module_init(…) …;
static void __exit cs4341_exit(void)
{ … }
module_exit(cs4341_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;