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 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
460 #define SND_TPLG_MAX_CHAN 8
461 
463 typedef struct snd_tplg snd_tplg_t;
464 
481 };
482 
487 snd_tplg_t *snd_tplg_new(void);
488 
493 void snd_tplg_free(snd_tplg_t *tplg);
494 
502 int snd_tplg_build_file(snd_tplg_t *tplg, const char *infile,
503  const char *outfile);
504 
510 void snd_tplg_verbose(snd_tplg_t *tplg, int verbose);
511 
516  int type;
517 };
518 
524  int min;
525  int step;
526  int mute;
527 };
528 
533  int size;
534  int reg;
535  int shift;
536  int id;
537 };
538 
545 };
546 
551  unsigned int length;
552  const void *data;
553 };
554 
559  int get;
560  int put;
561  int info;
562 };
563 
568  int type;
569  const char *name;
570  int access;
573 };
574 
581  int min;
582  int max;
584  int invert;
585  struct snd_soc_tplg_private *priv;
586 };
587 
594  int items;
595  int mask;
596  const char **texts;
597  const int **values;
598  struct snd_soc_tplg_private *priv;
599 };
600 
606  int max;
607  int mask;
608  int base;
609  int num_regs;
611  struct snd_soc_tplg_private *priv;
612 };
613 
618  const char *src;
619  const char *ctl;
620  const char *sink;
621 };
622 
627  int count;
629 };
630 
635  int id;
636  const char *name;
637  const char *sname;
638  int reg;
639  int shift;
640  int mask;
641  int subseq;
642  unsigned int invert;
643  unsigned int ignore_suspend;
644  unsigned short event_flags;
645  unsigned short event_type;
646  struct snd_soc_tplg_private *priv;
647  int num_ctls;
649 };
650 
654 typedef struct snd_tplg_obj_template {
655  enum snd_tplg_type type;
656  int index;
657  int version;
659  union {
665  };
667 
675 
682 int snd_tplg_build(snd_tplg_t *tplg, const char *outfile);
683 
691 int snd_tplg_set_manifest_data(snd_tplg_t *tplg, const void *data, int len);
692 
699 int snd_tplg_set_version(snd_tplg_t *tplg, unsigned int version);
700 
701 /* \} */
702 
703 #ifdef __cplusplus
704 }
705 #endif
706 
707 #endif /* __ALSA_TOPOLOGY_H */
Definition: topology.h:470
struct snd_soc_tplg_private * priv
Definition: topology.h:611
const char * ctl
Definition: topology.h:619
int items
Definition: topology.h:594
struct snd_tplg_channel_elem channel[SND_TPLG_MAX_CHAN]
Definition: topology.h:544
int num_ctls
Definition: topology.h:647
const int ** values
Definition: topology.h:597
struct snd_soc_tplg_private * priv
Definition: topology.h:646
Template type for enumerated control objects.
Definition: topology.h:591
Definition: topology.h:532
Template type for array of DAPM graph elements.
Definition: topology.h:626
Definition: topology.h:479
int reg
Definition: topology.h:638
Definition: topology.h:480
Template type for DAPM widget objects.
Definition: topology.h:634
snd_tplg_type
Definition: topology.h:466
int mask
Definition: topology.h:595
struct snd_tplg_enum_template * enum_ctl
Definition: topology.h:663
struct snd_tplg_bytes_template * bytes_ctl
Definition: topology.h:662
Definition: topology.h:476
struct snd_soc_tplg_private * priv
Definition: topology.h:585
struct snd_tplg_channel_map_template * map
Definition: topology.h:593
Definition: topology.h:475
int access
Definition: topology.h:570
struct snd_tplg_io_ops_template ops
Definition: topology.h:571
struct snd_tplg_tlv_template hdr
Definition: topology.h:523
unsigned int ignore_suspend
Definition: topology.h:643
int subseq
Definition: topology.h:641
int snd_tplg_add_object(snd_tplg_t *tplg, snd_tplg_obj_template_t *t)
Register topology template object.
Definition: parser.c:309
Definition: topology.h:468
snd_tplg_t * snd_tplg_new(void)
Create a new topology parser instance.
Definition: parser.c:376
struct snd_tplg_widget_template * widget
Definition: topology.h:660
Template type for control objects.
Definition: topology.h:567
int platform_max
Definition: topology.h:583
struct snd_tplg_io_ops_template ext_ops
Definition: topology.h:610
unsigned int length
Definition: topology.h:551
Definition: topology.h:654
unsigned int invert
Definition: topology.h:642
struct snd_soc_tplg_private * priv
Definition: topology.h:598
int count
Definition: topology.h:627
const char * name
Definition: topology.h:636
struct snd_tplg_ctl_template hdr
Definition: topology.h:592
struct snd_tplg snd_tplg_t
Definition: topology.h:463
int reg
Definition: topology.h:534
Template type for TLV Scale objects.
Definition: topology.h:522
int vendor_type
Definition: topology.h:658
struct snd_tplg_ctl_template * ctl[0]
Definition: topology.h:648
struct snd_tplg_ctl_template hdr
Definition: topology.h:605
void snd_tplg_free(snd_tplg_t *tplg)
Free a topology parser instance.
Definition: parser.c:401
int max
Definition: topology.h:606
int max
Definition: topology.h:582
int shift
Definition: topology.h:639
int mute
Definition: topology.h:526
struct snd_tplg_graph_elem elem[0]
Definition: topology.h:628
int num_regs
Definition: topology.h:609
struct snd_tplg_mixer_template * mixer
Definition: topology.h:661
Definition: topology.h:471
#define SND_TPLG_MAX_CHAN
Definition: topology.h:460
unsigned short event_type
Definition: topology.h:645
Generic Template Object.
const char ** texts
Definition: topology.h:596
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:263
int snd_tplg_set_version(snd_tplg_t *tplg, unsigned int version)
Set an optional vendor specific version number.
Definition: parser.c:364
const char * src
Definition: topology.h:618
Template type for single DAPM graph element.
Definition: topology.h:617
Definition: topology.h:473
int min
Definition: topology.h:524
void snd_tplg_verbose(snd_tplg_t *tplg, int verbose)
Enable verbose reporting of binary file output.
Definition: parser.c:371
const char * sink
Definition: topology.h:620
Template type for TLV Scale objects.
Definition: topology.h:604
int id
Definition: topology.h:635
Template type for object operations mapping.
Definition: topology.h:558
struct snd_tplg_ctl_template hdr
Definition: topology.h:579
int put
Definition: topology.h:560
struct snd_tplg_channel_map_template * map
Definition: topology.h:580
int mask
Definition: topology.h:607
Template type for all TLV objects.
Definition: topology.h:515
unsigned int len
Definition: seq_event.h:198
const char * name
Definition: topology.h:569
Definition: topology.h:474
int mask
Definition: topology.h:640
Definition: topology.h:477
unsigned short event_flags
Definition: topology.h:644
Definition: topology.h:478
Definition: topology.h:467
int shift
Definition: topology.h:535
const void * data
Definition: topology.h:552
int invert
Definition: topology.h:584
int type
Definition: topology.h:516
int size
Definition: topology.h:533
struct snd_tplg_graph_template * graph
Definition: topology.h:664
Template type for mixer control objects.
Definition: topology.h:578
const char * sname
Definition: topology.h:637
int snd_tplg_set_manifest_data(snd_tplg_t *tplg, const void *data, int len)
Attach private data to topology manifest.
Definition: parser.c:357
int type
Definition: topology.h:568
int num_channels
Definition: topology.h:543
Template type for channel mapping.
Definition: topology.h:542
int min
Definition: topology.h:581
struct snd_tplg_tlv_template * tlv
Definition: topology.h:572
int base
Definition: topology.h:608
int info
Definition: topology.h:561
int snd_tplg_build(snd_tplg_t *tplg, const char *outfile)
Build all registered topology data into binary file.
Definition: parser.c:328
int step
Definition: topology.h:525
Definition: topology.h:472
int index
Definition: topology.h:656
Template type for private data objects.
Definition: topology.h:550
int id
Definition: topology.h:536
int version
Definition: topology.h:657
Definition: topology.h:469