linux/sound/soc/fsl/fsl_esai.c

// SPDX-License-Identifier: GPL-2.0
//
// Freescale ESAI ALSA SoC Digital Audio Interface (DAI) driver
//
// Copyright (C) 2014 Freescale Semiconductor, Inc.

#include <linux/clk.h>
#include <linux/dmaengine.h>
#include <linux/module.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/pm_runtime.h>
#include <sound/dmaengine_pcm.h>
#include <sound/pcm_params.h>

#include "fsl_esai.h"
#include "imx-pcm.h"

#define FSL_ESAI_FORMATS

/**
 * struct fsl_esai_soc_data - soc specific data
 * @reset_at_xrun: flags for enable reset operaton
 */
struct fsl_esai_soc_data {};

/**
 * struct fsl_esai - ESAI private data
 * @dma_params_rx: DMA parameters for receive channel
 * @dma_params_tx: DMA parameters for transmit channel
 * @pdev: platform device pointer
 * @regmap: regmap handler
 * @coreclk: clock source to access register
 * @extalclk: esai clock source to derive HCK, SCK and FS
 * @fsysclk: system clock source to derive HCK, SCK and FS
 * @spbaclk: SPBA clock (optional, depending on SoC design)
 * @work: work to handle the reset operation
 * @soc: soc specific data
 * @lock: spin lock between hw_reset() and trigger()
 * @fifo_depth: depth of tx/rx FIFO
 * @slot_width: width of each DAI slot
 * @slots: number of slots
 * @tx_mask: slot mask for TX
 * @rx_mask: slot mask for RX
 * @channels: channel num for tx or rx
 * @hck_rate: clock rate of desired HCKx clock
 * @sck_rate: clock rate of desired SCKx clock
 * @hck_dir: the direction of HCKx pads
 * @sck_div: if using PSR/PM dividers for SCKx clock
 * @consumer_mode: if fully using DAI clock consumer mode
 * @synchronous: if using tx/rx synchronous mode
 * @name: driver name
 */
struct fsl_esai {};

static struct fsl_esai_soc_data fsl_esai_vf610 =;

static struct fsl_esai_soc_data fsl_esai_imx35 =;

static struct fsl_esai_soc_data fsl_esai_imx6ull =;

static irqreturn_t esai_isr(int irq, void *devid)
{}

/**
 * fsl_esai_divisor_cal - This function is used to calculate the
 * divisors of psr, pm, fp and it is supposed to be called in
 * set_dai_sysclk() and set_bclk().
 *
 * @dai: pointer to DAI
 * @tx: current setting is for playback or capture
 * @ratio: desired overall ratio for the paticipating dividers
 * @usefp: for HCK setting, there is no need to set fp divider
 * @fp: bypass other dividers by setting fp directly if fp != 0
 */
static int fsl_esai_divisor_cal(struct snd_soc_dai *dai, bool tx, u32 ratio,
				bool usefp, u32 fp)
{}

/**
 * fsl_esai_set_dai_sysclk - configure the clock frequency of MCLK (HCKT/HCKR)
 * @dai: pointer to DAI
 * @clk_id: The clock source of HCKT/HCKR
 *	  (Input from outside; output from inside, FSYS or EXTAL)
 * @freq: The required clock rate of HCKT/HCKR
 * @dir: The clock direction of HCKT/HCKR
 *
 * Note: If the direction is input, we do not care about clk_id.
 */
static int fsl_esai_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
				   unsigned int freq, int dir)
{}

/**
 * fsl_esai_set_bclk - configure the related dividers according to the bclk rate
 * @dai: pointer to DAI
 * @tx: direction boolean
 * @freq: bclk freq
 */
static int fsl_esai_set_bclk(struct snd_soc_dai *dai, bool tx, u32 freq)
{}

static int fsl_esai_set_dai_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask,
				     u32 rx_mask, int slots, int slot_width)
{}

static int fsl_esai_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{}

static int fsl_esai_startup(struct snd_pcm_substream *substream,
			    struct snd_soc_dai *dai)
{}

static int fsl_esai_hw_params(struct snd_pcm_substream *substream,
			      struct snd_pcm_hw_params *params,
			      struct snd_soc_dai *dai)
{}

static int fsl_esai_hw_init(struct fsl_esai *esai_priv)
{}

static int fsl_esai_register_restore(struct fsl_esai *esai_priv)
{}

static void fsl_esai_trigger_start(struct fsl_esai *esai_priv, bool tx)
{}

static void fsl_esai_trigger_stop(struct fsl_esai *esai_priv, bool tx)
{}

static void fsl_esai_hw_reset(struct work_struct *work)
{}

static int fsl_esai_trigger(struct snd_pcm_substream *substream, int cmd,
			    struct snd_soc_dai *dai)
{}

static int fsl_esai_dai_probe(struct snd_soc_dai *dai)
{}

static const struct snd_soc_dai_ops fsl_esai_dai_ops =;

static struct snd_soc_dai_driver fsl_esai_dai =;

static const struct snd_soc_component_driver fsl_esai_component =;

static const struct reg_default fsl_esai_reg_defaults[] =;

static bool fsl_esai_readable_reg(struct device *dev, unsigned int reg)
{}

static bool fsl_esai_volatile_reg(struct device *dev, unsigned int reg)
{}

static bool fsl_esai_writeable_reg(struct device *dev, unsigned int reg)
{}

static const struct regmap_config fsl_esai_regmap_config =;

static int fsl_esai_runtime_resume(struct device *dev);
static int fsl_esai_runtime_suspend(struct device *dev);

static int fsl_esai_probe(struct platform_device *pdev)
{}

static void fsl_esai_remove(struct platform_device *pdev)
{}

static const struct of_device_id fsl_esai_dt_ids[] =;
MODULE_DEVICE_TABLE(of, fsl_esai_dt_ids);

static int fsl_esai_runtime_resume(struct device *dev)
{}

static int fsl_esai_runtime_suspend(struct device *dev)
{}

static const struct dev_pm_ops fsl_esai_pm_ops =;

static struct platform_driver fsl_esai_driver =;

module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_ALIAS();