Blame include/sound/asoc.h

Packit 4a16fb
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
Packit 4a16fb
/*
Packit 4a16fb
 * uapi/sound/asoc.h -- ALSA SoC Firmware Controls and DAPM
Packit 4a16fb
 *
Packit 4a16fb
 * Copyright (C) 2012 Texas Instruments Inc.
Packit 4a16fb
 * Copyright (C) 2015 Intel Corporation.
Packit 4a16fb
 *
Packit 4a16fb
 * This program is free software; you can redistribute it and/or modify
Packit 4a16fb
 * it under the terms of the GNU General Public License version 2 as
Packit 4a16fb
 * published by the Free Software Foundation.
Packit 4a16fb
 *
Packit 4a16fb
 * Simple file API to load FW that includes mixers, coefficients, DAPM graphs,
Packit 4a16fb
 * algorithms, equalisers, DAIs, widgets etc.
Packit 4a16fb
*/
Packit 4a16fb
Packit 4a16fb
#ifndef __LINUX_UAPI_SND_ASOC_H
Packit 4a16fb
#define __LINUX_UAPI_SND_ASOC_H
Packit 4a16fb
Packit 4a16fb
#include <linux/types.h>
Packit 4a16fb
#include <sound/asound.h>
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Maximum number of channels topology kcontrol can represent.
Packit 4a16fb
 */
Packit 4a16fb
#define SND_SOC_TPLG_MAX_CHAN		8
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Maximum number of PCM formats capability
Packit 4a16fb
 */
Packit 4a16fb
#define SND_SOC_TPLG_MAX_FORMATS	16
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Maximum number of PCM stream configs
Packit 4a16fb
 */
Packit 4a16fb
#define SND_SOC_TPLG_STREAM_CONFIG_MAX  8
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Maximum number of physical link's hardware configs
Packit 4a16fb
 */
Packit 4a16fb
#define SND_SOC_TPLG_HW_CONFIG_MAX	8
Packit 4a16fb
Packit 4a16fb
/* individual kcontrol info types - can be mixed with other types */
Packit 4a16fb
#define SND_SOC_TPLG_CTL_VOLSW		1
Packit 4a16fb
#define SND_SOC_TPLG_CTL_VOLSW_SX	2
Packit 4a16fb
#define SND_SOC_TPLG_CTL_VOLSW_XR_SX	3
Packit 4a16fb
#define SND_SOC_TPLG_CTL_ENUM		4
Packit 4a16fb
#define SND_SOC_TPLG_CTL_BYTES		5
Packit 4a16fb
#define SND_SOC_TPLG_CTL_ENUM_VALUE	6
Packit 4a16fb
#define SND_SOC_TPLG_CTL_RANGE		7
Packit 4a16fb
#define SND_SOC_TPLG_CTL_STROBE		8
Packit 4a16fb
Packit 4a16fb
Packit 4a16fb
/* individual widget kcontrol info types - can be mixed with other types */
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_CTL_VOLSW		64
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_CTL_ENUM_DOUBLE	65
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_CTL_ENUM_VIRT		66
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_CTL_ENUM_VALUE	67
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_CTL_PIN		68
Packit 4a16fb
Packit 4a16fb
/* DAPM widget types - add new items to the end */
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_INPUT		0
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_OUTPUT	1
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_MUX		2
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_MIXER		3
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_PGA		4
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_OUT_DRV	5
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_ADC		6
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_DAC		7
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_SWITCH	8
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_PRE		9
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_POST		10
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_AIF_IN	11
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_AIF_OUT	12
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_DAI_IN	13
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_DAI_OUT	14
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_DAI_LINK	15
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_BUFFER	16
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_SCHEDULER	17
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_EFFECT	18
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_SIGGEN	19
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_SRC		20
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_ASRC		21
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_ENCODER	22
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_DECODER	23
Packit 4a16fb
#define SND_SOC_TPLG_DAPM_LAST		SND_SOC_TPLG_DAPM_DECODER
Packit 4a16fb
Packit 4a16fb
/* Header magic number and string sizes */
Packit 4a16fb
#define SND_SOC_TPLG_MAGIC		0x41536F43 /* ASoC */
Packit 4a16fb
Packit 4a16fb
/* string sizes */
Packit 4a16fb
#define SND_SOC_TPLG_NUM_TEXTS		16
Packit 4a16fb
Packit 4a16fb
/* ABI version */
Packit 4a16fb
#define SND_SOC_TPLG_ABI_VERSION	0x5	/* current version */
Packit 4a16fb
#define SND_SOC_TPLG_ABI_VERSION_MIN	0x4	/* oldest version supported */
Packit 4a16fb
Packit 4a16fb
/* Max size of TLV data */
Packit 4a16fb
#define SND_SOC_TPLG_TLV_SIZE		32
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * File and Block header data types.
Packit 4a16fb
 * Add new generic and vendor types to end of list.
