| 1 | /*************************************************************************** |
|---|
| 2 | * (c)2004-2011 Broadcom Corporation |
|---|
| 3 | * |
|---|
| 4 | * This program is the proprietary software of Broadcom Corporation and/or its licensors, |
|---|
| 5 | * and may only be used, duplicated, modified or distributed pursuant to the terms and |
|---|
| 6 | * conditions of a separate, written license agreement executed between you and Broadcom |
|---|
| 7 | * (an "Authorized License"). Except as set forth in an Authorized License, Broadcom grants |
|---|
| 8 | * no license (express or implied), right to use, or waiver of any kind with respect to the |
|---|
| 9 | * Software, and Broadcom expressly reserves all rights in and to the Software and all |
|---|
| 10 | * intellectual property rights therein. IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU |
|---|
| 11 | * HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY |
|---|
| 12 | * NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE. |
|---|
| 13 | * |
|---|
| 14 | * Except as expressly set forth in the Authorized License, |
|---|
| 15 | * |
|---|
| 16 | * 1. This program, including its structure, sequence and organization, constitutes the valuable trade |
|---|
| 17 | * secrets of Broadcom, and you shall use all reasonable efforts to protect the confidentiality thereof, |
|---|
| 18 | * and to use this information only in connection with your use of Broadcom integrated circuit products. |
|---|
| 19 | * |
|---|
| 20 | * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" |
|---|
| 21 | * AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR |
|---|
| 22 | * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO |
|---|
| 23 | * THE SOFTWARE. BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL IMPLIED WARRANTIES |
|---|
| 24 | * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, |
|---|
| 25 | * LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION |
|---|
| 26 | * OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF |
|---|
| 27 | * USE OR PERFORMANCE OF THE SOFTWARE. |
|---|
| 28 | * |
|---|
| 29 | * 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS |
|---|
| 30 | * LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR |
|---|
| 31 | * EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR |
|---|
| 32 | * USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF |
|---|
| 33 | * THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT |
|---|
| 34 | * ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE |
|---|
| 35 | * LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF |
|---|
| 36 | * ANY LIMITED REMEDY. |
|---|
| 37 | * |
|---|
| 38 | * $brcm_Workfile: nexus_audio_dac.h $ |
|---|
| 39 | * $brcm_Revision: 13 $ |
|---|
| 40 | * $brcm_Date: 4/22/11 10:43a $ |
|---|
| 41 | * |
|---|
| 42 | * API Description: |
|---|
| 43 | * API name: AudioDac |
|---|
| 44 | * Specific APIs related to audio DAC outputs. |
|---|
| 45 | * |
|---|
| 46 | * Revision History: |
|---|
| 47 | * |
|---|
| 48 | * $brcm_Log: /nexus/modules/audio/7400/include/nexus_audio_dac.h $ |
|---|
| 49 | * |
|---|
| 50 | * 13 4/22/11 10:43a erickson |
|---|
| 51 | * SW7420-1148: remove attr{shutdown=NEXUS_AudioInput_Shutdown} |
|---|
| 52 | * |
|---|
| 53 | * 12 3/25/11 11:55a jgarrett |
|---|
| 54 | * SW7422-375: Refactoring peak gain api |
|---|
| 55 | * |
|---|
| 56 | * 11 3/23/11 7:12p jgarrett |
|---|
| 57 | * SW7422-375: Adding peakingFilter settings |
|---|
| 58 | * |
|---|
| 59 | * 10 12/17/10 3:55p jgarrett |
|---|
| 60 | * SW7422-146: Adding new dac mute settings for 40nm |
|---|
| 61 | * |
|---|
| 62 | * 9 12/14/10 3:18p erickson |
|---|
| 63 | * SW7420-1285: add null_allowed attribute |
|---|
| 64 | * |
|---|
| 65 | * 8 3/18/10 11:16a jgarrett |
|---|
| 66 | * SW3556-940: Changing DAC volume to be cross-platform and dB instead of |
|---|
| 67 | * linear. |
|---|
| 68 | * |
|---|
| 69 | * 7 1/11/10 6:15p jgarrett |
|---|
| 70 | * SW3556-940: Adding DAC scale and volume for DTV systems |
|---|
| 71 | * |
|---|
| 72 | * 6 6/22/09 11:45a jgarrett |
|---|
| 73 | * PR 51633: Adding test tone options and new mute options |
|---|
| 74 | * |
|---|
| 75 | * PR51633/1 5/14/09 3:08p jgarrett |
|---|
| 76 | * PR 51633: Adding test tone options and new mute options |
|---|
| 77 | * |
|---|
| 78 | * 5 2/7/08 12:11p vsilyaev |
|---|
| 79 | * PR 38692: Added attributes for shutdown functions |
|---|
| 80 | * |
|---|
| 81 | * 4 2/6/08 4:28p vsilyaev |
|---|
| 82 | * PR 38682: Added attributes for the linux kernel/user proxy mode |
|---|
| 83 | * |
|---|
| 84 | * 3 1/23/08 9:22p vobadm |
|---|
| 85 | * PR35457: update docs |
|---|
| 86 | * |
|---|
| 87 | * 2 1/23/08 2:39p erickson |
|---|
| 88 | * PR35457: update docs |
|---|
| 89 | * |
|---|
| 90 | * 1 1/18/08 2:15p jgarrett |
|---|
| 91 | * PR 38808: Merging to main branch |
|---|
| 92 | * |
|---|
| 93 | * Nexus_Devel/9 1/8/08 7:00p jgarrett |
|---|
| 94 | * PR 38535: Moving channel order to audio output |
|---|
| 95 | * |
|---|
| 96 | * Nexus_Devel/8 11/29/07 2:24p erickson |
|---|
| 97 | * PR35457: doc update for 0.5 release |
|---|
| 98 | * |
|---|
| 99 | * Nexus_Devel/7 11/6/07 4:22p jgarrett |
|---|
| 100 | * PR 34954: Migrating to audio connector model |
|---|
| 101 | * |
|---|
| 102 | * Nexus_Devel/6 10/4/07 2:25p erickson |
|---|
| 103 | * PR34594: removed audio descriptors |
|---|
| 104 | * |
|---|
| 105 | * Nexus_Devel/5 9/27/07 7:51p jgarrett |
|---|
| 106 | * PR 34954: Successful build |
|---|
| 107 | * |
|---|
| 108 | * Nexus_Devel/4 9/17/07 1:32p jgarrett |
|---|
| 109 | * PR 34954: Implementing naming convention changes |
|---|
| 110 | * |
|---|
| 111 | * Nexus_Devel/3 9/10/07 11:30a jgarrett |
|---|
| 112 | * PR 34254: Adding multiple inclusion protection |
|---|
| 113 | * |
|---|
| 114 | * Nexus_Devel/2 9/6/07 5:12p jgarrett |
|---|
| 115 | * PR 34254: Fixing naming conventions |
|---|
| 116 | * |
|---|
| 117 | * Nexus_Devel/1 8/24/07 11:57a jgarrett |
|---|
| 118 | * PR 34254: Implementing Source -> Input name changes |
|---|
| 119 | * |
|---|
| 120 | ***************************************************************************/ |
|---|
| 121 | #ifndef NEXUS_AUDIO_DAC_H__ |
|---|
| 122 | #define NEXUS_AUDIO_DAC_H__ |
|---|
| 123 | |
|---|
| 124 | #include "nexus_types.h" |
|---|
| 125 | #include "nexus_audio_types.h" |
|---|
| 126 | |
|---|
| 127 | #ifdef __cplusplus |
|---|
| 128 | extern "C" { |
|---|
| 129 | #endif |
|---|
| 130 | |
|---|
| 131 | /*=************************************ |
|---|
| 132 | Interface: AudioDac |
|---|
| 133 | |
|---|
| 134 | Header file: nexus_audio_dac.h |
|---|
| 135 | |
|---|
| 136 | Module: Audio |
|---|
| 137 | |
|---|
| 138 | Description: Route PCM audio data to a set of L/R DAC outputs |
|---|
| 139 | |
|---|
| 140 | **************************************/ |
|---|
| 141 | |
|---|
| 142 | /** |
|---|
| 143 | Summary: |
|---|
| 144 | Handle for audio DAC |
|---|
| 145 | **/ |
|---|
| 146 | typedef struct NEXUS_AudioDac *NEXUS_AudioDacHandle; |
|---|
| 147 | |
|---|
| 148 | /*************************************************************************** |
|---|
| 149 | Summary: |
|---|
| 150 | Audio DAC Mute Modes |
|---|
| 151 | ***************************************************************************/ |
|---|
| 152 | typedef enum NEXUS_AudioDacMuteType |
|---|
| 153 | { |
|---|
| 154 | /* These options are supported only on the 7400/7401 chipsets. */ |
|---|
| 155 | NEXUS_AudioDacMuteType_eConstantLow, |
|---|
| 156 | NEXUS_AudioDacMuteType_eConstantHigh, |
|---|
| 157 | NEXUS_AudioDacMuteType_eSquareWaveOpp, |
|---|
| 158 | NEXUS_AudioDacMuteType_eSquareWaveSame, |
|---|
| 159 | NEXUS_AudioDacMuteType_eAaaa, /* Supported on 7405, 3548, and 7420 classes of 65nm chips */ |
|---|
| 160 | NEXUS_AudioDacMuteType_e5555, /* Supported on 7405, 3548, and 7420 classes of 65nm chips */ |
|---|
| 161 | NEXUS_AudioDacMuteType_eCustomValue, /* Supported on 7405, 3548, and 7420 classes of 65nm chips as well as 40nm chips (7422, 35230, etc.) */ |
|---|
| 162 | NEXUS_AudioDacMuteType_eDrive0, /* Supported on 40nm chips (7422, 35230, etc.) */ |
|---|
| 163 | NEXUS_AudioDacMuteType_eDriveNegative1, /* Supported on 40nm chips (7422, 35230, etc.) */ |
|---|
| 164 | NEXUS_AudioDacMuteType_eMax |
|---|
| 165 | } NEXUS_AudioDacMuteType; |
|---|
| 166 | |
|---|
| 167 | /*************************************************************************** |
|---|
| 168 | Summary: |
|---|
| 169 | Audio DAC Settings |
|---|
| 170 | ***************************************************************************/ |
|---|
| 171 | typedef struct NEXUS_AudioDacSettings |
|---|
| 172 | { |
|---|
| 173 | NEXUS_AudioDacMuteType muteType; |
|---|
| 174 | uint16_t muteValueLeft; /* 16-bit sample, used only if mute type == NEXUS_AudioDacMuteType_eCustomValue */ |
|---|
| 175 | uint16_t muteValueRight; /* 16-bit sample, used only if mute type == NEXUS_AudioDacMuteType_eCustomValue */ |
|---|
| 176 | |
|---|
| 177 | struct |
|---|
| 178 | { |
|---|
| 179 | bool enabled; /* If true, test tone output is enabled with the settings below. If false, the tone output is disabled. */ |
|---|
| 180 | int32_t samples[64]; /* Test tone samples. The samples are 20-bit signed data. */ |
|---|
| 181 | bool zeroOnLeft; /* If true, the left channel will output zeroes */ |
|---|
| 182 | bool zeroOnRight; /* If true, the right channel will output zeroes */ |
|---|
| 183 | bool sharedSamples; /* If true (default), samples 0..63 will be output on both Left and Right. |
|---|
| 184 | If false, samples 0..31 will output on Left and 32..63 on Right. */ |
|---|
| 185 | unsigned numSamplesLeft; /* Number of samples to play on the left channel before repeating (1..64) */ |
|---|
| 186 | unsigned numSamplesRight; /* Number of samples to play on the right channel before repeating (1..64) */ |
|---|
| 187 | unsigned sampleRate; /* Sampling frequency of the samples */ |
|---|
| 188 | } testTone; |
|---|
| 189 | |
|---|
| 190 | uint32_t peakGain; /* PEAK_GAIN - Peaking filter gain */ |
|---|
| 191 | uint32_t scale; /* Affects the setting of the HIFIDAC_CTRLn_SCALE register directly. Applicable to DTV systems only. */ |
|---|
| 192 | int32_t volume; /* Attenuation in 1/100 dB. Ranges from NEXUS_AUDIO_VOLUME_DB_NORMAL to NEXUS_AUDIO_VOLUME_DB_MIN. Default=0. */ |
|---|
| 193 | } NEXUS_AudioDacSettings; |
|---|
| 194 | |
|---|
| 195 | /*************************************************************************** |
|---|
| 196 | Summary: |
|---|
| 197 | Get default settings for an audio DAC |
|---|
| 198 | ***************************************************************************/ |
|---|
| 199 | void NEXUS_AudioDac_GetDefaultSettings( |
|---|
| 200 | NEXUS_AudioDacSettings *pSettings /* [out] default settings */ |
|---|
| 201 | ); |
|---|
| 202 | |
|---|
| 203 | /*************************************************************************** |
|---|
| 204 | Summary: |
|---|
| 205 | Open an audio DAC |
|---|
| 206 | ***************************************************************************/ |
|---|
| 207 | NEXUS_AudioDacHandle NEXUS_AudioDac_Open( /* attr{destructor=NEXUS_AudioDac_Close} */ |
|---|
| 208 | unsigned index, |
|---|
| 209 | const NEXUS_AudioDacSettings *pSettings /* attr{null_allowed=y} */ |
|---|
| 210 | ); |
|---|
| 211 | |
|---|
| 212 | /*************************************************************************** |
|---|
| 213 | Summary: |
|---|
| 214 | Close an audio DAC |
|---|
| 215 | |
|---|
| 216 | Description: |
|---|
| 217 | Input to the DAC must be removed prior to closing. |
|---|
| 218 | ***************************************************************************/ |
|---|
| 219 | void NEXUS_AudioDac_Close( |
|---|
| 220 | NEXUS_AudioDacHandle handle |
|---|
| 221 | ); |
|---|
| 222 | |
|---|
| 223 | /*************************************************************************** |
|---|
| 224 | Summary: |
|---|
| 225 | Get Settings for an audio DAC |
|---|
| 226 | ***************************************************************************/ |
|---|
| 227 | void NEXUS_AudioDac_GetSettings( |
|---|
| 228 | NEXUS_AudioDacHandle handle, |
|---|
| 229 | NEXUS_AudioDacSettings *pSettings /* [out] Settings */ |
|---|
| 230 | ); |
|---|
| 231 | |
|---|
| 232 | /*************************************************************************** |
|---|
| 233 | Summary: |
|---|
| 234 | Set Settings for an audio DAC |
|---|
| 235 | ***************************************************************************/ |
|---|
| 236 | NEXUS_Error NEXUS_AudioDac_SetSettings( |
|---|
| 237 | NEXUS_AudioDacHandle handle, |
|---|
| 238 | const NEXUS_AudioDacSettings *pSettings /* [in] Settings */ |
|---|
| 239 | ); |
|---|
| 240 | |
|---|
| 241 | /*************************************************************************** |
|---|
| 242 | Summary: |
|---|
| 243 | Get the audio connector for an audio DAC |
|---|
| 244 | ***************************************************************************/ |
|---|
| 245 | NEXUS_AudioOutput NEXUS_AudioDac_GetConnector( |
|---|
| 246 | NEXUS_AudioDacHandle handle |
|---|
| 247 | ); |
|---|
| 248 | |
|---|
| 249 | #ifdef __cplusplus |
|---|
| 250 | } |
|---|
| 251 | #endif |
|---|
| 252 | |
|---|
| 253 | #endif /* #ifndef NEXUS_AUDIO_DAC_H__ */ |
|---|
| 254 | |
|---|