Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright 2008  Christian König <deathsimple@vodafone.de>
  3.  * Copyright 2007  Luc Verhaegen <lverhaegen@novell.com>
  4.  * Copyright 2007  Matthias Hopf <mhopf@novell.com>
  5.  * Copyright 2007  Egbert Eich   <eich@novell.com>
  6.  * Copyright 2007  Advanced Micro Devices, Inc.
  7.  *
  8.  * Permission is hereby granted, free of charge, to any person obtaining a
  9.  * copy of this software and associated documentation files (the "Software"),
  10.  * to deal in the Software without restriction, including without limitation
  11.  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  12.  * and/or sell copies of the Software, and to permit persons to whom the
  13.  * Software is furnished to do so, subject to the following conditions:
  14.  *
  15.  * The above copyright notice and this permission notice shall be included in
  16.  * all copies or substantial portions of the Software.
  17.  *
  18.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20.  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  21.  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  22.  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  23.  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  24.  * OTHER DEALINGS IN THE SOFTWARE.
  25.  */
  26.  
  27. #ifndef _RHD_AUDIO_H
  28. #define _RHD_AUDIO_H
  29.  
  30. struct rhdAudio {
  31.  
  32.         int scrnIndex;
  33.  
  34.         struct rhdHdmi* Registered;
  35.     int             Timer;
  36.  
  37.         Bool    SavedPlaying;
  38.         int     SavedChannels;
  39.         int     SavedRate;
  40.         int     SavedBitsPerSample;
  41.         CARD8   SavedStatusBits;
  42.         CARD8   SavedCategoryCode;
  43.  
  44.         Bool Stored;
  45.  
  46.         CARD32 StoreEnabled;
  47.         CARD32 StoreTiming;
  48.         CARD32 StoreSupportedSizeRate;
  49.         CARD32 StoreSupportedCodec;
  50.  
  51.         CARD32 StorePll1Mul;
  52.         CARD32 StorePll1Div;
  53.         CARD32 StorePll2Mul;
  54.         CARD32 StorePll2Div;
  55.         CARD32 StoreClockSrcSel;
  56. };
  57.  
  58. /*
  59.  * used for config value of RHDAudioSetSupported
  60.  */
  61. enum {
  62.         AUDIO_RATE_8000_HZ   = 0x00000001,
  63.         AUDIO_RATE_11025_HZ  = 0x00000002,
  64.         AUDIO_RATE_16000_HZ  = 0x00000004,
  65.         AUDIO_RATE_22050_HZ  = 0x00000008,
  66.         AUDIO_RATE_32000_HZ  = 0x00000010,
  67.         AUDIO_RATE_44100_HZ  = 0x00000020,
  68.         AUDIO_RATE_48000_HZ  = 0x00000040,
  69.         AUDIO_RATE_88200_HZ  = 0x00000080,
  70.         AUDIO_RATE_96000_HZ  = 0x00000100,
  71.         AUDIO_RATE_176400_HZ = 0x00000200,
  72.         AUDIO_RATE_192000_HZ = 0x00000400,
  73.         AUDIO_RATE_384000_HZ = 0x00000800,
  74.  
  75.         AUDIO_BPS_8  = 0x00010000,
  76.         AUDIO_BPS_16 = 0x00020000,
  77.         AUDIO_BPS_20 = 0x00040000,
  78.         AUDIO_BPS_24 = 0x00080000,
  79.         AUDIO_BPS_32 = 0x00100000
  80. };
  81.  
  82. /*
  83.  * used for codec value of RHDAudioSetSupported
  84.  */
  85. enum {
  86.         AUDIO_CODEC_PCM      = 0x00000001,
  87.         AUDIO_CODEC_FLOAT32  = 0x00000002,
  88.         AUDIO_CODEC_AC3      = 0x00000004
  89. };
  90.  
  91. /*
  92.  * used for status bist value in RHDAudioUpdateHdmi
  93.  */
  94. enum {
  95.         AUDIO_STATUS_DIG_ENABLE   = 0x01,
  96.         AUDIO_STATUS_V            = 0x02,
  97.         AUDIO_STATUS_VCFG         = 0x04,
  98.         AUDIO_STATUS_EMPHASIS     = 0x08,
  99.         AUDIO_STATUS_COPYRIGHT    = 0x10,
  100.         AUDIO_STATUS_NONAUDIO     = 0x20,
  101.         AUDIO_STATUS_PROFESSIONAL = 0x40,
  102.         AUDIO_STATUS_LEVEL        = 0x80
  103. };
  104.  
  105. void RHDAudioInit(RHDPtr rhdPtr);
  106.  
  107. void RHDAudioSetSupported(RHDPtr rhdPtr, Bool clear, CARD32 config, CARD32 codec);
  108. void RHDAudioSetEnable(RHDPtr rhdPtr, Bool Enable);
  109. void RHDAudioSetClock(RHDPtr rhdPtr, struct rhdOutput* Output, CARD32 Clock);
  110.  
  111. void RHDAudioRegisterHdmi(RHDPtr rhdPtr, struct rhdHdmi* rhdHdmi);
  112. void RHDAudioUnregisterHdmi(RHDPtr rhdPtr, struct rhdHdmi* rhdHdmi);
  113.  
  114. void RHDAudioSave(RHDPtr rhdPtr);
  115. void RHDAudioRestore(RHDPtr rhdPtr);
  116.  
  117. void RHDAudioDestroy(RHDPtr rhdPtr);
  118.  
  119. #endif /* _RHD_AUDIO_H */
  120.