#include <linux/bitrev.h>
#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <sound/dmaengine_pcm.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include "kmb_platform.h"
#define PERIODS_MIN …
#define PERIODS_MAX …
#define PERIOD_BYTES_MIN …
#define BUFFER_BYTES_MAX …
#define TDM_OPERATION …
#define I2S_OPERATION …
#define DATA_WIDTH_CONFIG_BIT …
#define TDM_CHANNEL_CONFIG_BIT …
static const struct snd_pcm_hardware kmb_pcm_hardware = …;
static void hdmi_reformat_iec958(struct snd_pcm_runtime *runtime,
struct kmb_i2s_info *kmb_i2s,
unsigned int tx_ptr)
{ … }
static unsigned int kmb_pcm_tx_fn(struct kmb_i2s_info *kmb_i2s,
struct snd_pcm_runtime *runtime,
unsigned int tx_ptr, bool *period_elapsed)
{ … }
static unsigned int kmb_pcm_rx_fn(struct kmb_i2s_info *kmb_i2s,
struct snd_pcm_runtime *runtime,
unsigned int rx_ptr, bool *period_elapsed)
{ … }
static inline void kmb_i2s_disable_channels(struct kmb_i2s_info *kmb_i2s,
u32 stream)
{ … }
static inline void kmb_i2s_clear_irqs(struct kmb_i2s_info *kmb_i2s, u32 stream)
{ … }
static inline void kmb_i2s_irq_trigger(struct kmb_i2s_info *kmb_i2s,
u32 stream, int chan_nr, bool trigger)
{ … }
static void kmb_pcm_operation(struct kmb_i2s_info *kmb_i2s, bool playback)
{ … }
static int kmb_pcm_open(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ … }
static int kmb_pcm_trigger(struct snd_soc_component *component,
struct snd_pcm_substream *substream, int cmd)
{ … }
static irqreturn_t kmb_i2s_irq_handler(int irq, void *dev_id)
{ … }
static int kmb_platform_pcm_new(struct snd_soc_component *component,
struct snd_soc_pcm_runtime *soc_runtime)
{ … }
static snd_pcm_uframes_t kmb_pcm_pointer(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ … }
static const struct snd_soc_component_driver kmb_component = …;
static const struct snd_soc_component_driver kmb_component_dma = …;
static int kmb_probe(struct snd_soc_dai *cpu_dai)
{ … }
static inline void kmb_i2s_enable_dma(struct kmb_i2s_info *kmb_i2s, u32 stream)
{ … }
static inline void kmb_i2s_disable_dma(struct kmb_i2s_info *kmb_i2s, u32 stream)
{ … }
static void kmb_i2s_start(struct kmb_i2s_info *kmb_i2s,
struct snd_pcm_substream *substream)
{ … }
static void kmb_i2s_stop(struct kmb_i2s_info *kmb_i2s,
struct snd_pcm_substream *substream)
{ … }
static void kmb_disable_clk(void *clk)
{ … }
static int kmb_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
{ … }
static int kmb_dai_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *cpu_dai)
{ … }
static void kmb_i2s_config(struct kmb_i2s_info *kmb_i2s, int stream)
{ … }
static int kmb_dai_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params,
struct snd_soc_dai *cpu_dai)
{ … }
static int kmb_dai_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai)
{ … }
static int kmb_dai_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai)
{ … }
static int kmb_dai_hw_free(struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai)
{ … }
static const struct snd_soc_dai_ops kmb_dai_ops = …;
static struct snd_soc_dai_driver intel_kmb_hdmi_dai[] = …;
static struct snd_soc_dai_driver intel_kmb_i2s_dai[] = …;
static struct snd_soc_dai_driver intel_kmb_tdm_dai[] = …;
static const struct of_device_id kmb_plat_of_match[] = …;
MODULE_DEVICE_TABLE(of, kmb_plat_of_match);
static int kmb_plat_dai_probe(struct platform_device *pdev)
{ … }
static struct platform_driver kmb_plat_dai_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;