#include <linux/init.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/pm_runtime.h>
#include <linux/of.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>
#include "omap-mcbsp-priv.h"
#include "omap-mcbsp.h"
#include "sdma-pcm.h"
#define OMAP_MCBSP_RATES …
enum { … };
static void omap_mcbsp_dump_reg(struct omap_mcbsp *mcbsp)
{ … }
static int omap2_mcbsp_set_clks_src(struct omap_mcbsp *mcbsp, u8 fck_src_id)
{ … }
static irqreturn_t omap_mcbsp_irq_handler(int irq, void *data)
{ … }
static irqreturn_t omap_mcbsp_tx_irq_handler(int irq, void *data)
{ … }
static irqreturn_t omap_mcbsp_rx_irq_handler(int irq, void *data)
{ … }
static void omap_mcbsp_config(struct omap_mcbsp *mcbsp,
const struct omap_mcbsp_reg_cfg *config)
{ … }
static int omap_mcbsp_dma_reg_params(struct omap_mcbsp *mcbsp,
unsigned int stream)
{ … }
static void omap_mcbsp_set_tx_threshold(struct omap_mcbsp *mcbsp, u16 threshold)
{ … }
static void omap_mcbsp_set_rx_threshold(struct omap_mcbsp *mcbsp, u16 threshold)
{ … }
static u16 omap_mcbsp_get_tx_delay(struct omap_mcbsp *mcbsp)
{ … }
static u16 omap_mcbsp_get_rx_delay(struct omap_mcbsp *mcbsp)
{ … }
static int omap_mcbsp_request(struct omap_mcbsp *mcbsp)
{ … }
static void omap_mcbsp_free(struct omap_mcbsp *mcbsp)
{ … }
static void omap_mcbsp_start(struct omap_mcbsp *mcbsp, int stream)
{ … }
static void omap_mcbsp_stop(struct omap_mcbsp *mcbsp, int stream)
{ … }
#define max_thres(m) …
#define valid_threshold(m, val) …
#define THRESHOLD_PROP_BUILDER(prop) …
THRESHOLD_PROP_BUILDER(…);
THRESHOLD_PROP_BUILDER(…);
static const char * const dma_op_modes[] = …;
static ssize_t dma_op_mode_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t dma_op_mode_store(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t size)
{ … }
static DEVICE_ATTR_RW(dma_op_mode);
static const struct attribute *additional_attrs[] = …;
static const struct attribute_group additional_attr_group = …;
static int omap_mcbsp_init(struct platform_device *pdev)
{ … }
static void omap_mcbsp_set_threshold(struct snd_pcm_substream *substream,
unsigned int packet_size)
{ … }
static int omap_mcbsp_hwrule_min_buffersize(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule)
{ … }
static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai)
{ … }
static void omap_mcbsp_dai_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai)
{ … }
static int omap_mcbsp_dai_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai)
{ … }
static int omap_mcbsp_dai_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *cpu_dai)
{ … }
static snd_pcm_sframes_t omap_mcbsp_dai_delay(
struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *cpu_dai)
{ … }
static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai,
unsigned int fmt)
{ … }
static int omap_mcbsp_dai_set_clkdiv(struct snd_soc_dai *cpu_dai,
int div_id, int div)
{ … }
static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
int clk_id, unsigned int freq,
int dir)
{ … }
static int omap_mcbsp_probe(struct snd_soc_dai *dai)
{ … }
static int omap_mcbsp_remove(struct snd_soc_dai *dai)
{ … }
static const struct snd_soc_dai_ops mcbsp_dai_ops = …;
static struct snd_soc_dai_driver omap_mcbsp_dai = …;
static const struct snd_soc_component_driver omap_mcbsp_component = …;
static struct omap_mcbsp_platform_data omap2420_pdata = …;
static struct omap_mcbsp_platform_data omap2430_pdata = …;
static struct omap_mcbsp_platform_data omap3_pdata = …;
static struct omap_mcbsp_platform_data omap4_pdata = …;
static const struct of_device_id omap_mcbsp_of_match[] = …;
MODULE_DEVICE_TABLE(of, omap_mcbsp_of_match);
static int asoc_mcbsp_probe(struct platform_device *pdev)
{ … }
static void asoc_mcbsp_remove(struct platform_device *pdev)
{ … }
static struct platform_driver asoc_mcbsp_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;