Packit 4a16fb
 * Generic types are handled by the core whilst vendors types are passed
Packit 4a16fb
 * to the component drivers for handling.
Packit 4a16fb
 */
Packit 4a16fb
#define SND_SOC_TPLG_TYPE_MIXER		1
Packit 4a16fb
#define SND_SOC_TPLG_TYPE_BYTES		2
Packit 4a16fb
#define SND_SOC_TPLG_TYPE_ENUM		3
Packit 4a16fb
#define SND_SOC_TPLG_TYPE_DAPM_GRAPH	4
Packit 4a16fb
#define SND_SOC_TPLG_TYPE_DAPM_WIDGET	5
Packit 4a16fb
#define SND_SOC_TPLG_TYPE_DAI_LINK	6
Packit 4a16fb
#define SND_SOC_TPLG_TYPE_PCM		7
Packit 4a16fb
#define SND_SOC_TPLG_TYPE_MANIFEST	8
Packit 4a16fb
#define SND_SOC_TPLG_TYPE_CODEC_LINK	9
Packit 4a16fb
#define SND_SOC_TPLG_TYPE_BACKEND_LINK	10
Packit 4a16fb
#define SND_SOC_TPLG_TYPE_PDATA		11
Packit 4a16fb
#define SND_SOC_TPLG_TYPE_DAI		12
Packit 4a16fb
#define SND_SOC_TPLG_TYPE_MAX		SND_SOC_TPLG_TYPE_DAI
Packit 4a16fb
Packit 4a16fb
/* vendor block IDs - please add new vendor types to end */
Packit 4a16fb
#define SND_SOC_TPLG_TYPE_VENDOR_FW	1000
Packit 4a16fb
#define SND_SOC_TPLG_TYPE_VENDOR_CONFIG	1001
Packit 4a16fb
#define SND_SOC_TPLG_TYPE_VENDOR_COEFF	1002
Packit 4a16fb
#define SND_SOC_TPLG_TYPEVENDOR_CODEC	1003
Packit 4a16fb
Packit 4a16fb
#define SND_SOC_TPLG_STREAM_PLAYBACK	0
Packit 4a16fb
#define SND_SOC_TPLG_STREAM_CAPTURE	1
Packit 4a16fb
Packit 4a16fb
/* vendor tuple types */
Packit 4a16fb
#define SND_SOC_TPLG_TUPLE_TYPE_UUID	0
Packit 4a16fb
#define SND_SOC_TPLG_TUPLE_TYPE_STRING	1
Packit 4a16fb
#define SND_SOC_TPLG_TUPLE_TYPE_BOOL	2
Packit 4a16fb
#define SND_SOC_TPLG_TUPLE_TYPE_BYTE	3
Packit 4a16fb
#define SND_SOC_TPLG_TUPLE_TYPE_WORD	4
Packit 4a16fb
#define SND_SOC_TPLG_TUPLE_TYPE_SHORT	5
Packit 4a16fb
Packit 4a16fb
/* DAI flags */
Packit 4a16fb
#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_RATES         (1 << 0)
Packit 4a16fb
#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_CHANNELS      (1 << 1)
Packit 4a16fb
#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS    (1 << 2)
Packit 4a16fb
Packit 4a16fb
/* DAI clock gating */
Packit 4a16fb
#define SND_SOC_TPLG_DAI_CLK_GATE_UNDEFINED	0
Packit 4a16fb
#define SND_SOC_TPLG_DAI_CLK_GATE_GATED	1
Packit 4a16fb
#define SND_SOC_TPLG_DAI_CLK_GATE_CONT		2
Packit 4a16fb
Packit 4a16fb
/* DAI mclk_direction */
Packit 4a16fb
#define SND_SOC_TPLG_MCLK_CO            0 /* for codec, mclk is output */
Packit 4a16fb
#define SND_SOC_TPLG_MCLK_CI            1 /* for codec, mclk is input */
Packit 4a16fb
Packit 4a16fb
/* DAI physical PCM data formats.
Packit 4a16fb
 * Add new formats to the end of the list.
Packit 4a16fb
 */
