#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-dai.h>
#include "cygnus-ssp.h"
#define DEFAULT_VCO …
#define CAPTURE_FCI_ID_BASE …
#define CYGNUS_SSP_TRISTATE_MASK …
#define CYGNUS_PLLCLKSEL_MASK …
#define PLAYBACK_STREAM_MASK …
#define CAPTURE_STREAM_MASK …
#define I2S_STREAM_CFG_MASK …
#define I2S_CAP_STREAM_CFG_MASK …
#define SPDIF_STREAM_CFG_MASK …
#define CH_GRP_STEREO …
#define AUD_MISC_SEROUT_OE_REG_BASE …
#define AUD_MISC_SEROUT_SPDIF_OE …
#define AUD_MISC_SEROUT_MCLK_OE …
#define AUD_MISC_SEROUT_LRCK_OE …
#define AUD_MISC_SEROUT_SCLK_OE …
#define AUD_MISC_SEROUT_SDAT_OE …
#define BF_DST_CFG0_OFFSET …
#define BF_DST_CFG1_OFFSET …
#define BF_DST_CFG2_OFFSET …
#define BF_DST_CTRL0_OFFSET …
#define BF_DST_CTRL1_OFFSET …
#define BF_DST_CTRL2_OFFSET …
#define BF_SRC_CFG0_OFFSET …
#define BF_SRC_CFG1_OFFSET …
#define BF_SRC_CFG2_OFFSET …
#define BF_SRC_CFG3_OFFSET …
#define BF_SRC_CTRL0_OFFSET …
#define BF_SRC_CTRL1_OFFSET …
#define BF_SRC_CTRL2_OFFSET …
#define BF_SRC_CTRL3_OFFSET …
#define BF_SRC_GRP0_OFFSET …
#define BF_SRC_GRP1_OFFSET …
#define BF_SRC_GRP2_OFFSET …
#define BF_SRC_GRP3_OFFSET …
#define BF_SRC_GRP_EN_OFFSET …
#define BF_SRC_GRP_FLOWON_OFFSET …
#define BF_SRC_GRP_SYNC_DIS_OFFSET …
#define OUT_I2S_0_STREAM_CFG_OFFSET …
#define OUT_I2S_0_CFG_OFFSET …
#define OUT_I2S_0_MCLK_CFG_OFFSET …
#define OUT_I2S_1_STREAM_CFG_OFFSET …
#define OUT_I2S_1_CFG_OFFSET …
#define OUT_I2S_1_MCLK_CFG_OFFSET …
#define OUT_I2S_2_STREAM_CFG_OFFSET …
#define OUT_I2S_2_CFG_OFFSET …
#define OUT_I2S_2_MCLK_CFG_OFFSET …
#define SPDIF_STREAM_CFG_OFFSET …
#define SPDIF_CTRL_OFFSET …
#define SPDIF_FORMAT_CFG_OFFSET …
#define SPDIF_MCLK_CFG_OFFSET …
#define IOP_PLL_0_MACRO_OFFSET …
#define IOP_PLL_0_MDIV_Ch0_OFFSET …
#define IOP_PLL_0_MDIV_Ch1_OFFSET …
#define IOP_PLL_0_MDIV_Ch2_OFFSET …
#define IOP_PLL_0_ACTIVE_MDIV_Ch0_OFFSET …
#define IOP_PLL_0_ACTIVE_MDIV_Ch1_OFFSET …
#define IOP_PLL_0_ACTIVE_MDIV_Ch2_OFFSET …
#define IOP_PLL_0_CONTROL_OFFSET …
#define IOP_PLL_0_USER_NDIV_OFFSET …
#define IOP_PLL_0_ACTIVE_NDIV_OFFSET …
#define IOP_PLL_0_RESET_OFFSET …
#define IN_I2S_0_STREAM_CFG_OFFSET …
#define IN_I2S_0_CFG_OFFSET …
#define IN_I2S_1_STREAM_CFG_OFFSET …
#define IN_I2S_1_CFG_OFFSET …
#define IN_I2S_2_STREAM_CFG_OFFSET …
#define IN_I2S_2_CFG_OFFSET …
#define IOP_SW_INIT_LOGIC …
#define I2S_OUT_MCLKRATE_SHIFT …
#define I2S_OUT_PLLCLKSEL_SHIFT …
#define I2S_OUT_STREAM_ENA …
#define I2S_OUT_STREAM_CFG_GROUP_ID …
#define I2S_OUT_STREAM_CFG_CHANNEL_GROUPING …
#define I2S_IN_STREAM_CFG_CAP_ENA …
#define I2S_IN_STREAM_CFG_0_GROUP_ID …
#define I2S_OUT_CFGX_CLK_ENA …
#define I2S_OUT_CFGX_DATA_ENABLE …
#define I2S_OUT_CFGX_DATA_ALIGNMENT …
#define I2S_OUT_CFGX_BITS_PER_SLOT …
#define I2S_OUT_CFGX_VALID_SLOT …
#define I2S_OUT_CFGX_FSYNC_WIDTH …
#define I2S_OUT_CFGX_SCLKS_PER_1FS_DIV32 …
#define I2S_OUT_CFGX_SLAVE_MODE …
#define I2S_OUT_CFGX_TDM_MODE …
#define BF_SRC_CFGX_SFIFO_ENA …
#define BF_SRC_CFGX_BUFFER_PAIR_ENABLE …
#define BF_SRC_CFGX_SAMPLE_CH_MODE …
#define BF_SRC_CFGX_SFIFO_SZ_DOUBLE …
#define BF_SRC_CFGX_NOT_PAUSE_WHEN_EMPTY …
#define BF_SRC_CFGX_BIT_RES …
#define BF_SRC_CFGX_PROCESS_SEQ_ID_VALID …
#define BF_DST_CFGX_CAP_ENA …
#define BF_DST_CFGX_BUFFER_PAIR_ENABLE …
#define BF_DST_CFGX_DFIFO_SZ_DOUBLE …
#define BF_DST_CFGX_NOT_PAUSE_WHEN_FULL …
#define BF_DST_CFGX_FCI_ID …
#define BF_DST_CFGX_CAP_MODE …
#define BF_DST_CFGX_PROC_SEQ_ID_VALID …
#define SPDIF_0_OUT_DITHER_ENA …
#define SPDIF_0_OUT_STREAM_ENA …
#define IOP_PLL_0_USER_NDIV_FRAC …
#define IOP_PLL_0_ACTIVE_NDIV_FRAC …
#define INIT_SSP_REGS(num) …
struct pll_macro_entry { … };
static const struct pll_macro_entry pll_predef_mclk[] = …;
#define CYGNUS_RATE_MIN …
#define CYGNUS_RATE_MAX …
static const int ssp_valid_tdm_framesize[] = …;
static const unsigned int cygnus_rates[] = …;
static const struct snd_pcm_hw_constraint_list cygnus_rate_constraint = …;
static struct cygnus_aio_port *cygnus_dai_get_portinfo(struct snd_soc_dai *dai)
{ … }
static int audio_ssp_init_portregs(struct cygnus_aio_port *aio)
{ … }
static void audio_ssp_in_enable(struct cygnus_aio_port *aio)
{ … }
static void audio_ssp_in_disable(struct cygnus_aio_port *aio)
{ … }
static int audio_ssp_out_enable(struct cygnus_aio_port *aio)
{ … }
static int audio_ssp_out_disable(struct cygnus_aio_port *aio)
{ … }
static int pll_configure_mclk(struct cygnus_audio *cygaud, u32 mclk,
struct cygnus_aio_port *aio)
{ … }
static int cygnus_ssp_set_clocks(struct cygnus_aio_port *aio)
{ … }
static int cygnus_ssp_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int cygnus_ssp_set_sysclk(struct snd_soc_dai *dai,
int clk_id, unsigned int freq, int dir)
{ … }
static int cygnus_ssp_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static void cygnus_ssp_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
#define I2S_OUT_CFG_REG_UPDATE_MASK …
#define I2S_IN_CFG_REG_UPDATE_MASK …
int cygnus_ssp_set_custom_fsync_width(struct snd_soc_dai *cpu_dai, int len)
{ … }
EXPORT_SYMBOL_GPL(…);
static int cygnus_ssp_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
{ … }
static int cygnus_ssp_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *dai)
{ … }
static int cygnus_set_dai_tdm_slot(struct snd_soc_dai *cpu_dai,
unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width)
{ … }
#ifdef CONFIG_PM_SLEEP
static int __cygnus_ssp_suspend(struct snd_soc_dai *cpu_dai)
{ … }
static int cygnus_ssp_suspend(struct snd_soc_component *component)
{ … }
static int __cygnus_ssp_resume(struct snd_soc_dai *cpu_dai)
{ … }
static int cygnus_ssp_resume(struct snd_soc_component *component)
{ … }
#else
#define cygnus_ssp_suspend …
#define cygnus_ssp_resume …
#endif
static const struct snd_soc_dai_ops cygnus_ssp_dai_ops = …;
static const struct snd_soc_dai_ops cygnus_spdif_dai_ops = …;
#define INIT_CPU_DAI(num) …
static const struct snd_soc_dai_driver cygnus_ssp_dai_info[] = …;
static const struct snd_soc_dai_driver cygnus_spdif_dai_info = …;
static struct snd_soc_dai_driver cygnus_ssp_dai[CYGNUS_MAX_PORTS];
static const struct snd_soc_component_driver cygnus_ssp_component = …;
static int parse_ssp_child_node(struct platform_device *pdev,
struct device_node *dn,
struct cygnus_audio *cygaud,
struct snd_soc_dai_driver *p_dai)
{ … }
static int audio_clk_init(struct platform_device *pdev,
struct cygnus_audio *cygaud)
{ … }
static int cygnus_ssp_probe(struct platform_device *pdev)
{ … }
static void cygnus_ssp_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id cygnus_ssp_of_match[] = …;
MODULE_DEVICE_TABLE(of, cygnus_ssp_of_match);
static struct platform_driver cygnus_ssp_driver = …;
module_platform_driver(…) …;
MODULE_ALIAS(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;