#include <linux/pm_runtime.h>
#include <sound/soc.h>
#include <sound/pcm_params.h>
#include <uapi/sound/tlv.h>
#include "core.h"
#include "messages.h"
struct catpt_stream_template { … };
static struct catpt_stream_template system_pb = …;
static struct catpt_stream_template system_cp = …;
static struct catpt_stream_template offload_pb = …;
static struct catpt_stream_template loopback_cp = …;
static struct catpt_stream_template bluetooth_pb = …;
static struct catpt_stream_template bluetooth_cp = …;
static struct catpt_stream_template *catpt_topology[] = …;
static struct catpt_stream_template *
catpt_get_stream_template(struct snd_pcm_substream *substream)
{ … }
struct catpt_stream_runtime *
catpt_stream_find(struct catpt_dev *cdev, u8 stream_hw_id)
{ … }
static u32 catpt_stream_read_position(struct catpt_dev *cdev,
struct catpt_stream_runtime *stream)
{ … }
static u32 catpt_stream_volume(struct catpt_dev *cdev,
struct catpt_stream_runtime *stream, u32 channel)
{ … }
static u32 catpt_mixer_volume(struct catpt_dev *cdev,
struct catpt_mixer_stream_info *info, u32 channel)
{ … }
static void catpt_arrange_page_table(struct snd_pcm_substream *substream,
struct snd_dma_buffer *pgtbl)
{ … }
static u32 catpt_get_channel_map(enum catpt_channel_config config)
{ … }
static enum catpt_channel_config catpt_get_channel_config(u32 num_channels)
{ … }
static int catpt_dai_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static void catpt_dai_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int catpt_set_dspvol(struct catpt_dev *cdev, u8 stream_id, long *ctlvol);
static int catpt_dai_apply_usettings(struct snd_soc_dai *dai,
struct catpt_stream_runtime *stream)
{ … }
static int catpt_dai_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int catpt_dai_hw_free(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int catpt_dai_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int catpt_dai_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *dai)
{ … }
void catpt_stream_update_position(struct catpt_dev *cdev,
struct catpt_stream_runtime *stream,
struct catpt_notify_position *pos)
{ … }
#define CATPT_BUFFER_MAX_SIZE …
#define CATPT_PCM_PERIODS_MAX …
#define CATPT_PCM_PERIODS_MIN …
static const struct snd_pcm_hardware catpt_pcm_hardware = …;
static int catpt_component_pcm_construct(struct snd_soc_component *component,
struct snd_soc_pcm_runtime *rtm)
{ … }
static int catpt_component_open(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ … }
static snd_pcm_uframes_t
catpt_component_pointer(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ … }
static const struct snd_soc_dai_ops catpt_fe_dai_ops = …;
static int catpt_dai_pcm_new(struct snd_soc_pcm_runtime *rtm,
struct snd_soc_dai *dai)
{ … }
static const struct snd_soc_dai_ops catpt_dai_ops = …;
static struct snd_soc_dai_driver dai_drivers[] = …;
#define DSP_VOLUME_MAX …
#define DSP_VOLUME_STEP_MAX …
static u32 ctlvol_to_dspvol(u32 value)
{ … }
static u32 dspvol_to_ctlvol(u32 volume)
{ … }
static int catpt_set_dspvol(struct catpt_dev *cdev, u8 stream_id, long *ctlvol)
{ … }
static int catpt_volume_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int catpt_mixer_volume_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int catpt_mixer_volume_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int catpt_stream_volume_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol,
enum catpt_pin_id pin_id)
{ … }
static int catpt_stream_volume_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol,
enum catpt_pin_id pin_id)
{ … }
static int catpt_offload1_volume_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *uctl)
{ … }
static int catpt_offload1_volume_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *uctl)
{ … }
static int catpt_offload2_volume_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *uctl)
{ … }
static int catpt_offload2_volume_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *uctl)
{ … }
static int catpt_capture_volume_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *uctl)
{ … }
static int catpt_capture_volume_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *uctl)
{ … }
static int catpt_loopback_switch_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int catpt_loopback_switch_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int catpt_waves_switch_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int catpt_waves_switch_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int catpt_waves_param_get(struct snd_kcontrol *kcontrol,
unsigned int __user *bytes,
unsigned int size)
{ … }
static int catpt_waves_param_put(struct snd_kcontrol *kcontrol,
const unsigned int __user *bytes,
unsigned int size)
{ … }
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(catpt_volume_tlv, -9000, 300, 1);
#define CATPT_VOLUME_CTL(kname, sname) …
static const struct snd_kcontrol_new component_kcontrols[] = …;
static const struct snd_soc_dapm_widget component_widgets[] = …;
static const struct snd_soc_dapm_route component_routes[] = …;
static const struct snd_soc_component_driver catpt_comp_driver = …;
int catpt_arm_stream_templates(struct catpt_dev *cdev)
{ … }
int catpt_register_plat_component(struct catpt_dev *cdev)
{ … }