#include <linux/i2c.h>
#include <linux/gpio/consumer.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <sound/asoundef.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/soc.h>
#define AK4118_REG_CLK_PWR_CTL …
#define AK4118_REG_FORMAT_CTL …
#define AK4118_REG_IO_CTL0 …
#define AK4118_REG_IO_CTL1 …
#define AK4118_REG_INT0_MASK …
#define AK4118_REG_INT1_MASK …
#define AK4118_REG_RCV_STATUS0 …
#define AK4118_REG_RCV_STATUS1 …
#define AK4118_REG_RXCHAN_STATUS0 …
#define AK4118_REG_RXCHAN_STATUS1 …
#define AK4118_REG_RXCHAN_STATUS2 …
#define AK4118_REG_RXCHAN_STATUS3 …
#define AK4118_REG_RXCHAN_STATUS4 …
#define AK4118_REG_TXCHAN_STATUS0 …
#define AK4118_REG_TXCHAN_STATUS1 …
#define AK4118_REG_TXCHAN_STATUS2 …
#define AK4118_REG_TXCHAN_STATUS3 …
#define AK4118_REG_TXCHAN_STATUS4 …
#define AK4118_REG_BURST_PREAMB_PC0 …
#define AK4118_REG_BURST_PREAMB_PC1 …
#define AK4118_REG_BURST_PREAMB_PD0 …
#define AK4118_REG_BURST_PREAMB_PD1 …
#define AK4118_REG_QSUB_CTL …
#define AK4118_REG_QSUB_TRACK …
#define AK4118_REG_QSUB_INDEX …
#define AK4118_REG_QSUB_MIN …
#define AK4118_REG_QSUB_SEC …
#define AK4118_REG_QSUB_FRAME …
#define AK4118_REG_QSUB_ZERO …
#define AK4118_REG_QSUB_ABS_MIN …
#define AK4118_REG_QSUB_ABS_SEC …
#define AK4118_REG_QSUB_ABS_FRAME …
#define AK4118_REG_GPE …
#define AK4118_REG_GPDR …
#define AK4118_REG_GPSCR …
#define AK4118_REG_GPLR …
#define AK4118_REG_DAT_MASK_DTS …
#define AK4118_REG_RX_DETECT …
#define AK4118_REG_STC_DAT_DETECT …
#define AK4118_REG_RXCHAN_STATUS5 …
#define AK4118_REG_TXCHAN_STATUS5 …
#define AK4118_REG_MAX …
#define AK4118_REG_FORMAT_CTL_DIF0 …
#define AK4118_REG_FORMAT_CTL_DIF1 …
#define AK4118_REG_FORMAT_CTL_DIF2 …
struct ak4118_priv { … };
static const struct reg_default ak4118_reg_defaults[] = …;
static const char * const ak4118_input_select_txt[] = …;
static SOC_ENUM_SINGLE_DECL(ak4118_insel_enum, AK4118_REG_IO_CTL1, 0x0,
ak4118_input_select_txt);
static const struct snd_kcontrol_new ak4118_input_mux_controls = …;
static const char * const ak4118_iec958_fs_txt[] = …;
static const int ak4118_iec958_fs_val[] = …;
static SOC_VALUE_ENUM_SINGLE_DECL(ak4118_iec958_fs_enum, AK4118_REG_RCV_STATUS1,
0x4, 0x4, ak4118_iec958_fs_txt,
ak4118_iec958_fs_val);
static struct snd_kcontrol_new ak4118_iec958_controls[] = …;
static const struct snd_soc_dapm_widget ak4118_dapm_widgets[] = …;
static const struct snd_soc_dapm_route ak4118_dapm_routes[] = …;
static int ak4118_set_dai_fmt_provider(struct ak4118_priv *ak4118,
unsigned int format)
{ … }
static int ak4118_set_dai_fmt_consumer(struct ak4118_priv *ak4118,
unsigned int format)
{ … }
static int ak4118_set_dai_fmt(struct snd_soc_dai *dai,
unsigned int format)
{ … }
static int ak4118_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 ak4118_dai_ops = …;
static struct snd_soc_dai_driver ak4118_dai = …;
static irqreturn_t ak4118_irq_handler(int irq, void *data)
{ … }
static int ak4118_probe(struct snd_soc_component *component)
{ … }
static void ak4118_remove(struct snd_soc_component *component)
{ … }
static const struct snd_soc_component_driver soc_component_drv_ak4118 = …;
static const struct regmap_config ak4118_regmap = …;
static int ak4118_i2c_probe(struct i2c_client *i2c)
{ … }
#ifdef CONFIG_OF
static const struct of_device_id ak4118_of_match[] = …;
MODULE_DEVICE_TABLE(of, ak4118_of_match);
#endif
static const struct i2c_device_id ak4118_id_table[] = …;
MODULE_DEVICE_TABLE(i2c, ak4118_id_table);
static struct i2c_driver ak4118_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;