summaryrefslogtreecommitdiffstats
path: root/meta-ivi-common
ModeNameSize
d---------classes36logstatsplain
d---------conf38logstatsplain
d---------recipes-connectivity36logstatsplain
d---------recipes-core / packagegroups40logstatsplain
d---------recipes-devtools36logstatsplain
d---------recipes-extended73logstatsplain
d---------recipes-graphics70logstatsplain
d---------recipes-multimedia76logstatsplain
d---------recipes-support36logstatsplain
d---------recipes-test596logstatsplain
eted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
// SPDX-License-Identifier: GPL-2.0
/*
 * AVIRT - ALSA Virtual Soundcard
 *
 * Copyright (c) 2010-2018 Fiberdyne Systems Pty Ltd
 * 
 * avirt.h - AVIRT system-level header
 */

#ifndef __SOUND_AVIRT_H
#define __SOUND_AVIRT_H

#include <sound/core.h>
#include <sound/pcm.h>
#include <linux/configfs.h>

#define MAX_STREAMS 16
#define MAX_NAME_LEN 80

#define DINFO(logname, fmt, args...)                                           \
	snd_printk(KERN_INFO "AVIRT: %s: " fmt "\n", logname, ##args)

#define DERROR(logname, fmt, args...)                                          \
	snd_printk(KERN_ERR "AVIRT: %s: " fmt "\n", logname, ##args)

#define DDEBUG(logname, fmt, args...)                                          \
	snd_printk(KERN_DEBUG "AVIRT: %s: " fmt "\n", logname, ##args)

struct snd_avirt_stream_array; /* Forward declaration */

/**
 * AVIRT Audio Path configure function type
 * Each Audio Path registers this at snd_avirt_audiopath_register time.
 * It is then called by the core once AVIRT has been configured
 */
typedef int (*snd_avirt_audiopath_configure)(
	struct snd_card *card, struct snd_avirt_stream_array *stream_array);

/**
 * AVIRT Audio Path info
 */
struct snd_avirt_audiopath {
	const char *uid; /* Unique identifier */
	const char *name; /* Pretty name */
	unsigned int version[3]; /* Version - Major.Minor.Ext */
	const struct snd_pcm_hardware *hw; /* ALSA PCM HW conf */
	const struct snd_pcm_ops *pcm_playback_ops; /* ALSA PCM playback ops */
	const struct snd_pcm_ops *pcm_capture_ops; /* ALSA PCM capture ops */
	snd_avirt_audiopath_configure configure; /* Config callback function */

	void *context;
};

/**
 * Audio stream configuration
 */
struct snd_avirt_stream {
	char name[MAX_NAME_LEN]; /* Stream name */
	char map[MAX_NAME_LEN]; /* Stream Audio Path mapping */
	unsigned int channels; /* Stream channel count */
	unsigned int device; /* Stream PCM device no. */
	unsigned int direction; /* Stream direction */
	struct snd_pcm *pcm; /* ALSA PCM  */
	struct snd_pcm_ops *pcm_ops; /* ALSA PCM ops */
	struct config_item item; /* configfs item reference */
};

/**
 * Private Data Expansion
 */
struct snd_avirt_private_data {
	struct snd_avirt_audiopath *audiopath;
	void *ap_private_data;

	void (*ap_private_free)(struct snd_pcm *pcm);
};

/**
 * Audio stream group
 */
struct snd_avirt_stream_array {
	struct snd_avirt_stream *streams[MAX_STREAMS];
	int count;
};

/**
 * snd_avirt_audiopath_register - register Audio Path with AVIRT
 * @audiopath: Audio Path to be registered
 * @return: 0 on success or error code otherwise
 */
int snd_avirt_audiopath_register(struct snd_avirt_audiopath *audiopath);

/**
 * snd_avirt_audiopath_deregister - deregister Audio Path with AVIRT
 * @audiopath: Audio Path to be deregistered
 * @return: 0 on success or error code otherwise
 */
int snd_avirt_audiopath_deregister(struct snd_avirt_audiopath *audiopath);

/**
 * snd_avirt_audiopath_get - get Audio Path by it's UID
 * @uid: The Audio Path UID to get
 * @return: The Audio Path if it exists, NULL otherwise.
 */
struct snd_avirt_audiopath *snd_avirt_audiopath_get(const char *uid);

/**
 * snd_avirt_pcm_period_elapsed - PCM buffer complete callback
 * @substream: pointer to ALSA PCM substream
 *
 * This should be called from a child Audio Path once it has finished processing
 * the PCM buffer
 */
void snd_avirt_pcm_period_elapsed(struct snd_pcm_substream *substream);

#endif // __SOUND_AVIRT_H