Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loopback mode kcontrol support #10

Closed
wants to merge 107 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
02a513a
ASoC: topology: Fix bclk and fsync inversion in set_link_hw_format()
kmarinushkin Apr 4, 2018
cba6339
ASoC: topology: Add missing clock gating parameter when parsing hw_co…
kmarinushkin Apr 4, 2018
fdab575
ASoC: topology: Add definitions for mclk_direction values
kmarinushkin Apr 4, 2018
5625100
ASoC: topology: Add support for compressed PCMs
lrgirdwo Mar 27, 2018
64859fb
ASoC: fix 0-day warnings with snd_soc_new_compress()
plbossart May 29, 2018
e022fa0
ASoC: Intel: cht-bsw-rt5672: allow for topology-defined codec-dai setup
plbossart Apr 27, 2018
6bde10d
ALSA: core api: define offsets for TLV items
ranj063 May 10, 2018
4c685a7
ASoC: pcm512x: Add ACPI support
plbossart May 17, 2018
9f2ec80
ASoC: Intel: Disable SND_SOC_INTEL_BAYTRAIL when SND_SST_ATOM_HIFI2_P…
jwrdegoede Apr 13, 2018
28fe6c4
ASoC: topology: Give more data to clients via callbacks
lrgirdwo Jun 14, 2018
4c8ac45
ASoC: topology: Add callback for DAPM route load/unload
lrgirdwo Jun 14, 2018
2695cf5
ASoC: dapm: Fix potential DAI widget pointer deref when linking DAIs
lrgirdwo Jun 14, 2018
02dd6a5
ASoC: Intel: broxton: reduce machine name for bxt_da7219_max98357a
naveen-manohar Jun 18, 2018
3c71f58
ASoC: Intel: Skylake: cleanup before moving ACPI tables
plbossart Jun 18, 2018
7a3d054
ASoC: Intel: move SKL+ codec ACPI tables to common directory
plbossart Jun 18, 2018
674ee8a
ASoC: Intel: common: Add Geminilake Dialog+Maxim machine driver entry
naveen-manohar Jun 18, 2018
19d4dd5
ASoC: Intel: common: add firmware/topology information for SOF
plbossart Jun 18, 2018
82e7ce8
ASoC: Intel: common: add entries for SOF-based machine drivers
plbossart Jun 18, 2018
c94ec7c
ASoC: Intel: common: fix copy/paste issue with SOF/broadwell topology…
plbossart Jun 18, 2018
453d691
ASoC: Intel: common: rename 'reef' to 'sof' in ACPI matching table
plbossart Mar 12, 2018
f4cd2bc
ASoC: core: Allow topology to override machine driver FE DAI link con…
lrgirdwo Jan 8, 2018
ca84505
[SQUASHME?] ASoC: core: Add name prefix for machines with topology re…
lrgirdwo Mar 9, 2018
51f05df
ALSA: core: Allow drivers to set R/W wait time.
lrgirdwo Jan 8, 2018
d4da475
ASoC: SOF: Add Sound Open Firmware driver core
lrgirdwo Jan 8, 2018
d2ee6b1
ASoC: SOF: Add Sound Open Firmware KControl support
lrgirdwo Jan 8, 2018
4c649d0
ASoC: SOF: Add driver debug support.
lrgirdwo Jan 8, 2018
ce4ffeb
ASoC: SOF: Add support for IPC IO between DSP and Host
lrgirdwo Jan 8, 2018
9c9d49d
ASoC: SOF: Add PCM operations support
lrgirdwo Jan 8, 2018
95545bc
ASoC: SOF: Add support for loading topologies
lrgirdwo Jan 8, 2018
496c29a
ASoC: SOF: Add DSP firmware trace event support
lrgirdwo Jan 8, 2018
95b1b4e
ASoC: SOF: Add DSP HW abstraction operations
lrgirdwo Jan 8, 2018
41ff0a4
ASoC: SOF: Add firmware loader support
lrgirdwo Jan 8, 2018
a8711d6
ASoC: SOF: Add compressed PCM support
lrgirdwo Jan 8, 2018
7c7884f
ASoC: SOF: Add PM support
lrgirdwo Jan 16, 2018
543caaf
ASoC: SOF: Add Nocodec machine driver support
lrgirdwo Jan 8, 2018
8c5bb0f
ASoC: SOF: Intel: Add BYT, CHT and BSW DSP HW support.
lrgirdwo Jan 8, 2018
a289d92
ASoC: SOF: Intel: Add HSW HW DSP support
lrgirdwo Jan 8, 2018
80c1ab5
ASoC: SOF: Intel: Add support for BDW HW DSP support
lrgirdwo Jan 8, 2018
d3be805
ASoC: SOF: Intel: Add APL/CNL HW DSP support
lrgirdwo Jan 8, 2018
7f48b6b
ASoC: SOF: Intel: Add HDA controller for Intel DSP
lrgirdwo May 9, 2018
5d9b8b0
ASoC: SOF: Intel: Add Intel specific HDA DSP HW operations
lrgirdwo May 9, 2018
e10ad95
ASoC: SOF: Intel: Add Intel specific HDA IPC mechanisms.
lrgirdwo May 9, 2018
8bb0c74
ASoC: SOF: Intel: Add Intel specific HDA firmware loader
lrgirdwo May 9, 2018
36319f4
ASoC: SOF: Intel: Add Intel specific HDA PCM operations
lrgirdwo May 9, 2018
c194611
ASoC: SOF: Intel: Add Intel specific HDA stream operations
lrgirdwo May 9, 2018
0489f5a
ASoC: SOF: Intel: Add Intel specific HDA trace operations
lrgirdwo May 9, 2018
db1915c
ASoC: SOF: Intel: Add platform differentiation for SKL, APL and CNL
lrgirdwo May 9, 2018
843579f
ASoC: SOF: Add userspace ABI support
lrgirdwo Jan 8, 2018
4078be4
ASoC: SOF: Add VirtIO support
lrgirdwo Jan 8, 2018
361530c
ASoC: SOF: Add SPI device support
lrgirdwo Jan 8, 2018
4021d60
ASoC: SOF: Add ACPI device support
lrgirdwo Jan 8, 2018
7bdc920
ASoC: SOF: Add PCI device support
lrgirdwo Jan 8, 2018
bea036a
ASoC: SOF: Add Build support for SOF core and Intel drivers
lrgirdwo Jan 8, 2018
2c48cab
ASoC: Intel: Kconfig: disable SST and legacy drivers when SOF is sele…
plbossart May 31, 2018
5119fdb
ASoC: SOF: refine dapm route loading in sof
RanderWang May 25, 2018
92e8a50
ASoC: SOF: parse Xtensa exception causes
xiulipan May 25, 2018
507d6f9
ASoC: uapi: sof: Add ipc config params and topology tokens for DMIC D…
ranj063 May 27, 2018
4942703
ASoC: SOF: Add support for parsing DMIC specific tokens from topology
ranj063 May 27, 2018
3f3abba
ASoC: SOF: support DMIC DAI type during link fixup
ranj063 May 27, 2018
f1ebcc2
[WORKAROUND] ASoC: SOF: start HDA DMA at hw_params() stage and remove…
keyonjie May 15, 2018
0ba34ad
ASoC: Intel: make bytcht_da7213 with SOF
plbossart Mar 9, 2018
8b2b17c
ASoC: Intel: make cht_bsw_max98090 work with SOF
plbossart Mar 9, 2018
46a1199
ASoC: Intel: cht-bsw-rt5645: work with SOF
plbossart Nov 10, 2017
2759eb0
ASoC: Intel: cht-bsw-rt5672: work with SOF
plbossart Nov 30, 2017
87d8985
ASoC: Intel: make bytcr_rt5640 work with SOF
plbossart Dec 21, 2017
9b9e392
ASoC: Intel: Make sure HSW/BDW based machine drivers build for SOF
lrgirdwo Dec 7, 2017
e63c8a9
ASoC: Intel: Kconfig: expose common option between SST and SOF drivers
plbossart Jan 9, 2018
fff657f
ASoC: Intel: select relevant machine drivers for SOF
plbossart Dec 7, 2017
a3039a0
ASoC: Intel: add machine driver for BXT/APL with pcm512x codec
plbossart Apr 23, 2018
18ba099
ASoC: Intel: add rt274 machine driver for cnl
RanderWang May 18, 2018
1ac86e1
ASoC: Intel: make cnl_rt274 work with SOF
plbossart May 18, 2018
270eb22
ASoC: tdf8532: NXP TDF8532 audio class-D amplifier driver
May 15, 2018
f7bae90
ASoC: tdf8532: Fix compilation warnings
May 15, 2018
e26299c
ASoC: tdf8532: Add delay while reading a packet from I2C
May 15, 2018
8dd7f4a
ASoC: tdf8532: Fix the codec status error issue on APL-GPMRB
May 15, 2018
052f669
ASoC: Intel: Boards: Add BXTP MRB machine driver for NXP TDF8532
keyonjie May 22, 2018
439aaa9
ASoC: Intel: bxt-tdf8532: reuse machine driver for GP-MRB
keyonjie May 22, 2018
b6666c6
ASoC: Intel: bxt-tdf8532: FIX: don't use add_dai_link() for SOF
keyonjie May 28, 2018
77467b9
ALSA: HACK: Fix rmmod crash
lrgirdwo Nov 3, 2017
dbf9e8c
[NOT FOR UPSTREAM] ASoC: SOF: enable DEBUG by default
plbossart Apr 16, 2018
bc4b9e3
ASoC: Intel: replace snd_soc_codec to snd_soc_component in bxt-pcm512x
xiulipan Jun 7, 2018
b7229c1
ASoC: Intel: bytcr_rt5651: work with sof only with SSP2 AIF1
xiulipan Jun 6, 2018
b83deba
ASoC: SOF: topology: free volume table while unloading pga widget
ranj063 Jun 10, 2018
ed6cb43
acpi: blacklist: remove quirk for Dell XPS13 when SOF is enabled
plbossart Jun 12, 2018
e97bc1f
ASoC: Intel: common: add ACPI match for CannonLake
plbossart Jun 12, 2018
af410da
ASoC: SOF: fix warning about assigning __le to u16 type
ranj063 Jun 12, 2018
c5450f7
ASoC: SOF: topology: fix dmic pdm token offsets
ranj063 Jun 12, 2018
04ca261
ASoC: SOF: topology: fix logic for parsing dmic pdm tokens
ranj063 Jun 12, 2018
f42f8cf
ASoC: SOF: refinement for HDA DMA start/stop
keyonjie Jun 13, 2018
aaeb5cf
ASoC: uapi: sof: remove dmac id and dmac channel members from ipc hos…
ranj063 Jun 13, 2018
9b0fa72
ASoC: uapi: sof: remove DMAC ID and DMAC channel tokens
ranj063 Jun 13, 2018
4bd6b22
ASoC: SOF: topology: remove dmac id and dmac channel token parsing
ranj063 Jun 13, 2018
59efe71
ASoC: SOF: Move xtensa oops/stack dump out of SOF core
lrgirdwo Jun 14, 2018
df15329
ASoC: SOF: Cleanup priv.h and add comments for upstreaming.
lrgirdwo Jun 15, 2018
51f6db7
ASoC: Intel: replace snd_soc_codec to snd_soc_component in cnl_rt274
xiulipan Jun 20, 2018
9b843df
ASoC: Intel: common: add ACPI matching tables for ICL
plbossart Jun 22, 2018
2b2dae0
ASoC: uapi: sof: rename clk_id to mclk_id to make it explicit and fix…
ranj063 Jun 20, 2018
7f45e9b
ASoC: uapi: sof: add token for SSP MCLK ID
ranj063 Jun 20, 2018
e409473
ASoC: SOF: topology: add SSP_MCLK_ID to ssp_tokens to enable parsing …
ranj063 Jun 20, 2018
cb05347
ASoC: SOF: merge sample_bits tokens with the rest of the ssp_tokens
ranj063 Jun 25, 2018
049371d
ASoC: SOF: Add debug_mode flag in sof dev
xiulipan Jun 13, 2018
0e67182
ASoC: SOF: debug: add debugmode debugfs for sof_dev debug_mode
xiulipan Jun 13, 2018
36cb300
ASoC: SOF: uapi: topology: Add SOF_TKN_DAI_EXT_CONFIG dai extra config
xiulipan Jun 4, 2018
f274a94
ASoC: SOF: add SOF_DAI_EXT_SSP_LBM bit for the DAI CONFIG
xiulipan Jun 28, 2018
a1c419f
ASoC: SOF: add headers for switch control callback functions
xiulipan Jun 20, 2018
e95f693
ASoC: SOF: add switch kcontrol callback functions
xiulipan Jun 20, 2018
b45116c
ASoC: SOF: topology: Add topology handler for dai lbm kcontrol
xiulipan Jun 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions drivers/acpi/blacklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ static int __init dmi_enable_rev_override(const struct dmi_system_id *d)

