#include <linux/module.h>
#include <linux/input.h>
#include <linux/spi/spi.h>
#include <linux/device.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/uaccess.h>
#include <linux/regulator/consumer.h>
#include <linux/pm_qos.h>
#include <linux/sysfs.h>
#include <linux/clk.h>
#include <linux/firmware.h>
#include <linux/acpi.h>
#include <sound/soc.h>
#include "rt5677.h"
#include "rt5677-spi.h"
#define DRV_NAME …
#define RT5677_SPI_BURST_LEN …
#define RT5677_SPI_HEADER …
#define RT5677_SPI_FREQ …
#define RT5677_SPI_WRITE_BURST …
#define RT5677_SPI_READ_BURST …
#define RT5677_SPI_WRITE_32 …
#define RT5677_SPI_READ_32 …
#define RT5677_SPI_WRITE_16 …
#define RT5677_SPI_READ_16 …
#define RT5677_BUF_BYTES_TOTAL …
#define RT5677_MIC_BUF_ADDR …
#define RT5677_MODEL_ADDR …
#define RT5677_MIC_BUF_BYTES …
#define RT5677_MIC_BUF_FIRST_READ_SIZE …
static struct spi_device *g_spi;
static DEFINE_MUTEX(spi_mutex);
struct rt5677_dsp { … };
static const struct snd_pcm_hardware rt5677_spi_pcm_hardware = …;
static struct snd_soc_dai_driver rt5677_spi_dai = …;
static int rt5677_spi_pcm_open(
struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ … }
static int rt5677_spi_pcm_close(
struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ … }
static int rt5677_spi_hw_params(
struct snd_soc_component *component,
struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{ … }
static int rt5677_spi_hw_free(
struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ … }
static int rt5677_spi_prepare(
struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ … }
static snd_pcm_uframes_t rt5677_spi_pcm_pointer(
struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ … }
static int rt5677_spi_mic_write_offset(u32 *mic_write_offset)
{ … }
static int rt5677_spi_copy_block(struct rt5677_dsp *rt5677_dsp,
u32 begin, u32 end)
{ … }
static int rt5677_spi_copy(struct rt5677_dsp *rt5677_dsp, u32 amount)
{ … }
static void rt5677_spi_copy_work(struct work_struct *work)
{ … }
static int rt5677_spi_pcm_new(struct snd_soc_component *component,
struct snd_soc_pcm_runtime *rtd)
{ … }
static int rt5677_spi_pcm_probe(struct snd_soc_component *component)
{ … }
static const struct snd_soc_component_driver rt5677_spi_dai_component = …;
static u8 rt5677_spi_select_cmd(bool read, u32 align, u32 remain, u32 *len)
{ … }
static void rt5677_spi_reverse(u8 *dst, u32 dstlen, const u8 *src, u32 srclen)
{ … }
int rt5677_spi_read(u32 addr, void *rxbuf, size_t len)
{ … }
EXPORT_SYMBOL_GPL(…);
int rt5677_spi_write(u32 addr, const void *txbuf, size_t len)
{ … }
EXPORT_SYMBOL_GPL(…);
int rt5677_spi_write_firmware(u32 addr, const struct firmware *fw)
{ … }
EXPORT_SYMBOL_GPL(…);
void rt5677_spi_hotword_detected(void)
{ … }
EXPORT_SYMBOL_GPL(…);
static int rt5677_spi_probe(struct spi_device *spi)
{ … }
#ifdef CONFIG_ACPI
static const struct acpi_device_id rt5677_spi_acpi_id[] = …;
MODULE_DEVICE_TABLE(acpi, rt5677_spi_acpi_id);
#endif
static struct spi_driver rt5677_spi_driver = …;
module_spi_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;