linux/sound/soc/codecs/cros_ec_codec.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright 2019 Google, Inc.
 *
 * ChromeOS Embedded Controller codec driver.
 *
 * This driver uses the cros-ec interface to communicate with the ChromeOS
 * EC for audio function.
 */

#include <crypto/sha2.h>
#include <linux/acpi.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/platform_data/cros_ec_commands.h>
#include <linux/platform_data/cros_ec_proto.h>
#include <linux/platform_device.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/tlv.h>

struct cros_ec_codec_priv {};

static int ec_codec_capable(struct cros_ec_codec_priv *priv, uint8_t cap)
{}

static int send_ec_host_command(struct cros_ec_device *ec_dev, uint32_t cmd,
				uint8_t *out, size_t outsize,
				uint8_t *in, size_t insize)
{}

static int dmic_get_gain(struct snd_kcontrol *kcontrol,
			 struct snd_ctl_elem_value *ucontrol)
{}

static int dmic_put_gain(struct snd_kcontrol *kcontrol,
			 struct snd_ctl_elem_value *ucontrol)
{}

static const DECLARE_TLV_DB_SCALE(dmic_gain_tlv, 0, 100, 0);

enum {};

static struct snd_kcontrol_new dmic_controls[] =;

static int dmic_probe(struct snd_soc_component *component)
{}

static int i2s_rx_hw_params(struct snd_pcm_substream *substream,
			    struct snd_pcm_hw_params *params,
			    struct snd_soc_dai *dai)
{}

static int i2s_rx_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio)
{}

static int i2s_rx_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{}

static const struct snd_soc_dai_ops i2s_rx_dai_ops =;

static int i2s_rx_event(struct snd_soc_dapm_widget *w,
			struct snd_kcontrol *kcontrol, int event)
{}

static struct snd_soc_dapm_widget i2s_rx_dapm_widgets[] =;

static struct snd_soc_dapm_route i2s_rx_dapm_routes[] =;

static struct snd_soc_dai_driver i2s_rx_dai_driver =;

static int i2s_rx_probe(struct snd_soc_component *component)
{}

static const struct snd_soc_component_driver i2s_rx_component_driver =;

static void *wov_map_shm(struct cros_ec_codec_priv *priv,
			 uint8_t shm_id, uint32_t *len, uint8_t *type)
{}

static bool wov_queue_full(struct cros_ec_codec_priv *priv)
{}

static size_t wov_queue_size(struct cros_ec_codec_priv *priv)
{}

static void wov_queue_dequeue(struct cros_ec_codec_priv *priv, size_t len)
{}

static void wov_queue_try_dequeue(struct cros_ec_codec_priv *priv)
{}

static void wov_queue_enqueue(struct cros_ec_codec_priv *priv,
			      uint8_t *addr, size_t len, bool iomem)
{}

static int wov_read_audio_shm(struct cros_ec_codec_priv *priv)
{}

static int wov_read_audio(struct cros_ec_codec_priv *priv)
{}

static void wov_copy_work(struct work_struct *w)
{}

static int wov_enable_get(struct snd_kcontrol *kcontrol,
			  struct snd_ctl_elem_value *ucontrol)
{}

static int wov_enable_put(struct snd_kcontrol *kcontrol,
			  struct snd_ctl_elem_value *ucontrol)
{}

static int wov_set_lang_shm(struct cros_ec_codec_priv *priv,
			    uint8_t *buf, size_t size, uint8_t *digest)
{}

static int wov_set_lang(struct cros_ec_codec_priv *priv,
			uint8_t *buf, size_t size, uint8_t *digest)
{}

static int wov_hotword_model_put(struct snd_kcontrol *kcontrol,
				 const unsigned int __user *bytes,
				 unsigned int size)
{}

static struct snd_kcontrol_new wov_controls[] =;

static struct snd_soc_dai_driver wov_dai_driver =;

static int wov_host_event(struct notifier_block *nb,
			  unsigned long queued_during_suspend, void *notify)
{}

static int wov_probe(struct snd_soc_component *component)
{}

static void wov_remove(struct snd_soc_component *component)
{}

static int wov_pcm_open(struct snd_soc_component *component,
			struct snd_pcm_substream *substream)
{}

static int wov_pcm_hw_params(struct snd_soc_component *component,
			     struct snd_pcm_substream *substream,
			     struct snd_pcm_hw_params *hw_params)
{}

static int wov_pcm_hw_free(struct snd_soc_component *component,
			   struct snd_pcm_substream *substream)
{}

static snd_pcm_uframes_t wov_pcm_pointer(struct snd_soc_component *component,
					 struct snd_pcm_substream *substream)
{}

static int wov_pcm_new(struct snd_soc_component *component,
		       struct snd_soc_pcm_runtime *rtd)
{}

static const struct snd_soc_component_driver wov_component_driver =;

static int cros_ec_codec_platform_probe(struct platform_device *pdev)
{}

#ifdef CONFIG_OF
static const struct of_device_id cros_ec_codec_of_match[] =;
MODULE_DEVICE_TABLE(of, cros_ec_codec_of_match);
#endif

#ifdef CONFIG_ACPI
static const struct acpi_device_id cros_ec_codec_acpi_id[] =;
MODULE_DEVICE_TABLE(acpi, cros_ec_codec_acpi_id);
#endif

static struct platform_driver cros_ec_codec_platform_driver =;

module_platform_driver();

MODULE_LICENSE();
MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_ALIAS();