Packit 4a16fb
#define SND_SOC_DAI_FORMAT_I2S          1 /* I2S mode */
Packit 4a16fb
#define SND_SOC_DAI_FORMAT_RIGHT_J      2 /* Right Justified mode */
Packit 4a16fb
#define SND_SOC_DAI_FORMAT_LEFT_J       3 /* Left Justified mode */
Packit 4a16fb
#define SND_SOC_DAI_FORMAT_DSP_A        4 /* L data MSB after FRM LRC */
Packit 4a16fb
#define SND_SOC_DAI_FORMAT_DSP_B        5 /* L data MSB during FRM LRC */
Packit 4a16fb
#define SND_SOC_DAI_FORMAT_AC97         6 /* AC97 */
Packit 4a16fb
#define SND_SOC_DAI_FORMAT_PDM          7 /* Pulse density modulation */
Packit 4a16fb
Packit 4a16fb
/* left and right justified also known as MSB and LSB respectively */
Packit 4a16fb
#define SND_SOC_DAI_FORMAT_MSB          SND_SOC_DAI_FORMAT_LEFT_J
Packit 4a16fb
#define SND_SOC_DAI_FORMAT_LSB          SND_SOC_DAI_FORMAT_RIGHT_J
Packit 4a16fb
Packit 4a16fb
/* DAI link flags */
Packit 4a16fb
#define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_RATES         (1 << 0)
Packit 4a16fb
#define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_CHANNELS      (1 << 1)
Packit 4a16fb
#define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_SAMPLEBITS    (1 << 2)
Packit 4a16fb
#define SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP            (1 << 3)
Packit 4a16fb
Packit 4a16fb
/* DAI topology BCLK parameter
Packit 4a16fb
 * For the backwards capability, by default codec is bclk master
Packit 4a16fb
 */
Packit 4a16fb
#define SND_SOC_TPLG_BCLK_CM         0 /* codec is bclk master */
Packit 4a16fb
#define SND_SOC_TPLG_BCLK_CS         1 /* codec is bclk slave */
Packit 4a16fb
Packit 4a16fb
/* DAI topology FSYNC parameter
Packit 4a16fb
 * For the backwards capability, by default codec is fsync master
Packit 4a16fb
 */
Packit 4a16fb
#define SND_SOC_TPLG_FSYNC_CM         0 /* codec is fsync master */
Packit 4a16fb
#define SND_SOC_TPLG_FSYNC_CS         1 /* codec is fsync slave */
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Block Header.
Packit 4a16fb
 * This header precedes all object and object arrays below.
Packit 4a16fb
 */
