#include <linux/bitmap.h>
#include <linux/device.h>
#include <linux/dmi.h>
#include <linux/module.h>
#include <linux/soundwire/sdw.h>
#include <linux/soundwire/sdw_type.h>
#include <sound/soc.h>
#include <sound/soc-acpi.h>
#include "sof_sdw_common.h"
#include "../../codecs/rt711.h"
unsigned long sof_sdw_quirk = …;
static int quirk_override = …;
module_param_named(quirk, quirk_override, int, 0444);
MODULE_PARM_DESC(…) …;
static void log_quirks(struct device *dev)
{ … }
static int sof_sdw_quirk_cb(const struct dmi_system_id *id)
{ … }
static const struct dmi_system_id sof_sdw_quirk_table[] = …;
static struct snd_soc_dai_link_component platform_component[] = …;
static const struct snd_soc_dapm_widget generic_dmic_widgets[] = …;
static const struct snd_soc_dapm_widget generic_jack_widgets[] = …;
static const struct snd_kcontrol_new generic_jack_controls[] = …;
static const struct snd_soc_dapm_widget generic_spk_widgets[] = …;
static const struct snd_kcontrol_new generic_spk_controls[] = …;
static const struct snd_soc_dapm_widget maxim_widgets[] = …;
static const struct snd_kcontrol_new maxim_controls[] = …;
static const struct snd_soc_dapm_widget rt700_widgets[] = …;
static const struct snd_kcontrol_new rt700_controls[] = …;
int sdw_startup(struct snd_pcm_substream *substream)
{ … }
int sdw_prepare(struct snd_pcm_substream *substream)
{ … }
int sdw_trigger(struct snd_pcm_substream *substream, int cmd)
{ … }
int sdw_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{ … }
int sdw_hw_free(struct snd_pcm_substream *substream)
{ … }
void sdw_shutdown(struct snd_pcm_substream *substream)
{ … }
static const struct snd_soc_ops sdw_ops = …;
static struct sof_sdw_codec_info codec_info_list[] = …;
static struct sof_sdw_codec_info *find_codec_info_part(const u64 adr)
{ … }
static struct sof_sdw_codec_info *find_codec_info_acpi(const u8 *acpi_id)
{ … }
static struct sof_sdw_codec_info *find_codec_info_dai(const char *dai_name,
int *dai_index)
{ … }
static void init_dai_link(struct device *dev, struct snd_soc_dai_link *dai_links,
int *be_id, char *name, int playback, int capture,
struct snd_soc_dai_link_component *cpus, int cpus_num,
struct snd_soc_dai_link_component *codecs, int codecs_num,
int (*init)(struct snd_soc_pcm_runtime *rtd),
const struct snd_soc_ops *ops)
{ … }
static int init_simple_dai_link(struct device *dev, struct snd_soc_dai_link *dai_links,
int *be_id, char *name, int playback, int capture,
const char *cpu_dai_name,
const char *codec_name, const char *codec_dai_name,
int (*init)(struct snd_soc_pcm_runtime *rtd),
const struct snd_soc_ops *ops)
{ … }
static bool is_unique_device(const struct snd_soc_acpi_link_adr *adr_link,
unsigned int sdw_version,
unsigned int mfg_id,
unsigned int part_id,
unsigned int class_id,
int index_in_link)
{ … }
static const char *get_codec_name(struct device *dev,
const struct sof_sdw_codec_info *codec_info,
const struct snd_soc_acpi_link_adr *adr_link,
int adr_index)
{ … }
static int sof_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd)
{ … }
struct sof_sdw_endpoint { … };
struct sof_sdw_dailink { … };
static const char * const type_strings[] = …;
static int count_sdw_endpoints(struct snd_soc_card *card, int *num_devs, int *num_ends)
{ … }
static struct sof_sdw_dailink *find_dailink(struct sof_sdw_dailink *dailinks,
const struct snd_soc_acpi_endpoint *new)
{ … }
static int parse_sdw_endpoints(struct snd_soc_card *card,
struct sof_sdw_dailink *sof_dais,
struct sof_sdw_endpoint *sof_ends,
int *num_devs)
{ … }
static int create_sdw_dailink(struct snd_soc_card *card,
struct sof_sdw_dailink *sof_dai,
struct snd_soc_dai_link **dai_links,
int *be_id, struct snd_soc_codec_conf **codec_conf)
{ … }
static int create_sdw_dailinks(struct snd_soc_card *card,
struct snd_soc_dai_link **dai_links, int *be_id,
struct sof_sdw_dailink *sof_dais,
struct snd_soc_codec_conf **codec_conf)
{ … }
static int create_ssp_dailinks(struct snd_soc_card *card,
struct snd_soc_dai_link **dai_links, int *be_id,
struct sof_sdw_codec_info *ssp_info,
unsigned long ssp_mask)
{ … }
static int create_dmic_dailinks(struct snd_soc_card *card,
struct snd_soc_dai_link **dai_links, int *be_id)
{ … }
static int create_hdmi_dailinks(struct snd_soc_card *card,
struct snd_soc_dai_link **dai_links, int *be_id,
int hdmi_num)
{ … }
static int create_bt_dailinks(struct snd_soc_card *card,
struct snd_soc_dai_link **dai_links, int *be_id)
{ … }
static int sof_card_dai_links_create(struct snd_soc_card *card)
{ … }
static int sof_sdw_card_late_probe(struct snd_soc_card *card)
{ … }
static struct snd_soc_dai_link *mc_find_codec_dai_used(struct snd_soc_card *card,
const char *dai_name)
{ … }
static void mc_dailink_exit_loop(struct snd_soc_card *card)
{ … }
static int mc_probe(struct platform_device *pdev)
{ … }
static void mc_remove(struct platform_device *pdev)
{ … }
static const struct platform_device_id mc_id_table[] = …;
MODULE_DEVICE_TABLE(platform, mc_id_table);
static struct platform_driver sof_sdw_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_IMPORT_NS(…);