OSDN Git Service

topology: ABI - Use __le32 instead of __u32 in snd_soc_tplg_dapm_widget
[android-x86/external-alsa-lib.git] / include / 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
28 /**
29  * \defgroup topology Topology Interface
30  * \{
31  */
32
33 /*! \page topology ALSA Topology Interface
34  *
35  * The topology interface allows developers to define DSP topologies in a text
36  * file format and to convert the text topology to a binary topology
37  * representation that can be understood by the kernel. The topology core
38  * currently recognises the following object types :-
39  *
40  *  * Controls (mixer, enumerated and byte) including TLV data.
41  *  * PCMs (FE and BE configurations and capabilities)
42  *  * DAPM widgets
43  *  * DAPM graph elements.
44  *  * Private data for each object type.
45  *  * Manifest (containing count of each object type)
46  *
47  * <h3>Topology File Format</h3>
48  *
49  * The topology text format uses the standard ALSA configuration file format to
50  * describe each topology object type. This allows topology objects to include
51  * other topology objects as part of their definition. i.e. a TLV data object
52  * can be shared amongst many control objects that use the same TLV data.
53  *
54  *
55  * <h4>Controls</h4>
56  * Topology audio controls can belong to three different types :-
57  *   * Mixer control
58  *   * Enumerated control
59  *   * Byte control
60  *
61  * Each control type can contain TLV data, private data, operations and also
62  * belong to widget objects.<br>
63  *
64  * <h5>Control Operations</h5>
65  * Driver Kcontrol callback info(), get() and put() operations are mapped with
66  * the CTL ops section in topology configuration files. The ctl ops section can
67  * assign operations using the standard names (listed below) for the standard
68  * kcontrol types or use ID numbers (>256) to map to bespoke driver controls.<br>
69  *
70  * <pre>
71  *
72  *      ops."ctl" {
73  *              info "volsw"
74  *              get "257"
75  *              put "257"
76  *      }
77  *
78  * </pre>
79  *
80  * This mapping shows info() using the standard "volsw" info callback whilst
81  * the get() and put() are mapped to bespoke driver callbacks. <br>
82  *
83  * The Standard operations names for control get(), put() and info calls
84  * are :-
85  *  * volsw
86  *  * volsw_sx
87  *  * volsw_xr_sx
88  *  * enum
89  *  * bytes
90  *  * enum_value
91  *  * range
92  *  * strobe
93  *
94  * <h5>Control TLV Data</h5>
95  * Controls can also use TLV data to represent dB information. This can be done
96  * by defining a TLV section and using the TLV section within the control.
97  * The TLV data for DBScale types are defined as follows :-
98  *
99  * <pre>
100  *      scale {
101  *              min "-9000"
102  *              step "300"
103  *              mute "1"
104  *      }
105  * </pre>
106  *
107  * Where the meanings and values for min, step and mute are exactly the same
108  * as defined in driver code.
109  *
110  * <h5>Control Channel Mapping</h5>
111  * Controls can also specify which channels they are mapped with. This is useful
112  * for userspace as it allows applications to determine the correct control
113  * channel for Left and Right etc. Channel maps are defined as follows :-
114  *
115  * <pre>
116  *      channel."name" {
117  *              reg "0"
118  *              shift "0"
119  *      }
120  * </pre>
121  *
122  * The channel map reg is the register offset for the control, shift is the
123  * bit shift within the register for the channel and the section name is the
124  * channel name and can be one of the following :-
125  *
126  * <pre>
127  *  * mono              # mono stream
128  *  * fl                # front left
129  *  * fr                # front right
130  *  * rl                # rear left
131  *  * rr                # rear right
132  *  * fc                # front center
133  *  * lfe               # LFE
134  *  * sl                # side left
135  *  * sr                # side right
136  *  * rc                # rear center
137  *  * flc               # front left center
138  *  * frc               # front right center
139  *  * rlc               # rear left center
140  *  * rrc               # rear right center
141  *  * flw               # front left wide
142  *  * frw               # front right wide
143  *  * flh               # front left high
144  *  * fch               # front center high
145  *  * frh               # front right high
146  *  * tc                # top center
147  *  * tfl               # top front left
148  *  * tfr               # top front right
149  *  * tfc               # top front center
150  *  * trl               # top rear left
151  *  * trr               # top rear right
152  *  * trc               # top rear center
153  *  * tflc              # top front left center
154  *  * tfrc              # top front right center
155  *  * tsl               # top side left
156  *  * tsr               # top side right
157  *  * llfe              # left LFE
158  *  * rlfe              # right LFE
159  *  * bc                # bottom center
160  *  * blc               # bottom left center
161  *  * brc               # bottom right center
162  * </pre>
163  *
164  *  <h5>Control Private Data</h5>
165  * Controls can also have private data. This can be done by defining a private
166  * data section and including the section within the control. The private data
167  * section is defined as follows :-
168  *
169  * <pre>
170  * SectionData."pdata for EQU1" {
171  *      file "/path/to/file"
172  *      bytes "0x12,0x34,0x56,0x78"
173  *      shorts "0x1122,0x3344,0x5566,0x7788"
174  *      words "0xaabbccdd,0x11223344,0x66aa77bb,0xefef1234"
175  * };
176  * </pre>
177  * The file, bytes, shorts and words keywords are all mutually exclusive as
178  * the private data should only be taken from one source.  The private data can
179  * either be read from a separate file or defined in the topology file using
180  * the bytes, shorts or words keywords.
181  *
182  * <h5>Mixer Controls</h5>
183  * A mixer control is defined as a new section that can include channel mapping,
184  * TLV data, callback operations and private data. The mixer section also
185  * includes a few other config options that are shown here :-
186  *
187  * <pre>
188  * SectionControlMixer."mixer name" {
189  *      comment "optional comments"
190  *
191  *      index "1"                       # Index number
192  *
193  *      channel."name" {                # Channel maps
194  *         ....
195  *      }
196  *
197  *      ops."ctl" {                     # Ops callback functions
198  *         ....
199  *      }
200  *
201  *      max "32"                        # Max control value
202  *      invert "0"                      # Whether control values are inverted
203  *
204  *      tlv "tld_data"                  # optional TLV data
205  *
206  *      data "pdata for mixer1"         # optional private data
207  * }
208  * </pre>
209  *
210  * The section name is used to define the mixer name. The index number can be
211  * used to identify topology objects groups. This allows driver operations on
212  * objects with index number N and can be used to add/remove pipelines of
213  * objects whilst other objects are unaffected.
214  *
215  * <h5>Byte Controls</h5>
216  * A byte control is defined as a new section that can include channel mapping,
217  * TLV data, callback operations and private data. The bytes section also
218  * includes a few other config options that are shown here :-
219  *
220  * <pre>
221  * SectionControlBytes."name" {
222  *      comment "optional comments"
223  *
224  *      index "1"                       # Index number
225  *
226  *      channel."name" {                # Channel maps
227  *         ....
228  *      }
229  *
230  *      ops."ctl" {                     # Ops callback functions
231  *         ....
232  *      }
233  *
234  *      base "0"                        # Register base
235  *      num_regs "16"                   # Number of registers
236  *      mask "0xff"                     # Mask
237  *      max "255"                       # Maximum value
238  *
239  *      tlv "tld_data"                  # optional TLV data
240  *
241  *      data "pdata for mixer1"         # optional private data
242  * }
243  * </pre>
244  *
245  * <h5>Enumerated Controls</h5>
246  * A enumerated control is defined as a new section (like mixer and byte) that
247  * can include channel mapping, callback operations, private data and
248  * text strings to represent the enumerated control options.<br>
249  *
250  * The text strings for the enumerated controls are defined in a separate
251  * section as follows :-
252  *
253  * <pre>
254  * SectionText."name" {
255  *
256  *              Values [
257  *                      "value1"
258  *                      "value2"
259                         "value3"
260  *              ]
261  * }
262  * </pre>
263  *
264  * All the enumerated text values are listed in the values list.<br>
265  * The enumerated control is similar to the other controls and defined as
266  * follows :-
267  *
268  * <pre>
269  * SectionControlMixer."name" {
270  *      comment "optional comments"
271  *
272  *      index "1"                       # Index number
273  *
274  *      texts "EQU1"                    # Enumerated text items
275  *
276  *      channel."name" {                # Channel maps
277  *         ....
278  *      }
279  *
280  *      ops."ctl" {                     # Ops callback functions
281  *         ....
282  *      }
283  *
284  *      data "pdata for mixer1"         # optional private data
285  * }
286  * </pre>
287  *
288  * <h4>DAPM Graph</h4>
289  * DAPM graphs can easily be defined using the topology file. The format is
290  * very similar to the DAPM graph kernel format. :-
291  *
292  * <pre>
293  * SectionGraph."dsp" {
294  *      index "1"                       # Index number
295  *
296  *      lines [
297  *              "sink1, control, source1"
298  *              "sink2, , source2"
299  *      ]
300  * }
301  * </pre>
302  *
303  * The lines in the graph are defined as a variable size list of sinks,
304  * controls and sources. The control name is optional as some graph lines have
305  * no associated controls. The section name can be used to differentiate the
306  * graph with other graphs, it's not used by the kernel atm.
307  *
308  * <h4>DAPM Widgets</h4>
309  * DAPM widgets are similar to controls in that they can include many other
310  * objects. Widgets can contain private data, mixer controls and enum controls.
311  *
312  * The following widget types are supported and match the driver types :-
313  *
314  *  * input
315  *  * output
316  *  * mux
317  *  * mixer
318  *  * pga
319  *  * out_drv
320  *  * adc
321  *  * dac
322  *  * switch
323  *  * pre
324  *  * post
325  *  * aif_in
326  *  * aif_out
327  *  * dai_in
328  *  * dai_out
329  *  * dai_link
330  *
331  * Widgets are defined as follows :-
332  *
333  * <pre>
334  * SectionWidget."name" {
335  *
336  *      index "1"                       # Index number
337  *
338  *      type "aif_in"                   # Widget type - detailed above
339  *
340  *      no_pm "true"                    # No PM control bit.
341  *      reg "20"                        # PM bit register offset
342  *      shift "0"                       # PM bit register shift
343  *      invert "1                       # PM bit is inverted
344  *      subseq "8"                      # subsequence number
345  *
346  *      event_type "1"                  # DAPM widget event type
347  *      event_flags "1"                 # DAPM widget event flags
348  *
349  *      mixer "name"                    # Optional Mixer Control
350  *      enum "name"                     # Optional Enum Control
351  *
352  *      data "name"                     # optional private data
353  * }
354  * </pre>
355  *
356  * The section name is the widget name. The mixer and enum fields are mutually
357  * exclusive and used to include controls into the widget. The index and data
358  * fields are the same for widgets as they are for controls whilst the other
359  * fields map on very closely to the driver widget fields.
360  *
361  * <h4>PCM Capabilities</h4>
362  * Topology can also define the capabilities of FE and BE PCMs. Capabilities
363  * can be defined with the following section :-
364  *
365  * <pre>
366  * SectionPCMCapabilities."name" {
367  *
368  *      formats "S24_LE,S16_LE"         # Supported formats
369  *      rate_min "48000"                # Max supported sample rate
370  *      rate_max "48000"                # Min supported sample rate
371  *      channels_min "2"                # Min number of channels
372  *      channels_max "2"                # max number of channels
373  * }
374  * </pre>
375  * The supported formats use the same naming convention as the driver macros.
376  * The PCM capabilities name can be referred to and included by BE, PCM and
377  * Codec <-> codec topology sections.
378  *
379  * <h4>PCM Configurations</h4>
380  * PCM runtime configurations can be defined for playback and capture stream
381  * directions with the following section  :-
382  *
383  * <pre>
384  * SectionPCMConfig."name" {
385  *
386  *      config."playback" {             # playback config
387  *              format "S16_LE"         # playback format
388  *              rate "48000"            # playback sample rate
389  *              channels "2"            # playback channels
390  *              tdm_slot "0xf"          # playback TDM slot
391  *      }
392  *
393  *      config."capture" {              # capture config
394  *              format "S16_LE"         # capture format
395  *              rate "48000"            # capture sample rate
396  *              channels "2"            # capture channels
397  *              tdm_slot "0xf"          # capture TDM slot
398  *      }
399  * }
400  * </pre>
401  *
402  * The supported formats use the same naming convention as the driver macros.
403  * The PCM configuration name can be referred to and included by BE, PCM and
404  * Codec <-> codec topology sections.
405  *
406  * <h4>PCM Configurations</h4>
407  * PCM, BE and Codec to Codec link sections define the supported capabilities
408  * and configurations for supported playback and capture streams. The
409  * definitions and content for PCMs, BE and Codec links are the same with the
410  * exception of the section type :-
411  *
412  * <pre>
413  * SectionPCM."name" {
414  *      ....
415  * }
416  * SectionBE."name" {
417  *      ....
418  * }
419  * SectionCC."name" {
420  *      ....
421  * }
422  * </pre>
423  *
424  * The section types above should be used for PCMs, Back Ends and Codec to Codec
425  * links respectively.<br>
426  *
427  * The data for each section is defined as follows :-
428  *
429  * <pre>
430  * SectionPCM."name" {
431  *
432  *      index "1"                       # Index number
433  *
434  *      id "0"                          # used for binding to the PCM
435  *
436  *      pcm."playback" {
437  *              capabilities "capabilities1"    # capabilities for playback
438  *
439  *              configs [               # supported configs for playback
440  *                      "config1"
441  *                      "config2"
442  *              ]
443  *      }
444  *
445  *      pcm."capture" {
446  *              capabilities "capabilities2"    # capabilities for capture
447  *
448  *              configs [               # supported configs for capture
449  *                      "config1"
450  *                      "config2"
451  *                      "config3"
452  *              ]
453  *      }
454  * }
455  * </pre>
456  *
457  */
458
459 /** Maximum number of channels supported in one control */
460 #define SND_TPLG_MAX_CHAN               8
461
462 /** Topology context */
463 typedef struct snd_tplg snd_tplg_t;
464
465 /** Topology object types */
466 enum snd_tplg_type {
467         SND_TPLG_TYPE_TLV = 0,          /*!< TLV Data */
468         SND_TPLG_TYPE_MIXER,            /*!< Mixer control*/
469         SND_TPLG_TYPE_ENUM,             /*!< Enumerated control */
470         SND_TPLG_TYPE_TEXT,             /*!< Text data */
471         SND_TPLG_TYPE_DATA,             /*!< Private data */
472         SND_TPLG_TYPE_BYTES,            /*!< Byte control */
473         SND_TPLG_TYPE_STREAM_CONFIG,    /*!< PCM Stream configuration */
474         SND_TPLG_TYPE_STREAM_CAPS,      /*!< PCM Stream capabilities */
475         SND_TPLG_TYPE_PCM,              /*!< PCM stream device */
476         SND_TPLG_TYPE_DAPM_WIDGET,      /*!< DAPM widget */
477         SND_TPLG_TYPE_DAPM_GRAPH,       /*!< DAPM graph elements */
478         SND_TPLG_TYPE_BE,               /*!< BE DAI link */
479         SND_TPLG_TYPE_CC,               /*!< Hostless codec <-> codec link */
480         SND_TPLG_TYPE_MANIFEST,         /*!< Topology manifest */
481 };
482
483 /**
484  * \brief Create a new topology parser instance.
485  * \return New topology parser instance
486  */
487 snd_tplg_t *snd_tplg_new(void);
488
489 /**
490  * \brief Free a topology parser instance.
491  * \param tplg Topology parser instance
492  */
493 void snd_tplg_free(snd_tplg_t *tplg);
494
495 /**
496  * \brief Parse and build topology text file into binary file.
497  * \param tplg Topology instance.
498  * \param infile Topology text input file to be parsed
499  * \param outfile Binary topology output file.
500  * \return Zero on success, otherwise a negative error code
501  */
502 int snd_tplg_build_file(snd_tplg_t *tplg, const char *infile,
503         const char *outfile);
504
505 /**
506  * \brief Enable verbose reporting of binary file output
507  * \param tplg Topology Instance
508  * \param verbose Enable verbose output level if non zero
509  */
510 void snd_tplg_verbose(snd_tplg_t *tplg, int verbose);
511
512 /** \struct snd_tplg_tlv_template
513  * \brief Template type for all TLV objects.
514  */
515 struct snd_tplg_tlv_template {
516         int type;        /*!< TLV type SNDRV_CTL_TLVT_ */
517 };
518
519 /** \struct snd_tplg_tlv_dbscale_template
520  * \brief Template type for TLV Scale objects.
521  */
522 struct snd_tplg_tlv_dbscale_template {
523         struct snd_tplg_tlv_template hdr;       /*!< TLV type header */
524         int min;                        /*!< dB minimum value in 0.1dB */
525         int step;                       /*!< dB step size in 0.1dB */
526         int mute;                       /*!< is min dB value mute ? */
527 };
528
529 /** \struct snd_tplg_channel_template
530  * \brief Template type for single channel mapping.
531  */
532 struct snd_tplg_channel_elem {
533         int size;       /*!< size in bytes of this structure */
534         int reg;        /*!< channel control register */
535         int shift;      /*!< channel shift for control bits */
536         int id;         /*!< ID maps to Left, Right, LFE etc */
537 };
538
539 /** \struct snd_tplg_channel_map_template
540  * \brief Template type for channel mapping.
541  */
542 struct snd_tplg_channel_map_template {
543         int num_channels;       /*!< number of channel mappings */
544         struct snd_tplg_channel_elem channel[SND_TPLG_MAX_CHAN];        /*!< mapping */
545 };
546
547 /** \struct snd_tplg_pdata_template
548  * \brief Template type for private data objects.
549  */
550 struct snd_tplg_pdata_template {
551         unsigned int length;    /*!< data length */
552         const void *data;       /*!< data */
553 };
554
555 /** \struct snd_tplg_io_ops_template
556  * \brief Template type for object operations mapping.
557  */
558 struct snd_tplg_io_ops_template {
559         int get;        /*!< get callback ID */
560         int put;        /*!< put callback ID */
561         int info;       /*!< info callback ID */
562 };
563
564 /** \struct snd_tplg_ctl_template
565  * \brief Template type for control objects.
566  */
567 struct snd_tplg_ctl_template {
568         int type;               /*!< Control type */
569         const char *name;       /*!< Control name */
570         int access;             /*!< Control access */
571         struct snd_tplg_io_ops_template ops;    /*!< operations */
572         struct snd_tplg_tlv_template *tlv; /*!< non NULL means we have TLV data */
573 };
574
575 /** \struct snd_tplg_mixer_template
576  * \brief Template type for mixer control objects.
577  */
578 struct snd_tplg_mixer_template {
579         struct snd_tplg_ctl_template hdr;       /*!< control type header */
580         struct snd_tplg_channel_map_template *map;      /*!< channel map */
581         int min;        /*!< min value for mixer */
582         int max;        /*!< max value for mixer */
583         int platform_max;       /*!< max value for platform control */
584         int invert;     /*!< whether controls bits are inverted */
585         struct snd_soc_tplg_private *priv;      /*!< control private data */
586 };
587
588 /** \struct snd_tplg_enum_template
589  * \brief Template type for enumerated control objects.
590  */
591 struct snd_tplg_enum_template {
592         struct snd_tplg_ctl_template hdr;       /*!< control type header */
593         struct snd_tplg_channel_map_template *map;      /*!< channel map */
594         int items;      /*!< number of enumerated items in control */
595         int mask;       /*!< register mask size */
596         const char **texts;     /*!< control text items */
597         const int **values;     /*!< control value items */
598         struct snd_soc_tplg_private *priv;      /*!< control private data */
599 };
600
601 /** \struct snd_tplg_bytes_template
602  * \brief Template type for TLV Scale objects.
603  */
604 struct snd_tplg_bytes_template {
605         struct snd_tplg_ctl_template hdr;       /*!< control type header */
606         int max;                /*!< max byte control value */
607         int mask;               /*!< byte control mask */
608         int base;               /*!< base register */
609         int num_regs;           /*!< number of registers */
610         struct snd_tplg_io_ops_template ext_ops;        /*!< ops mapping */
611         struct snd_soc_tplg_private *priv;      /*!< control private data */
612 };
613
614 /** \struct snd_tplg_graph_elem
615  * \brief Template type for single DAPM graph element.
616  */
617 struct snd_tplg_graph_elem {
618         const char *src;        /*!< source widget name */
619         const char *ctl;        /*!< control name or NULL if no control */
620         const char *sink;       /*!< sink widget name */
621 };
622
623 /** \struct snd_tplg_graph_template
624  * \brief Template type for array of DAPM graph elements.
625  */
626 struct snd_tplg_graph_template {
627         int count;              /*!< Number of graph elements */
628         struct snd_tplg_graph_elem elem[0];     /*!< graph elements */
629 };
630
631 /** \struct snd_tplg_widget_template
632  * \brief Template type for DAPM widget objects.
633  */
634 struct snd_tplg_widget_template {
635         int id;                 /*!< SND_SOC_DAPM_CTL */
636         const char *name;       /*!< widget name */
637         const char *sname;      /*!< stream name (certain widgets only) */
638         int reg;                /*!< negative reg = no direct dapm */
639         int shift;              /*!< bits to shift */
640         int mask;               /*!< non-shifted mask */
641         int subseq;             /*!< sort within widget type */
642         unsigned int invert;            /*!< invert the power bit */
643         unsigned int ignore_suspend;    /*!< kept enabled over suspend */
644         unsigned short event_flags;     /*!< PM event sequence flags */
645         unsigned short event_type;      /*!< PM event sequence type */
646         struct snd_soc_tplg_private *priv;      /*!< widget private data */
647         int num_ctls;                   /*!< Number of controls used by widget */
648         struct snd_tplg_ctl_template *ctl[0];   /*!< array of widget controls */
649 };
650
651 /** \struct snd_tplg_obj_template
652  * \brief Generic Template Object
653  */
654 typedef struct snd_tplg_obj_template {
655         enum snd_tplg_type type;        /*!< template object type */
656         int index;              /*!< group index for object */
657         int version;            /*!< optional vendor specific version details */
658         int vendor_type;        /*!< optional vendor specific type info */
659         union {
660                 struct snd_tplg_widget_template *widget;        /*!< DAPM widget */
661                 struct snd_tplg_mixer_template *mixer;          /*!< Mixer control */
662                 struct snd_tplg_bytes_template *bytes_ctl;      /*!< Bytes control */
663                 struct snd_tplg_enum_template *enum_ctl;        /*!< Enum control */
664                 struct snd_tplg_graph_template *graph;          /*!< Graph elements */
665         };
666 } snd_tplg_obj_template_t;
667
668 /**
669  * \brief Register topology template object.
670  * \param tplg Topology instance.
671  * \param t Template object.
672  * \return Zero on success, otherwise a negative error code
673  */
674 int snd_tplg_add_object(snd_tplg_t *tplg, snd_tplg_obj_template_t *t);
675
676 /**
677  * \brief Build all registered topology data into binary file.
678  * \param tplg Topology instance.
679  * \param outfile Binary topology output file.
680  * \return Zero on success, otherwise a negative error code
681  */
682 int snd_tplg_build(snd_tplg_t *tplg, const char *outfile);
683
684 /**
685  * \brief Attach private data to topology manifest.
686  * \param tplg Topology instance.
687  * \param data Private data.
688  * \param len Length of data in bytes.
689  * \return Zero on success, otherwise a negative error code
690  */
691 int snd_tplg_set_manifest_data(snd_tplg_t *tplg, const void *data, int len);
692
693 /**
694  * \brief Set an optional vendor specific version number.
695  * \param tplg Topology instance.
696  * \param version Vendor specific version number.
697  * \return Zero on success, otherwise a negative error code
698  */
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 */