#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/module.h>
#include <sound/pcm_params.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/reset.h>
#include <sound/soc.h>
#include <sound/soc-dai.h>
#include <dt-bindings/sound/meson-g12a-toacodec.h>
#include "axg-tdm.h"
#include "meson-codec-glue.h"
#define G12A_TOACODEC_DRV_NAME …
#define TOACODEC_CTRL0 …
#define CTRL0_ENABLE_SHIFT …
#define CTRL0_DAT_SEL_SM1_MSB …
#define CTRL0_DAT_SEL_SM1_LSB …
#define CTRL0_DAT_SEL_MSB …
#define CTRL0_DAT_SEL_LSB …
#define CTRL0_LANE_SEL_SM1 …
#define CTRL0_LANE_SEL …
#define CTRL0_LRCLK_SEL_SM1_MSB …
#define CTRL0_LRCLK_SEL_SM1_LSB …
#define CTRL0_LRCLK_SEL_MSB …
#define CTRL0_LRCLK_SEL_LSB …
#define CTRL0_LRCLK_INV_SM1 …
#define CTRL0_BLK_CAP_INV_SM1 …
#define CTRL0_BLK_CAP_INV …
#define CTRL0_BCLK_O_INV_SM1 …
#define CTRL0_BCLK_O_INV …
#define CTRL0_BCLK_SEL_SM1_MSB …
#define CTRL0_BCLK_SEL_MSB …
#define CTRL0_BCLK_SEL_LSB …
#define CTRL0_MCLK_SEL …
#define TOACODEC_OUT_CHMAX …
struct g12a_toacodec { … };
struct g12a_toacodec_match_data { … };
static const char * const g12a_toacodec_mux_texts[] = …;
static int g12a_toacodec_mux_put_enum(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static SOC_ENUM_SINGLE_DECL(g12a_toacodec_mux_enum, TOACODEC_CTRL0,
CTRL0_DAT_SEL_LSB,
g12a_toacodec_mux_texts);
static SOC_ENUM_SINGLE_DECL(sm1_toacodec_mux_enum, TOACODEC_CTRL0,
CTRL0_DAT_SEL_SM1_LSB,
g12a_toacodec_mux_texts);
static const struct snd_kcontrol_new g12a_toacodec_mux = …;
static const struct snd_kcontrol_new sm1_toacodec_mux = …;
static const struct snd_kcontrol_new g12a_toacodec_out_enable = …;
static const struct snd_soc_dapm_widget g12a_toacodec_widgets[] = …;
static const struct snd_soc_dapm_widget sm1_toacodec_widgets[] = …;
static int g12a_toacodec_input_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 g12a_toacodec_input_ops = …;
static const struct snd_soc_dai_ops g12a_toacodec_output_ops = …;
#define TOACODEC_STREAM(xname, xsuffix, xchmax) …
#define TOACODEC_INPUT(xname, xid) …
#define TOACODEC_OUTPUT(xname, xid) …
static struct snd_soc_dai_driver g12a_toacodec_dai_drv[] = …;
static int g12a_toacodec_component_probe(struct snd_soc_component *c)
{ … }
static int sm1_toacodec_component_probe(struct snd_soc_component *c)
{ … }
static const struct snd_soc_dapm_route g12a_toacodec_routes[] = …;
static const struct snd_kcontrol_new g12a_toacodec_controls[] = …;
static const struct snd_kcontrol_new sm1_toacodec_controls[] = …;
static const struct snd_soc_component_driver g12a_toacodec_component_drv = …;
static const struct snd_soc_component_driver sm1_toacodec_component_drv = …;
static const struct regmap_config g12a_toacodec_regmap_cfg = …;
static const struct g12a_toacodec_match_data g12a_toacodec_match_data = …;
static const struct g12a_toacodec_match_data sm1_toacodec_match_data = …;
static const struct of_device_id g12a_toacodec_of_match[] = …;
MODULE_DEVICE_TABLE(of, g12a_toacodec_of_match);
static int g12a_toacodec_probe(struct platform_device *pdev)
{ … }
static struct platform_driver g12a_toacodec_pdrv = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;