Packit 4a16fb
struct snd_soc_tplg_hdr {
Packit 4a16fb
	__le32 magic;		/* magic number */
Packit 4a16fb
	__le32 abi;		/* ABI version */
Packit 4a16fb
	__le32 version;		/* optional vendor specific version details */
Packit 4a16fb
	__le32 type;		/* SND_SOC_TPLG_TYPE_ */
Packit 4a16fb
	__le32 size;		/* size of this structure */
Packit 4a16fb
	__le32 vendor_type;	/* optional vendor specific type info */
Packit 4a16fb
	__le32 payload_size;	/* data bytes, excluding this header */
Packit 4a16fb
	__le32 index;		/* identifier for block */
Packit 4a16fb
	__le32 count;		/* number of elements in block */
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
/* vendor tuple for uuid */
Packit 4a16fb
struct snd_soc_tplg_vendor_uuid_elem {
Packit 4a16fb
	__le32 token;
Packit 4a16fb
	char uuid[16];
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
/* vendor tuple for a bool/byte/short/word value */
Packit 4a16fb
struct snd_soc_tplg_vendor_value_elem {
Packit 4a16fb
	__le32 token;
Packit 4a16fb
	__le32 value;
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
/* vendor tuple for string */
Packit 4a16fb
struct snd_soc_tplg_vendor_string_elem {
Packit 4a16fb
	__le32 token;
Packit 4a16fb
	char string[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
struct snd_soc_tplg_vendor_array {
Packit 4a16fb
	__le32 size;	/* size in bytes of the array, including all elements */
Packit 4a16fb
	__le32 type;	/* SND_SOC_TPLG_TUPLE_TYPE_ */
Packit 4a16fb
	__le32 num_elems;	/* number of elements in array */
Packit 4a16fb
	union {
Packit 4a16fb
		struct snd_soc_tplg_vendor_uuid_elem uuid[0];
Packit 4a16fb
		struct snd_soc_tplg_vendor_value_elem value[0];
Packit 4a16fb
		struct snd_soc_tplg_vendor_string_elem string[0];
Packit 4a16fb
	};
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Private data.
Packit 4a16fb
 * All topology objects may have private data that can be used by the driver or
Packit 4a16fb
 * firmware. Core will ignore this data.
Packit 4a16fb
 */
Packit 4a16fb
struct snd_soc_tplg_private {
Packit 4a16fb
	__le32 size;	/* in bytes of private data */
Packit 4a16fb
	union {
Packit 4a16fb
		char data[0];
Packit 4a16fb
		struct snd_soc_tplg_vendor_array array[0];
Packit 4a16fb
	};
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Kcontrol TLV data.
Packit 4a16fb
 */
Packit 4a16fb
struct snd_soc_tplg_tlv_dbscale {
Packit 4a16fb
	__le32 min;
Packit 4a16fb
	__le32 step;
Packit 4a16fb
	__le32 mute;
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
struct snd_soc_tplg_ctl_tlv {
Packit 4a16fb
	__le32 size;	/* in bytes of this structure */
Packit 4a16fb
	__le32 type;	/* SNDRV_CTL_TLVT_*, type of TLV */
Packit 4a16fb
	union {
Packit 4a16fb
		__le32 data[SND_SOC_TPLG_TLV_SIZE];
Packit 4a16fb
		struct snd_soc_tplg_tlv_dbscale scale;
Packit 4a16fb
	};
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Kcontrol channel data
Packit 4a16fb
 */
Packit 4a16fb
struct snd_soc_tplg_channel {
Packit 4a16fb
	__le32 size;	/* in bytes of this structure */
Packit 4a16fb
	__le32 reg;
Packit 4a16fb
	__le32 shift;
Packit 4a16fb
	__le32 id;	/* ID maps to Left, Right, LFE etc */
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Genericl Operations IDs, for binding Kcontrol or Bytes ext ops
Packit 4a16fb
 * Kcontrol ops need get/put/info.
Packit 4a16fb
 * Bytes ext ops need get/put.
Packit 4a16fb
 */
Packit 4a16fb
struct snd_soc_tplg_io_ops {
Packit 4a16fb
	__le32 get;
Packit 4a16fb
	__le32 put;
Packit 4a16fb
	__le32 info;
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * kcontrol header
Packit 4a16fb
 */
Packit 4a16fb
struct snd_soc_tplg_ctl_hdr {
Packit 4a16fb
	__le32 size;	/* in bytes of this structure */
Packit 4a16fb
	__le32 type;
Packit 4a16fb
	char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
Packit 4a16fb
	__le32 access;
Packit 4a16fb
	struct snd_soc_tplg_io_ops ops;
Packit 4a16fb
	struct snd_soc_tplg_ctl_tlv tlv;
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Stream Capabilities
Packit 4a16fb
 */
Packit 4a16fb
struct snd_soc_tplg_stream_caps {
Packit 4a16fb
	__le32 size;		/* in bytes of this structure */
Packit 4a16fb
	char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
Packit 4a16fb
	__le64 formats;	/* supported formats SNDRV_PCM_FMTBIT_* */
Packit 4a16fb
	__le32 rates;		/* supported rates SNDRV_PCM_RATE_* */
Packit 4a16fb
	__le32 rate_min;	/* min rate */
Packit 4a16fb
	__le32 rate_max;	/* max rate */
Packit 4a16fb
	__le32 channels_min;	/* min channels */
Packit 4a16fb
	__le32 channels_max;	/* max channels */
Packit 4a16fb
	__le32 periods_min;	/* min number of periods */
Packit 4a16fb
	__le32 periods_max;	/* max number of periods */
Packit 4a16fb
	__le32 period_size_min;	/* min period size bytes */
Packit 4a16fb
	__le32 period_size_max;	/* max period size bytes */
Packit 4a16fb
	__le32 buffer_size_min;	/* min buffer size bytes */
Packit 4a16fb
	__le32 buffer_size_max;	/* max buffer size bytes */
Packit 4a16fb
	__le32 sig_bits;        /* number of bits of content */
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * FE or BE Stream configuration supported by SW/FW
Packit 4a16fb
 */
Packit 4a16fb
struct snd_soc_tplg_stream {
Packit 4a16fb
	__le32 size;		/* in bytes of this structure */
Packit 4a16fb
	char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* Name of the stream */
Packit 4a16fb
	__le64 format;		/* SNDRV_PCM_FMTBIT_* */
Packit 4a16fb
	__le32 rate;		/* SNDRV_PCM_RATE_* */
Packit 4a16fb
	__le32 period_bytes;	/* size of period in bytes */
Packit 4a16fb
	__le32 buffer_bytes;	/* size of buffer in bytes */
Packit 4a16fb
	__le32 channels;	/* channels */
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Describes a physical link's runtime supported hardware config,
Packit 4a16fb
 * i.e. hardware audio formats.
Packit 4a16fb
 */
Packit 4a16fb
struct snd_soc_tplg_hw_config {
Packit 4a16fb
	__le32 size;            /* in bytes of this structure */
Packit 4a16fb
	__le32 id;		/* unique ID - - used to match */
Packit 4a16fb
	__le32 fmt;		/* SND_SOC_DAI_FORMAT_ format value */
Packit 4a16fb
	__u8 clock_gated;	/* SND_SOC_TPLG_DAI_CLK_GATE_ value */
Packit 4a16fb
	__u8 invert_bclk;	/* 1 for inverted BCLK, 0 for normal */
Packit 4a16fb
	__u8 invert_fsync;	/* 1 for inverted frame clock, 0 for normal */
Packit 4a16fb
	__u8 bclk_master;	/* SND_SOC_TPLG_BCLK_ value */
Packit 4a16fb
	__u8 fsync_master;	/* SND_SOC_TPLG_FSYNC_ value */
Packit 4a16fb
	__u8 mclk_direction;    /* SND_SOC_TPLG_MCLK_ value */
Packit 4a16fb
	__le16 reserved;	/* for 32bit alignment */
Packit 4a16fb
	__le32 mclk_rate;	/* MCLK or SYSCLK freqency in Hz */
Packit 4a16fb
	__le32 bclk_rate;	/* BCLK freqency in Hz */
Packit 4a16fb
	__le32 fsync_rate;	/* frame clock in Hz */
Packit 4a16fb
	__le32 tdm_slots;	/* number of TDM slots in use */
Packit 4a16fb
	__le32 tdm_slot_width;	/* width in bits for each slot */
Packit 4a16fb
	__le32 tx_slots;	/* bit mask for active Tx slots */
Packit 4a16fb
	__le32 rx_slots;	/* bit mask for active Rx slots */
Packit 4a16fb
	__le32 tx_channels;	/* number of Tx channels */
Packit 4a16fb
	__le32 tx_chanmap[SND_SOC_TPLG_MAX_CHAN]; /* array of slot number */
Packit 4a16fb
	__le32 rx_channels;	/* number of Rx channels */
Packit 4a16fb
	__le32 rx_chanmap[SND_SOC_TPLG_MAX_CHAN]; /* array of slot number */
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Manifest. List totals for each payload type. Not used in parsing, but will
Packit 4a16fb
 * be passed to the component driver before any other objects in order for any
Packit 4a16fb
 * global component resource allocations.
Packit 4a16fb
 *
Packit 4a16fb
 * File block representation for manifest :-
Packit 4a16fb
 * +-----------------------------------+----+
Packit 4a16fb
 * | struct snd_soc_tplg_hdr           |  1 |
Packit 4a16fb
 * +-----------------------------------+----+
Packit 4a16fb
 * | struct snd_soc_tplg_manifest      |  1 |
Packit 4a16fb
 * +-----------------------------------+----+
Packit 4a16fb
 */
Packit 4a16fb
struct snd_soc_tplg_manifest {
Packit 4a16fb
	__le32 size;		/* in bytes of this structure */
Packit 4a16fb
	__le32 control_elems;	/* number of control elements */
Packit 4a16fb
	__le32 widget_elems;	/* number of widget elements */
Packit 4a16fb
	__le32 graph_elems;	/* number of graph elements */
Packit 4a16fb
	__le32 pcm_elems;	/* number of PCM elements */
Packit 4a16fb
	__le32 dai_link_elems;	/* number of DAI link elements */
Packit 4a16fb
	__le32 dai_elems;	/* number of physical DAI elements */
Packit 4a16fb
	__le32 reserved[20];	/* reserved for new ABI element types */
Packit 4a16fb
	struct snd_soc_tplg_private priv;
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Mixer kcontrol.
Packit 4a16fb
 *
Packit 4a16fb
 * File block representation for mixer kcontrol :-
Packit 4a16fb
 * +-----------------------------------+----+
Packit 4a16fb
 * | struct snd_soc_tplg_hdr           |  1 |
Packit 4a16fb
 * +-----------------------------------+----+
Packit 4a16fb
 * | struct snd_soc_tplg_mixer_control |  N |
Packit 4a16fb
 * +-----------------------------------+----+
Packit 4a16fb
 */
Packit 4a16fb
struct snd_soc_tplg_mixer_control {
Packit 4a16fb
	struct snd_soc_tplg_ctl_hdr hdr;
Packit 4a16fb
	__le32 size;	/* in bytes of this structure */
Packit 4a16fb
	__le32 min;
Packit 4a16fb
	__le32 max;
Packit 4a16fb
	__le32 platform_max;
Packit 4a16fb
	__le32 invert;
Packit 4a16fb
	__le32 num_channels;
Packit 4a16fb
	struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN];
Packit 4a16fb
	struct snd_soc_tplg_private priv;
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Enumerated kcontrol
Packit 4a16fb
 *
Packit 4a16fb
 * File block representation for enum kcontrol :-
Packit 4a16fb
 * +-----------------------------------+----+
Packit 4a16fb
 * | struct snd_soc_tplg_hdr           |  1 |
Packit 4a16fb
 * +-----------------------------------+----+
Packit 4a16fb
 * | struct snd_soc_tplg_enum_control  |  N |
Packit 4a16fb
 * +-----------------------------------+----+
Packit 4a16fb
 */
Packit 4a16fb
struct snd_soc_tplg_enum_control {
Packit 4a16fb
	struct snd_soc_tplg_ctl_hdr hdr;
Packit 4a16fb
	__le32 size;	/* in bytes of this structure */
Packit 4a16fb
	__le32 num_channels;
Packit 4a16fb
	struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN];
Packit 4a16fb
	__le32 items;
Packit 4a16fb
	__le32 mask;
Packit 4a16fb
	__le32 count;
Packit 4a16fb
	char texts[SND_SOC_TPLG_NUM_TEXTS][SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
Packit 4a16fb
	__le32 values[SND_SOC_TPLG_NUM_TEXTS * SNDRV_CTL_ELEM_ID_NAME_MAXLEN / 4];
Packit 4a16fb
	struct snd_soc_tplg_private priv;
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Bytes kcontrol
Packit 4a16fb
 *
Packit 4a16fb
 * File block representation for bytes kcontrol :-
Packit 4a16fb
 * +-----------------------------------+----+
Packit 4a16fb
 * | struct snd_soc_tplg_hdr           |  1 |
Packit 4a16fb
 * +-----------------------------------+----+
Packit 4a16fb
 * | struct snd_soc_tplg_bytes_control |  N |
Packit 4a16fb
 * +-----------------------------------+----+
Packit 4a16fb
 */
Packit 4a16fb
struct snd_soc_tplg_bytes_control {
Packit 4a16fb
	struct snd_soc_tplg_ctl_hdr hdr;
Packit 4a16fb
	__le32 size;	/* in bytes of this structure */
Packit 4a16fb
	__le32 max;
Packit 4a16fb
	__le32 mask;
Packit 4a16fb
	__le32 base;
Packit 4a16fb
	__le32 num_regs;
Packit 4a16fb
	struct snd_soc_tplg_io_ops ext_ops;
Packit 4a16fb
	struct snd_soc_tplg_private priv;
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * DAPM Graph Element
Packit 4a16fb
 *
Packit 4a16fb
 * File block representation for DAPM graph elements :-
Packit 4a16fb
 * +-------------------------------------+----+
Packit 4a16fb
 * | struct snd_soc_tplg_hdr             |  1 |
Packit 4a16fb
 * +-------------------------------------+----+
Packit 4a16fb
 * | struct snd_soc_tplg_dapm_graph_elem |  N |
Packit 4a16fb
 * +-------------------------------------+----+
Packit 4a16fb
 */
Packit 4a16fb
struct snd_soc_tplg_dapm_graph_elem {
Packit 4a16fb
	char sink[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
Packit 4a16fb
	char control[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
Packit 4a16fb
	char source[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * DAPM Widget.
Packit 4a16fb
 *
Packit 4a16fb
 * File block representation for DAPM widget :-
Packit 4a16fb
 * +-------------------------------------+-----+
Packit 4a16fb
 * | struct snd_soc_tplg_hdr             |  1  |
Packit 4a16fb
 * +-------------------------------------+-----+
Packit 4a16fb
 * | struct snd_soc_tplg_dapm_widget     |  N  |
Packit 4a16fb
 * +-------------------------------------+-----+
Packit 4a16fb
 * |   struct snd_soc_tplg_enum_control  | 0|1 |
Packit 4a16fb
 * |   struct snd_soc_tplg_mixer_control | 0|N |
Packit 4a16fb
 * +-------------------------------------+-----+
Packit 4a16fb
 *
Packit 4a16fb
 * Optional enum or mixer control can be appended to the end of each widget
Packit 4a16fb
 * in the block.
Packit 4a16fb
 */
Packit 4a16fb
struct snd_soc_tplg_dapm_widget {
Packit 4a16fb
	__le32 size;		/* in bytes of this structure */
Packit 4a16fb
	__le32 id;		/* SND_SOC_DAPM_CTL */
Packit 4a16fb
	char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
Packit 4a16fb
	char sname[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
Packit 4a16fb
Packit 4a16fb
	__le32 reg;		/* negative reg = no direct dapm */
Packit 4a16fb
	__le32 shift;		/* bits to shift */
Packit 4a16fb
	__le32 mask;		/* non-shifted mask */
Packit 4a16fb
	__le32 subseq;		/* sort within widget type */
Packit 4a16fb
	__le32 invert;		/* invert the power bit */
Packit 4a16fb
	__le32 ignore_suspend;	/* kept enabled over suspend */
Packit 4a16fb
	__le16 event_flags;
Packit 4a16fb
	__le16 event_type;
Packit 4a16fb
	__le32 num_kcontrols;
Packit 4a16fb
	struct snd_soc_tplg_private priv;
Packit 4a16fb
	/*
Packit 4a16fb
	 * kcontrols that relate to this widget
Packit 4a16fb
	 * follow here after widget private data
Packit 4a16fb
	 */
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Describes SW/FW specific features of PCM (FE DAI & DAI link).
Packit 4a16fb
 *
Packit 4a16fb
 * File block representation for PCM :-
Packit 4a16fb
 * +-----------------------------------+-----+
Packit 4a16fb
 * | struct snd_soc_tplg_hdr           |  1  |
Packit 4a16fb
 * +-----------------------------------+-----+
Packit 4a16fb
 * | struct snd_soc_tplg_pcm           |  N  |
Packit 4a16fb
 * +-----------------------------------+-----+
Packit 4a16fb
 */
Packit 4a16fb
struct snd_soc_tplg_pcm {
Packit 4a16fb
	__le32 size;		/* in bytes of this structure */
Packit 4a16fb
	char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
Packit 4a16fb
	char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
Packit 4a16fb
	__le32 pcm_id;		/* unique ID - used to match with DAI link */
Packit 4a16fb
	__le32 dai_id;		/* unique ID - used to match */
Packit 4a16fb
	__le32 playback;	/* supports playback mode */
Packit 4a16fb
	__le32 capture;		/* supports capture mode */
Packit 4a16fb
	__le32 compress;	/* 1 = compressed; 0 = PCM */
Packit 4a16fb
	struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* for DAI link */
Packit 4a16fb
	__le32 num_streams;	/* number of streams */
Packit 4a16fb
	struct snd_soc_tplg_stream_caps caps[2]; /* playback and capture for DAI */
Packit 4a16fb
	__le32 flag_mask;       /* bitmask of flags to configure */
Packit 4a16fb
	__le32 flags;           /* SND_SOC_TPLG_LNK_FLGBIT_* flag value */
Packit 4a16fb
	struct snd_soc_tplg_private priv;
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Describes the physical link runtime supported configs or params
Packit 4a16fb
 *
Packit 4a16fb
 * File block representation for physical link config :-
Packit 4a16fb
 * +-----------------------------------+-----+
Packit 4a16fb
 * | struct snd_soc_tplg_hdr           |  1  |
Packit 4a16fb
 * +-----------------------------------+-----+
Packit 4a16fb
 * | struct snd_soc_tplg_link_config   |  N  |
Packit 4a16fb
 * +-----------------------------------+-----+
Packit 4a16fb
 */
Packit 4a16fb
struct snd_soc_tplg_link_config {
Packit 4a16fb
	__le32 size;            /* in bytes of this structure */
Packit 4a16fb
	__le32 id;              /* unique ID - used to match */
Packit 4a16fb
	char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* name - used to match */
Packit 4a16fb
	char stream_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* stream name - used to match */
Packit 4a16fb
	struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* supported configs playback and captrure */
Packit 4a16fb
	__le32 num_streams;     /* number of streams */
Packit 4a16fb
	struct snd_soc_tplg_hw_config hw_config[SND_SOC_TPLG_HW_CONFIG_MAX]; /* hw configs */
Packit 4a16fb
	__le32 num_hw_configs;         /* number of hw configs */
Packit 4a16fb
	__le32 default_hw_config_id;   /* default hw config ID for init */
Packit 4a16fb
	__le32 flag_mask;       /* bitmask of flags to configure */
Packit 4a16fb
	__le32 flags;           /* SND_SOC_TPLG_LNK_FLGBIT_* flag value */
Packit 4a16fb
	struct snd_soc_tplg_private priv;
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Describes SW/FW specific features of physical DAI.
Packit 4a16fb
 * It can be used to configure backend DAIs for DPCM.
Packit 4a16fb
 *
Packit 4a16fb
 * File block representation for physical DAI :-
Packit 4a16fb
 * +-----------------------------------+-----+
Packit 4a16fb
 * | struct snd_soc_tplg_hdr           |  1  |
Packit 4a16fb
 * +-----------------------------------+-----+
Packit 4a16fb
 * | struct snd_soc_tplg_dai           |  N  |
Packit 4a16fb
 * +-----------------------------------+-----+
Packit 4a16fb
 */
Packit 4a16fb
struct snd_soc_tplg_dai {
Packit 4a16fb
	__le32 size;            /* in bytes of this structure */
Packit 4a16fb
	char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* name - used to match */
Packit 4a16fb
	__le32 dai_id;          /* unique ID - used to match */
Packit 4a16fb
	__le32 playback;        /* supports playback mode */
Packit 4a16fb
	__le32 capture;         /* supports capture mode */
Packit 4a16fb
	struct snd_soc_tplg_stream_caps caps[2]; /* playback and capture for DAI */
Packit 4a16fb
	__le32 flag_mask;       /* bitmask of flags to configure */
Packit 4a16fb
	__le32 flags;           /* SND_SOC_TPLG_DAI_FLGBIT_* */
Packit 4a16fb
	struct snd_soc_tplg_private priv;
Packit 4a16fb
} __attribute__((packed));
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * Old version of ABI structs, supported for backward compatibility.
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
/* Manifest v4 */
Packit 4a16fb
struct snd_soc_tplg_manifest_v4 {
Packit 4a16fb
	__le32 size;		/* in bytes of this structure */
Packit 4a16fb
	__le32 control_elems;	/* number of control elements */
Packit 4a16fb
	__le32 widget_elems;	/* number of widget elements */
Packit 4a16fb
	__le32 graph_elems;	/* number of graph elements */
Packit 4a16fb
	__le32 pcm_elems;	/* number of PCM elements */
Packit 4a16fb
	__le32 dai_link_elems;	/* number of DAI link elements */
Packit 4a16fb
	struct snd_soc_tplg_private priv;
Packit 4a16fb
} __packed;
Packit 4a16fb
Packit 4a16fb
/* Stream Capabilities v4 */
Packit 4a16fb
struct snd_soc_tplg_stream_caps_v4 {
Packit 4a16fb
	__le32 size;		/* in bytes of this structure */
Packit 4a16fb
	char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
Packit 4a16fb
	__le64 formats;	/* supported formats SNDRV_PCM_FMTBIT_* */
Packit 4a16fb
	__le32 rates;		/* supported rates SNDRV_PCM_RATE_* */
Packit 4a16fb
	__le32 rate_min;	/* min rate */
Packit 4a16fb
	__le32 rate_max;	/* max rate */
Packit 4a16fb
	__le32 channels_min;	/* min channels */
Packit 4a16fb
	__le32 channels_max;	/* max channels */
Packit 4a16fb
	__le32 periods_min;	/* min number of periods */
Packit 4a16fb
	__le32 periods_max;	/* max number of periods */
Packit 4a16fb
	__le32 period_size_min;	/* min period size bytes */
Packit 4a16fb
	__le32 period_size_max;	/* max period size bytes */
Packit 4a16fb
	__le32 buffer_size_min;	/* min buffer size bytes */
Packit 4a16fb
	__le32 buffer_size_max;	/* max buffer size bytes */
Packit 4a16fb
} __packed;
Packit 4a16fb
Packit 4a16fb
/* PCM v4 */
Packit 4a16fb
struct snd_soc_tplg_pcm_v4 {
Packit 4a16fb
	__le32 size;		/* in bytes of this structure */
Packit 4a16fb
	char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
Packit 4a16fb
	char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
Packit 4a16fb
	__le32 pcm_id;		/* unique ID - used to match with DAI link */
Packit 4a16fb
	__le32 dai_id;		/* unique ID - used to match */
Packit 4a16fb
	__le32 playback;	/* supports playback mode */
Packit 4a16fb
	__le32 capture;		/* supports capture mode */
Packit 4a16fb
	__le32 compress;	/* 1 = compressed; 0 = PCM */
Packit 4a16fb
	struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* for DAI link */
Packit 4a16fb
	__le32 num_streams;	/* number of streams */
Packit 4a16fb
	struct snd_soc_tplg_stream_caps_v4 caps[2]; /* playback and capture for DAI */
Packit 4a16fb
} __packed;
Packit 4a16fb
Packit 4a16fb
/* Physical link config v4 */
Packit 4a16fb
struct snd_soc_tplg_link_config_v4 {
Packit 4a16fb
	__le32 size;            /* in bytes of this structure */
Packit 4a16fb
	__le32 id;              /* unique ID - used to match */
Packit 4a16fb
	struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* supported configs playback and captrure */
Packit 4a16fb
	__le32 num_streams;     /* number of streams */
Packit 4a16fb
} __packed;
Packit 4a16fb
Packit 4a16fb
#endif