#include <linux/init.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/mfd/syscon.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/initval.h>
#include <sound/soc.h>
#include <sound/dmaengine_pcm.h>
#define ATMEL_I2SC_MAX_TDM_CHANNELS …
#define ATMEL_I2SC_CR …
#define ATMEL_I2SC_MR …
#define ATMEL_I2SC_SR …
#define ATMEL_I2SC_SCR …
#define ATMEL_I2SC_SSR …
#define ATMEL_I2SC_IER …
#define ATMEL_I2SC_IDR …
#define ATMEL_I2SC_IMR …
#define ATMEL_I2SC_RHR …
#define ATMEL_I2SC_THR …
#define ATMEL_I2SC_VERSION …
#define ATMEL_I2SC_CR_RXEN …
#define ATMEL_I2SC_CR_RXDIS …
#define ATMEL_I2SC_CR_CKEN …
#define ATMEL_I2SC_CR_CKDIS …
#define ATMEL_I2SC_CR_TXEN …
#define ATMEL_I2SC_CR_TXDIS …
#define ATMEL_I2SC_CR_SWRST …
#define ATMEL_I2SC_MR_MODE_MASK …
#define ATMEL_I2SC_MR_MODE_SLAVE …
#define ATMEL_I2SC_MR_MODE_MASTER …
#define ATMEL_I2SC_MR_DATALENGTH_MASK …
#define ATMEL_I2SC_MR_DATALENGTH_32_BITS …
#define ATMEL_I2SC_MR_DATALENGTH_24_BITS …
#define ATMEL_I2SC_MR_DATALENGTH_20_BITS …
#define ATMEL_I2SC_MR_DATALENGTH_18_BITS …
#define ATMEL_I2SC_MR_DATALENGTH_16_BITS …
#define ATMEL_I2SC_MR_DATALENGTH_16_BITS_COMPACT …
#define ATMEL_I2SC_MR_DATALENGTH_8_BITS …
#define ATMEL_I2SC_MR_DATALENGTH_8_BITS_COMPACT …
#define ATMEL_I2SC_MR_FORMAT_MASK …
#define ATMEL_I2SC_MR_FORMAT_I2S …
#define ATMEL_I2SC_MR_FORMAT_LJ …
#define ATMEL_I2SC_MR_FORMAT_TDM …
#define ATMEL_I2SC_MR_FORMAT_TDMLJ …
#define ATMEL_I2SC_MR_RXMONO …
#define ATMEL_I2SC_MR_RXDMA_MASK …
#define ATMEL_I2SC_MR_RXDMA_SINGLE …
#define ATMEL_I2SC_MR_RXDMA_MULTIPLE …
#define ATMEL_I2SC_MR_RXLOOP …
#define ATMEL_I2SC_MR_TXMONO …
#define ATMEL_I2SC_MR_TXDMA_MASK …
#define ATMEL_I2SC_MR_TXDMA_SINGLE …
#define ATMEL_I2SC_MR_TXDME_MULTIPLE …
#define ATMEL_I2SC_MR_TXSAME_MASK …
#define ATMEL_I2SC_MR_TXSAME_ZERO …
#define ATMEL_I2SC_MR_TXSAME_PREVIOUS …
#define ATMEL_I2SC_MR_IMCKDIV_MASK …
#define ATMEL_I2SC_MR_IMCKDIV(div) …
#define ATMEL_I2SC_MR_IMCKFS_MASK …
#define ATMEL_I2SC_MR_IMCKFS(fs) …
#define ATMEL_I2SC_MR_IMCKMODE_MASK …
#define ATMEL_I2SC_MR_IMCKMODE_I2SCK …
#define ATMEL_I2SC_MR_IMCKMODE_I2SMCK …
#define ATMEL_I2SC_MR_IWS …
#define ATMEL_I2SC_SR_RXEN …
#define ATMEL_I2SC_SR_RXRDY …
#define ATMEL_I2SC_SR_RXOR …
#define ATMEL_I2SC_SR_TXEN …
#define ATMEL_I2SC_SR_TXRDY …
#define ATMEL_I2SC_SR_TXUR …
#define ATMEL_I2SC_SR_RXORCH_MASK …
#define ATMEL_I2SC_SR_RXORCH(ch) …
#define ATMEL_I2SC_SR_TXURCH_MASK …
#define ATMEL_I2SC_SR_TXURCH(ch) …
#define ATMEL_I2SC_INT_RXRDY …
#define ATMEL_I2SC_INT_RXOR …
#define ATMEL_I2SC_INT_TXRDY …
#define ATMEL_I2SC_INT_TXUR …
static const struct regmap_config atmel_i2s_regmap_config = …;
struct atmel_i2s_gck_param { … };
#define I2S_MCK_12M288 …
#define I2S_MCK_11M2896 …
#define I2S_MCK_6M144 …
static const struct atmel_i2s_gck_param gck_params[] = …;
struct atmel_i2s_dev;
struct atmel_i2s_caps { … };
struct atmel_i2s_dev { … };
static irqreturn_t atmel_i2s_interrupt(int irq, void *dev_id)
{ … }
#define ATMEL_I2S_RATES …
#define ATMEL_I2S_FORMATS …
static int atmel_i2s_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{ … }
static int atmel_i2s_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int atmel_i2s_get_gck_param(struct atmel_i2s_dev *dev, int fs)
{ … }
static int atmel_i2s_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int atmel_i2s_switch_mck_generator(struct atmel_i2s_dev *dev,
bool enabled)
{ … }
static int atmel_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *dai)
{ … }
static int atmel_i2s_dai_probe(struct snd_soc_dai *dai)
{ … }
static const struct snd_soc_dai_ops atmel_i2s_dai_ops = …;
static struct snd_soc_dai_driver atmel_i2s_dai = …;
static const struct snd_soc_component_driver atmel_i2s_component = …;
static int atmel_i2s_sama5d2_mck_init(struct atmel_i2s_dev *dev,
struct device_node *np)
{ … }
static const struct atmel_i2s_caps atmel_i2s_sama5d2_caps = …;
static const struct of_device_id atmel_i2s_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, atmel_i2s_dt_ids);
static int atmel_i2s_probe(struct platform_device *pdev)
{ … }
static void atmel_i2s_remove(struct platform_device *pdev)
{ … }
static struct platform_driver atmel_i2s_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;