#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/acpi.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
#include <linux/mutex.h>
#include <linux/soundwire/sdw.h>
#include <linux/soundwire/sdw_type.h>
#include <linux/soundwire/sdw_registers.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/jack.h>
#include <sound/sdw.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include "rt5682.h"
#define RT5682_SDW_ADDR_L …
#define RT5682_SDW_ADDR_H …
#define RT5682_SDW_DATA_L …
#define RT5682_SDW_DATA_H …
#define RT5682_SDW_CMD …
static int rt5682_sdw_read(void *context, unsigned int reg, unsigned int *val)
{ … }
static int rt5682_sdw_write(void *context, unsigned int reg, unsigned int val)
{ … }
static const struct regmap_config rt5682_sdw_indirect_regmap = …;
static int rt5682_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
int direction)
{ … }
static void rt5682_sdw_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int rt5682_sdw_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int rt5682_sdw_hw_free(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static const struct snd_soc_dai_ops rt5682_sdw_ops = …;
static struct snd_soc_dai_driver rt5682_dai[] = …;
static int rt5682_sdw_init(struct device *dev, struct regmap *regmap,
struct sdw_slave *slave)
{ … }
static int rt5682_io_init(struct device *dev, struct sdw_slave *slave)
{ … }
static bool rt5682_sdw_readable_register(struct device *dev, unsigned int reg)
{ … }
static const struct regmap_config rt5682_sdw_regmap = …;
static int rt5682_update_status(struct sdw_slave *slave,
enum sdw_slave_status status)
{ … }
static int rt5682_read_prop(struct sdw_slave *slave)
{ … }
#define RT5682_CLK_FREQ_9600000HZ …
#define RT5682_CLK_FREQ_12000000HZ …
#define RT5682_CLK_FREQ_6000000HZ …
#define RT5682_CLK_FREQ_4800000HZ …
#define RT5682_CLK_FREQ_2400000HZ …
#define RT5682_CLK_FREQ_12288000HZ …
static int rt5682_clock_config(struct device *dev)
{ … }
static int rt5682_bus_config(struct sdw_slave *slave,
struct sdw_bus_params *params)
{ … }
static int rt5682_interrupt_callback(struct sdw_slave *slave,
struct sdw_slave_intr_status *status)
{ … }
static const struct sdw_slave_ops rt5682_slave_ops = …;
static int rt5682_sdw_probe(struct sdw_slave *slave,
const struct sdw_device_id *id)
{ … }
static int rt5682_sdw_remove(struct sdw_slave *slave)
{ … }
static const struct sdw_device_id rt5682_id[] = …;
MODULE_DEVICE_TABLE(sdw, rt5682_id);
static int __maybe_unused rt5682_dev_suspend(struct device *dev)
{ … }
static int __maybe_unused rt5682_dev_system_suspend(struct device *dev)
{ … }
static int __maybe_unused rt5682_dev_resume(struct device *dev)
{ … }
static const struct dev_pm_ops rt5682_pm = …;
static struct sdw_driver rt5682_sdw_driver = …;
module_sdw_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;