ALSA project - the C library reference
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 
491 #define SND_TPLG_MAX_CHAN 8
492 
494 typedef struct snd_tplg snd_tplg_t;
495 
512 };
513 
518 snd_tplg_t *snd_tplg_new(void);
519 
524 void snd_tplg_free(snd_tplg_t *tplg);
525 
533 int snd_tplg_build_file(snd_tplg_t *tplg, const char *infile,
534  const char *outfile);
535 
541 void snd_tplg_verbose(snd_tplg_t *tplg, int verbose);
542 
547  int type;
548 };
549 
555  int min;
556  int step;
557  int mute;
558 };
559 
564  int size;
565  int reg;
566  int shift;
567  int id;
568 };
569 
576 };
577 
582  unsigned int length;
583  const void *data;
584 };
585 
590  int get;
591  int put;
592  int info;
593 };
594 
599  int type;
600  const char *name;
601  int access;
604 };
605 
612  int min;
613  int max;
615  int invert;
616  struct snd_soc_tplg_private *priv;
617 };
618 
625  int items;
626  int mask;
627  const char **texts;
628  const int **values;
629  struct snd_soc_tplg_private *priv;
630 };
631 
637  int max;
638  int mask;
639  int base;
640  int num_regs;
641  struct snd_tplg_io_ops_template ext_ops;
642  struct snd_soc_tplg_private *priv;
643 };
644 
649  const char *src;
650  const char *ctl;
651  const char *sink;
652 };
653 
658  int count;
659  struct snd_tplg_graph_elem elem[0];
660 };
661 
666  int id;
667  const char *name;
668  const char *sname;
669  int reg;
670  int shift;
671  int mask;
672  int subseq;
673  unsigned int invert;
674  unsigned int ignore_suspend;
675  unsigned short event_flags;
676  unsigned short event_type;
677  struct snd_soc_tplg_private *priv;
678  int num_ctls;
679  struct snd_tplg_ctl_template *ctl[0];
680 };
681 
686  const char *name;
687  int format;
688  int rate;
691  int channels;
692 };
693 
698  const char *name;
699  uint64_t formats;
700  unsigned int rates;
701  unsigned int rate_min;
702  unsigned int rate_max;
703  unsigned int channels_min;
704  unsigned int channels_max;
705  unsigned int periods_min;
706  unsigned int periods_max;
707  unsigned int period_size_min;
708  unsigned int period_size_max;
709  unsigned int buffer_size_min;
710  unsigned int buffer_size_max;
711 };
712 
717  const char *pcm_name;
718  const char *dai_name;
719  unsigned int pcm_id;
720  unsigned int dai_id;
721  unsigned int playback;
722  unsigned int capture;
723  unsigned int compress;
726  struct snd_tplg_stream_template stream[0];
727 };
728 
733  const char *name;
734  int id;
736  struct snd_tplg_stream_template stream[0];
737 };
738 
742 typedef struct snd_tplg_obj_template {
744  int index;
745  int version;
747  union {
755  };
757 
765 
772 int snd_tplg_build(snd_tplg_t *tplg, const char *outfile);
773 
781 int snd_tplg_set_manifest_data(snd_tplg_t *tplg, const void *data, int len);
782 
789 int snd_tplg_set_version(snd_tplg_t *tplg, unsigned int version);
790 
791 /* \} */
792 
793 #ifdef __cplusplus
794 }
795 #endif
796 
797 #endif /* __ALSA_TOPOLOGY_H */
Definition: topology.h:501
struct snd_soc_tplg_private * priv
Definition: topology.h:642
const char * ctl
Definition: topology.h:650
const char * name
Definition: topology.h:698
int rate
Definition: topology.h:688
uint64_t formats
Definition: topology.h:699
int items
Definition: topology.h:625
int num_ctls
Definition: topology.h:678
const int ** values
Definition: topology.h:628
struct snd_soc_tplg_private * priv
Definition: topology.h:677
Template type for enumerated control objects.
Definition: topology.h:622
Definition: topology.h:563
unsigned int rate_min
Definition: topology.h:701
Template type for array of DAPM graph elements.
Definition: topology.h:657
Definition: topology.h:510
int reg
Definition: topology.h:669
Definition: topology.h:511
Template type for DAPM widget objects.
Definition: topology.h:665
snd_tplg_type
Definition: topology.h:497
struct snd_tplg_pcm_template * pcm
Definition: topology.h:753
int mask
Definition: topology.h:626
struct snd_tplg_enum_template * enum_ctl
Definition: topology.h:751
struct snd_tplg_bytes_template * bytes_ctl
Definition: topology.h:750
Definition: topology.h:507
struct snd_soc_tplg_private * priv
Definition: topology.h:616
struct snd_tplg_channel_map_template * map
Definition: topology.h:624
Definition: topology.h:506
int access
Definition: topology.h:601
unsigned int ignore_suspend
Definition: topology.h:674
int subseq
Definition: topology.h:672
int snd_tplg_add_object(snd_tplg_t *tplg, snd_tplg_obj_template_t *t)
Register topology template object.
Definition: parser.c:302
Definition: topology.h:499
snd_tplg_t * snd_tplg_new(void)
Create a new topology parser instance.
Definition: parser.c:384
struct snd_tplg_widget_template * widget
Definition: topology.h:748
Template type for control objects.
Definition: topology.h:598
int platform_max
Definition: topology.h:614
unsigned int length
Definition: topology.h:582
Definition: topology.h:742
unsigned int buffer_size_max
Definition: topology.h:710
unsigned int invert
Definition: topology.h:673
struct snd_soc_tplg_private * priv
Definition: topology.h:629
unsigned int rate_max
Definition: topology.h:702
int count
Definition: topology.h:658
const char * dai_name
Definition: topology.h:718
const char * name
Definition: topology.h:667
int format
Definition: topology.h:687
struct snd_tplg snd_tplg_t
Definition: topology.h:494
int reg
Definition: topology.h:565
Template type for TLV Scale objects.
Definition: topology.h:553
int vendor_type
Definition: topology.h:746
Stream configurations.
Definition: topology.h:685
void snd_tplg_free(snd_tplg_t *tplg)
Free a topology parser instance.
Definition: parser.c:414
int max
Definition: topology.h:637
unsigned int capture
Definition: topology.h:722
int max
Definition: topology.h:613
int shift
Definition: topology.h:670
int buffer_bytes
Definition: topology.h:690
int mute
Definition: topology.h:557
int num_regs
Definition: topology.h:640
struct snd_tplg_mixer_template * mixer
Definition: topology.h:749
Definition: topology.h:502
#define SND_TPLG_MAX_CHAN
Definition: topology.h:491
unsigned short event_type
Definition: topology.h:676
Generic Template Object.
Template type for PCM (FE DAI & DAI links).
Definition: topology.h:716
const char ** texts
Definition: topology.h:627
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:256
int snd_tplg_set_version(snd_tplg_t *tplg, unsigned int version)
Set an optional vendor specific version number.
Definition: parser.c:362
unsigned int buffer_size_min
Definition: topology.h:709
const char * src
Definition: topology.h:649
Template type for single DAPM graph element.
Definition: topology.h:648
Definition: topology.h:504
int min
Definition: topology.h:555
void snd_tplg_verbose(snd_tplg_t *tplg, int verbose)
Enable verbose reporting of binary file output.
Definition: parser.c:369
const char * sink
Definition: topology.h:651
Template type for TLV Scale objects.
Definition: topology.h:635
int id
Definition: topology.h:666
Template type for object operations mapping.
Definition: topology.h:589
int put
Definition: topology.h:591
struct snd_tplg_channel_map_template * map
Definition: topology.h:611
int mask
Definition: topology.h:638
unsigned int pcm_id
Definition: topology.h:719
Template type for all TLV objects.
Definition: topology.h:546
unsigned int len
Definition: seq_event.h:198
unsigned int periods_max
Definition: topology.h:706
const char * name
Definition: topology.h:600
Definition: topology.h:505
int mask
Definition: topology.h:671
unsigned int periods_min
Definition: topology.h:705
Definition: topology.h:508
unsigned short event_flags
Definition: topology.h:675
Definition: topology.h:509
Definition: topology.h:498
int shift
Definition: topology.h:566
const void * data
Definition: topology.h:583
int invert
Definition: topology.h:615
int num_streams
Definition: topology.h:725
int type
Definition: topology.h:547
int size
Definition: topology.h:564
struct snd_tplg_graph_template * graph
Definition: topology.h:752
Template type for mixer control objects.
Definition: topology.h:609
struct snd_tplg_link_template * link
Definition: topology.h:754
unsigned int channels_min
Definition: topology.h:703
const char * name
Definition: topology.h:686
const char * sname
Definition: topology.h:668
unsigned int dai_id
Definition: topology.h:720
int snd_tplg_set_manifest_data(snd_tplg_t *tplg, const void *data, int len)
Attach private data to topology manifest.
Definition: parser.c:355
unsigned int playback
Definition: topology.h:721
int type
Definition: topology.h:599
int channels
Definition: topology.h:691
int num_channels
Definition: topology.h:574
unsigned int period_size_min
Definition: topology.h:707
Template type for channel mapping.
Definition: topology.h:573
unsigned int period_size_max
Definition: topology.h:708
unsigned int compress
Definition: topology.h:723
int min
Definition: topology.h:612
unsigned int channels_max
Definition: topology.h:704
struct snd_tplg_tlv_template * tlv
Definition: topology.h:603
int base
Definition: topology.h:639
int info
Definition: topology.h:592
int snd_tplg_build(snd_tplg_t *tplg, const char *outfile)
Build all registered topology data into binary file.
Definition: parser.c:326
int step
Definition: topology.h:556
Definition: topology.h:503
unsigned int rates
Definition: topology.h:700
int index
Definition: topology.h:744
Template type for private data objects.
Definition: topology.h:581
int id
Definition: topology.h:567
Stream Capabilities.
Definition: topology.h:697
int period_bytes
Definition: topology.h:689
int version
Definition: topology.h:745
Definition: topology.h:500
const char * pcm_name
Definition: topology.h:717

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