ALSA project - the C library reference
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
topology.h
1 /*
2  *
3  * This library is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU Lesser General Public License as
5  * published by the Free Software Foundation; either version 2.1 of
6  * the License, or (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Copyright (C) 2015 Intel Corporation
18  *
19  */
20 
21 #ifndef __ALSA_TOPOLOGY_H
22 #define __ALSA_TOPOLOGY_H
23 
24 #include <stdint.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
564 #define SND_TPLG_MAX_CHAN 8
565 
567 typedef struct snd_tplg snd_tplg_t;
568 
587 };
588 
593 snd_tplg_t *snd_tplg_new(void);
594 
599 void snd_tplg_free(snd_tplg_t *tplg);
600 
608 int snd_tplg_build_file(snd_tplg_t *tplg, const char *infile,
609  const char *outfile);
610 
616 void snd_tplg_verbose(snd_tplg_t *tplg, int verbose);
617 
622  int type;
623 };
624 
630  int min;
631  int step;
632  int mute;
633 };
634 
639  int size;
640  int reg;
641  int shift;
642  int id;
643 };
644 
651 };
652 
657  unsigned int length;
658  const void *data;
659 };
660 
665  int get;
666  int put;
667  int info;
668 };
669 
674  int type;
675  const char *name;
676  int access;
679 };
680 
687  int min;
688  int max;
690  int invert;
691  struct snd_soc_tplg_private *priv;
692 };
693 
700  int items;
701  int mask;
702  const char **texts;
703  const int **values;
704  struct snd_soc_tplg_private *priv;
705 };
706 
712  int max;
713  int mask;
714  int base;
715  int num_regs;
717  struct snd_soc_tplg_private *priv;
718 };
719 
724  const char *src;
725  const char *ctl;
726  const char *sink;
727 };
728 
733  int count;
735 };
736 
741  int id;
742  const char *name;
743  const char *sname;
744  int reg;
745  int shift;
746  int mask;
747  int subseq;
748  unsigned int invert;
749  unsigned int ignore_suspend;
750  unsigned short event_flags;
751  unsigned short event_type;
752  struct snd_soc_tplg_private *priv;
753  int num_ctls;
755 };
756 
761  const char *name;
762  int format;
763  int rate;
766  int channels;
767 };
768 
773  const char *name;
774  uint64_t formats;
775  unsigned int rates;
776  unsigned int rate_min;
777  unsigned int rate_max;
778  unsigned int channels_min;
779  unsigned int channels_max;
780  unsigned int periods_min;
781  unsigned int periods_max;
782  unsigned int period_size_min;
783  unsigned int period_size_max;
784  unsigned int buffer_size_min;
785  unsigned int buffer_size_max;
786 };
787 
792  const char *pcm_name;
793  const char *dai_name;
794  unsigned int pcm_id;
795  unsigned int dai_id;
796  unsigned int playback;
797  unsigned int capture;
798  unsigned int compress;
802 };
803 
808  const char *name;
809  int id;
812 };
813 
817 typedef struct snd_tplg_obj_template {
818  enum snd_tplg_type type;
819  int index;
820  int version;
822  union {
830  };
832 
840 
847 int snd_tplg_build(snd_tplg_t *tplg, const char *outfile);
848 
856 int snd_tplg_set_manifest_data(snd_tplg_t *tplg, const void *data, int len);
857 
864 int snd_tplg_set_version(snd_tplg_t *tplg, unsigned int version);
865 
866 /* \} */
867 
868 #ifdef __cplusplus
869 }
870 #endif
871 
872 #endif /* __ALSA_TOPOLOGY_H */
Definition: topology.h:574
struct snd_soc_tplg_private * priv
Definition: topology.h:717
const char * ctl
Definition: topology.h:725
const char * name
Definition: topology.h:773
int rate
Definition: topology.h:763
uint64_t formats
Definition: topology.h:774
int items
Definition: topology.h:700
struct snd_tplg_channel_elem channel[SND_TPLG_MAX_CHAN]
Definition: topology.h:650
int num_ctls
Definition: topology.h:753
const int ** values
Definition: topology.h:703
struct snd_soc_tplg_private * priv
Definition: topology.h:752
Template type for enumerated control objects.
Definition: topology.h:697
Definition: topology.h:638
unsigned int rate_min
Definition: topology.h:776
Template type for array of DAPM graph elements.
Definition: topology.h:732
Definition: topology.h:583
int reg
Definition: topology.h:744
Definition: topology.h:584
Template type for DAPM widget objects.
Definition: topology.h:740
snd_tplg_type
Definition: topology.h:570
struct snd_tplg_pcm_template * pcm
Definition: topology.h:828
int mask
Definition: topology.h:701
struct snd_tplg_enum_template * enum_ctl
Definition: topology.h:826
struct snd_tplg_bytes_template * bytes_ctl
Definition: topology.h:825
Definition: topology.h:580
struct snd_soc_tplg_private * priv
Definition: topology.h:691
struct snd_tplg_channel_map_template * map
Definition: topology.h:699
Definition: topology.h:579
int access
Definition: topology.h:676
struct snd_tplg_io_ops_template ops
Definition: topology.h:677
struct snd_tplg_tlv_template hdr
Definition: topology.h:629
unsigned int ignore_suspend
Definition: topology.h:749
struct snd_tplg_stream_template stream[0]
Definition: topology.h:801
int subseq
Definition: topology.h:747
int snd_tplg_add_object(snd_tplg_t *tplg, snd_tplg_obj_template_t *t)
Register topology template object.
Definition: parser.c:322
Definition: topology.h:572
snd_tplg_t * snd_tplg_new(void)
Create a new topology parser instance.
Definition: parser.c:404
struct snd_tplg_widget_template * widget
Definition: topology.h:823
Template type for control objects.
Definition: topology.h:673
int platform_max
Definition: topology.h:689
struct snd_tplg_io_ops_template ext_ops
Definition: topology.h:716
unsigned int length
Definition: topology.h:657
Definition: topology.h:817
unsigned int buffer_size_max
Definition: topology.h:785
unsigned int invert
Definition: topology.h:748
struct snd_soc_tplg_private * priv
Definition: topology.h:704
unsigned int rate_max
Definition: topology.h:777
int count
Definition: topology.h:733
const char * dai_name
Definition: topology.h:793
const char * name
Definition: topology.h:742
int format
Definition: topology.h:762
Definition: topology.h:585
struct snd_tplg_ctl_template hdr
Definition: topology.h:698
struct snd_tplg snd_tplg_t
Definition: topology.h:567
int reg
Definition: topology.h:640
Template type for TLV Scale objects.
Definition: topology.h:628
int vendor_type
Definition: topology.h:821
struct snd_tplg_ctl_template * ctl[0]
Definition: topology.h:754
Stream configurations.
Definition: topology.h:760
struct snd_tplg_ctl_template hdr
Definition: topology.h:711
void snd_tplg_free(snd_tplg_t *tplg)
Free a topology parser instance.
Definition: parser.c:438
int max
Definition: topology.h:712
unsigned int capture
Definition: topology.h:797
int max
Definition: topology.h:688
int shift
Definition: topology.h:745
int buffer_bytes
Definition: topology.h:765
int mute
Definition: topology.h:632
struct snd_tplg_graph_elem elem[0]
Definition: topology.h:734
int num_regs
Definition: topology.h:715
struct snd_tplg_mixer_template * mixer
Definition: topology.h:824
Definition: topology.h:575
#define SND_TPLG_MAX_CHAN
Definition: topology.h:564
unsigned short event_type
Definition: topology.h:751
Generic Template Object.
Template type for PCM (FE DAI &amp; DAI links).
Definition: topology.h:791
const char ** texts
Definition: topology.h:702
int snd_tplg_build_file(snd_tplg_t *tplg, const char *infile, const char *outfile)
Parse and build topology text file into binary file.
Definition: parser.c:276
int snd_tplg_set_version(snd_tplg_t *tplg, unsigned int version)
Set an optional vendor specific version number.
Definition: parser.c:382
unsigned int buffer_size_min
Definition: topology.h:784
const char * src
Definition: topology.h:724
Template type for single DAPM graph element.
Definition: topology.h:723
Definition: topology.h:577
int min
Definition: topology.h:630
void snd_tplg_verbose(snd_tplg_t *tplg, int verbose)
Enable verbose reporting of binary file output.
Definition: parser.c:389
struct snd_tplg_stream_caps_template * caps[2]
Definition: topology.h:799
const char * sink
Definition: topology.h:726
Template type for TLV Scale objects.
Definition: topology.h:710
int id
Definition: topology.h:741
Template type for object operations mapping.
Definition: topology.h:664
struct snd_tplg_ctl_template hdr
Definition: topology.h:685
int put
Definition: topology.h:666
struct snd_tplg_channel_map_template * map
Definition: topology.h:686
int mask
Definition: topology.h:713
unsigned int pcm_id
Definition: topology.h:794
Template type for all TLV objects.
Definition: topology.h:621
unsigned int len
Definition: seq_event.h:198
unsigned int periods_max
Definition: topology.h:781
const char * name
Definition: topology.h:675
Definition: topology.h:578
Definition: topology.h:586
int mask
Definition: topology.h:746
unsigned int periods_min
Definition: topology.h:780
Definition: topology.h:581
unsigned short event_flags
Definition: topology.h:750
Definition: topology.h:582
Definition: topology.h:571
int shift
Definition: topology.h:641
const void * data
Definition: topology.h:658
int invert
Definition: topology.h:690
int num_streams
Definition: topology.h:800
int type
Definition: topology.h:622
int size
Definition: topology.h:639
struct snd_tplg_graph_template * graph
Definition: topology.h:827
Template type for mixer control objects.
Definition: topology.h:684
struct snd_tplg_link_template * link
Definition: topology.h:829
unsigned int channels_min
Definition: topology.h:778
const char * name
Definition: topology.h:761
const char * sname
Definition: topology.h:743
unsigned int dai_id
Definition: topology.h:795
int snd_tplg_set_manifest_data(snd_tplg_t *tplg, const void *data, int len)
Attach private data to topology manifest.
Definition: parser.c:375
unsigned int playback
Definition: topology.h:796
int type
Definition: topology.h:674
int channels
Definition: topology.h:766
int num_channels
Definition: topology.h:649
unsigned int period_size_min
Definition: topology.h:782
Template type for channel mapping.
Definition: topology.h:648
unsigned int period_size_max
Definition: topology.h:783
unsigned int compress
Definition: topology.h:798
int min
Definition: topology.h:687
unsigned int channels_max
Definition: topology.h:779
struct snd_tplg_tlv_template * tlv
Definition: topology.h:678
int base
Definition: topology.h:714
int info
Definition: topology.h:667
int snd_tplg_build(snd_tplg_t *tplg, const char *outfile)
Build all registered topology data into binary file.
Definition: parser.c:346
int step
Definition: topology.h:631
Definition: topology.h:576
unsigned int rates
Definition: topology.h:775
int index
Definition: topology.h:819
Template type for private data objects.
Definition: topology.h:656
int id
Definition: topology.h:642
Stream Capabilities.
Definition: topology.h:772
int period_bytes
Definition: topology.h:764
int version
Definition: topology.h:820
Definition: topology.h:573
const char * pcm_name
Definition: topology.h:792

Generated for ALSA project - the C library reference by doxygen 1.8.5