static const struct dmi_system_id acpi_rev_dmi_table[] __initconst = {
#ifdef CONFIG_ACPI_REV_OVERRIDE_POSSIBLE
#if !IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL)
/*
* DELL XPS 13 (2015) switches sound between HDA and I2S
* depending on the ACPI _REV callback. If userspace supports
Expand All @@ -105,6 +106,7 @@ static const struct dmi_system_id acpi_rev_dmi_table[] __initconst = {
DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9343"),
},
},
#endif
{
.callback = dmi_enable_rev_override,
.ident = "DELL Precision 5520",
Expand Down
6 changes: 6 additions & 0 deletions include/sound/pcm.h
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ struct snd_pcm_substream {
/* -- timer section -- */
struct snd_timer *timer; /* timer */
unsigned timer_running: 1; /* time is running */
unsigned wait_time; /* time in ms for R/W to wait for avail */
/* -- next substream -- */
struct snd_pcm_substream *next;
/* -- linked substreams -- */
Expand Down Expand Up @@ -579,6 +580,11 @@ int snd_pcm_start(struct snd_pcm_substream *substream);
int snd_pcm_stop(struct snd_pcm_substream *substream, snd_pcm_state_t status);
int snd_pcm_drain_done(struct snd_pcm_substream *substream);
int snd_pcm_stop_xrun(struct snd_pcm_substream *substream);
static inline void snd_pcm_wait_time(struct snd_pcm_substream *substream,
unsigned wait_time)
{
substream->wait_time = wait_time;
}
#ifdef CONFIG_PM
int snd_pcm_suspend(struct snd_pcm_substream *substream);
int snd_pcm_suspend_all(struct snd_pcm *pcm);
Expand Down
6 changes: 6 additions & 0 deletions include/sound/soc-acpi-intel-match.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,11 @@ extern struct snd_soc_acpi_mach snd_soc_acpi_intel_broadwell_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_baytrail_legacy_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_baytrail_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cherrytrail_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_skl_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_kbl_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_bxt_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_glk_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_icl_machines[];

#endif
30 changes: 21 additions & 9 deletions include/sound/soc-topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ struct snd_soc_dapm_context;
struct snd_soc_card;
struct snd_kcontrol_new;
struct snd_soc_dai_link;
struct snd_soc_dai_driver;
struct snd_soc_dai;
struct snd_soc_dapm_route;

/* object scan be loaded and unloaded in groups with identfying indexes */
#define SND_SOC_TPLG_INDEX_ALL 0 /* ID that matches all FW objects */
Expand Down Expand Up @@ -109,35 +112,44 @@ struct snd_soc_tplg_widget_events {
struct snd_soc_tplg_ops {

/* external kcontrol init - used for any driver specific init */
int (*control_load)(struct snd_soc_component *,
int (*control_load)(struct snd_soc_component *, int index,
struct snd_kcontrol_new *, struct snd_soc_tplg_ctl_hdr *);
int (*control_unload)(struct snd_soc_component *,
struct snd_soc_dobj *);

/* DAPM graph route element loading and unloading */
int (*dapm_route_load)(struct snd_soc_component *, int index,
struct snd_soc_dapm_route *route);
int (*dapm_route_unload)(struct snd_soc_component *,
struct snd_soc_dobj *);

/* external widget init - used for any driver specific init */
int (*widget_load)(struct snd_soc_component *,
int (*widget_load)(struct snd_soc_component *, int index,
struct snd_soc_dapm_widget *,
struct snd_soc_tplg_dapm_widget *);
int (*widget_ready)(struct snd_soc_component *,
int (*widget_ready)(struct snd_soc_component *, int index,
struct snd_soc_dapm_widget *,
struct snd_soc_tplg_dapm_widget *);
int (*widget_unload)(struct snd_soc_component *,
struct snd_soc_dobj *);

/* FE DAI - used for any driver specific init */
int (*dai_load)(struct snd_soc_component *,
struct snd_soc_dai_driver *dai_drv);
int (*dai_load)(struct snd_soc_component *, int index,
struct snd_soc_dai_driver *dai_drv,
struct snd_soc_tplg_pcm *pcm, struct snd_soc_dai *dai);

int (*dai_unload)(struct snd_soc_component *,
struct snd_soc_dobj *);

/* DAI link - used for any driver specific init */
int (*link_load)(struct snd_soc_component *,
struct snd_soc_dai_link *link);
int (*link_load)(struct snd_soc_component *, int index,
struct snd_soc_dai_link *link,
struct snd_soc_tplg_link_config *cfg);
int (*link_unload)(struct snd_soc_component *,
struct snd_soc_dobj *);

/* callback to handle vendor bespoke data */
int (*vendor_load)(struct snd_soc_component *,
int (*vendor_load)(struct snd_soc_component *, int index,
struct snd_soc_tplg_hdr *);
int (*vendor_unload)(struct snd_soc_component *,
struct snd_soc_tplg_hdr *);
Expand All @@ -146,7 +158,7 @@ struct snd_soc_tplg_ops {
void (*complete)(struct snd_soc_component *);

/* manifest - optional to inform component of manifest */
int (*manifest)(struct snd_soc_component *,
int (*manifest)(struct snd_soc_component *, int index,
struct snd_soc_tplg_manifest *);

/* vendor specific kcontrol handlers available for binding */
Expand Down
18 changes: 18 additions & 0 deletions include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,11 @@ int snd_soc_platform_write(struct snd_soc_platform *platform,
int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num);
#ifdef CONFIG_SND_SOC_COMPRESS
int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num);
#else
static inline int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
{
return 0;
}
#endif

void snd_soc_disconnect_sync(struct device *dev);
Expand Down Expand Up @@ -1012,6 +1017,14 @@ struct snd_soc_platform_driver {

/* platform stream compress ops */
const struct snd_compr_ops *compr_ops;

/* this platform uses topology and ignore machine driver FEs */
const char *ignore_machine;
const char *topology_name_prefix;
int (*be_hw_params_fixup)(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
bool use_dai_pcm_id; /* use the DAI link PCM ID as PCM device number */
int be_pcm_base; /* base device ID for all BE PCMs */
};

struct snd_soc_dai_link_component {
Expand Down Expand Up @@ -1118,6 +1131,9 @@ struct snd_soc_dai_link {
/* pmdown_time is ignored at stop */
unsigned int ignore_pmdown_time:1;

/* Do not create a PCM for this DAI link (Backend link) */
unsigned int ignore:1;

struct list_head list; /* DAI link list of the soc card */
struct snd_soc_dobj dobj; /* For topology */
};
Expand Down Expand Up @@ -1157,6 +1173,7 @@ struct snd_soc_card {
const char *long_name;
const char *driver_name;
char dmi_longname[80];
char topology_shortname[32];

struct device *dev;
struct snd_card *snd_card;
Expand Down Expand Up @@ -1276,6 +1293,7 @@ struct snd_soc_pcm_runtime {
/* runtime devices */
struct snd_pcm *pcm;
struct snd_compr *compr;
struct snd_sof_pcm *sof;
struct snd_soc_codec *codec;
struct snd_soc_platform *platform; /* will be removed */
struct snd_soc_dai *codec_dai;
Expand Down
81 changes: 81 additions & 0 deletions include/sound/sof.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
/*
* This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license.
*
* Copyright(c) 2017 Intel Corporation. All rights reserved.
*
* Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
*/

#ifndef __INCLUDE_SOUND_SOF_H
#define __INCLUDE_SOUND_SOF_H

#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/pci.h>
#include <sound/soc-acpi.h>
#include <uapi/sound/sof-ipc.h>

struct snd_sof_dsp_ops;

/*
* SOF Platform data.
*/
struct snd_sof_pdata {
u32 id; /* PCI/ACPI ID */
const struct firmware *fw;
const char *drv_name;
const char *name;

/* parent devices */
struct device *dev;
struct pci_dev *pci;
struct platform_device *pdev;

/* descriptor */
const struct sof_dev_desc *desc;

/* machine */
struct platform_device *pdev_mach;
const struct snd_soc_acpi_mach *machine;
};

/*
* Descriptor used for setting up SOF platform data. This is used when
* ACPI/PCI data is missing or mapped differently.
*/
struct sof_dev_desc {
/* list of machines using this configuration */
struct snd_soc_acpi_mach *machines;

/* Platform resource indexes in BAR / ACPI resources. */
/* Must set to -1 if not used - add new items to end */
int resindex_lpe_base;
int resindex_pcicfg_base;
int resindex_imr_base;
int irqindex_host_ipc;
int resindex_dma_base;

/* DMA only valid when resindex_dma_base != -1*/
int dma_engine;
int dma_size;

/* IPC timeouts in ms */
int ipc_timeout;
int boot_timeout;

/* defaults for no codec mode */
const char *nocodec_fw_filename;
const char *nocodec_tplg_filename;
};

int sof_nocodec_setup(struct device *dev,
struct snd_sof_pdata *sof_pdata,
struct snd_soc_acpi_mach *mach,
const struct sof_dev_desc *desc);

#endif
29 changes: 25 additions & 4 deletions include/uapi/sound/asoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,15 @@
#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_CHANNELS (1 << 1)
#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)

/* DAI clock gating */
#define SND_SOC_TPLG_DAI_CLK_GATE_UNDEFINED 0
#define SND_SOC_TPLG_DAI_CLK_GATE_GATED 1
#define SND_SOC_TPLG_DAI_CLK_GATE_CONT 2

/* DAI mclk_direction */
#define SND_SOC_TPLG_MCLK_CO 0 /* for codec, mclk is output */
#define SND_SOC_TPLG_MCLK_CI 1 /* for codec, mclk is input */

/* DAI physical PCM data formats.
* Add new formats to the end of the list.
*/
Expand All @@ -160,6 +169,18 @@
#define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)
#define SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP (1 << 3)

/* DAI topology BCLK parameter
* For the backwards capability, by default codec is bclk master
*/
#define SND_SOC_TPLG_BCLK_CM 0 /* codec is bclk master */
#define SND_SOC_TPLG_BCLK_CS 1 /* codec is bclk slave */

/* DAI topology FSYNC parameter
* For the backwards capability, by default codec is fsync master
*/
#define SND_SOC_TPLG_FSYNC_CM 0 /* codec is fsync master */
#define SND_SOC_TPLG_FSYNC_CS 1 /* codec is fsync slave */

/*
* Block Header.
* This header precedes all object and object arrays below.
Expand Down Expand Up @@ -312,12 +333,12 @@ struct snd_soc_tplg_hw_config {
__le32 size; /* in bytes of this structure */
__le32 id; /* unique ID - - used to match */
__le32 fmt; /* SND_SOC_DAI_FORMAT_ format value */
__u8 clock_gated; /* 1 if clock can be gated to save power */
__u8 clock_gated; /* SND_SOC_TPLG_DAI_CLK_GATE_ value */
__u8 invert_bclk; /* 1 for inverted BCLK, 0 for normal */
__u8 invert_fsync; /* 1 for inverted frame clock, 0 for normal */
__u8 bclk_master; /* 1 for master of BCLK, 0 for slave */
__u8 fsync_master; /* 1 for master of FSYNC, 0 for slave */
__u8 mclk_direction; /* 0 for input, 1 for output */
__u8 bclk_master; /* SND_SOC_TPLG_BCLK_ value */
__u8 fsync_master; /* SND_SOC_TPLG_FSYNC_ value */
__u8 mclk_direction; /* SND_SOC_TPLG_MCLK_ value */
__le16 reserved; /* for 32bit alignment */
__le32 mclk_rate; /* MCLK or SYSCLK freqency in Hz */
__le32 bclk_rate; /* BCLK freqency in Hz */
Expand Down
29 changes: 29 additions & 0 deletions include/uapi/sound/sof-abi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note)) OR BSD-3-Clause) */
/*
* This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license.
*
* Copyright(c) 2017 Intel Corporation. All rights reserved.
*/

#ifndef __INCLUDE_UAPI_ABI_H__
#define __INCLUDE_UAPI_ABI_H__

#define SOF_ABI_VERSION 1
#define SOF_ABI_MAGIC 0x00464F53 /* "SOF\0" */

/*
* Header for all non IPC ABI data. Identifies data type, size and ABI.
* Used by any bespoke component data structures or binary blobs.
*/

struct sof_abi_hdr {
uint32_t magic; /* 'S', 'O', 'F', '\0' */
uint32_t type; /* component specific type */
uint32_t size; /* size in bytes of data excluding this struct */
uint32_t abi; /* SOF ABI version */
uint32_t comp_abi; /* component specific ABI version */
char data[0];
} __attribute__((packed));

#endif
Loading