summaryrefslogtreecommitdiff
path: root/Protocol/SimpleAudioOut/SimpleAudioOut.h
blob: 92844806a70a4a8a9f4e310d3848a8e7bbf4080f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
//
// This file contains 'Framework Code' and is licensed as such 
// under the terms of your license agreement with Intel or your
// vendor.  This file may not be modified, except as allowed by
// additional terms of your license agreement.                 
//
/*++

Copyright (c)  1999 - 2002 Intel Corporation. All rights reserved
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.


Module Name:

    SimpleAudioOut.h
    
Abstract:

    EFI Simple Audio Out Protocol 

Revision History

--*/

#ifndef _EFI_SIMPLE_AUDIO_OUT_H_
#define _EFI_SIMPLE_AUDIO_OUT_H_

//
// GUID for Simple Audio Out Protocol
//
#define EFI_SIMPLE_AUDIO_OUT_PROTOCOL_GUID \
  { \
    0xc723f288, 0x52f9, 0x4d80, 0xb6, 0x33, 0xe1, 0x52, 0xf9, 0x30, 0xa0, 0xdc \
  }

EFI_FORWARD_DECLARATION (EFI_SIMPLE_AUDIO_OUT_PROTOCOL);

typedef enum {
  EfiAudioOutStart,
  EfiAudioOutPause,
  EfiAudioOutContinue,
  EfiAudioOutStop
} EFI_SIMPLE_AUDIO_OUT_OPERATION;

typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_AUDIO_OUT_STREAM_OPERATION) (
  IN EFI_SIMPLE_AUDIO_OUT_PROTOCOL                         * This,
  IN     EFI_SIMPLE_AUDIO_OUT_OPERATION                    Operation,
  IN     UINT8                                             *Buffer OPTIONAL,
  IN     UINT32                                            BufferSize OPTIONAL
  );

#define EFI_SIMPLE_AUDIO_OUT_STATE_BUFFER_DRAIN 0x00000001

typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_AUDIO_OUT_QUERY_STATE) (
  IN EFI_SIMPLE_AUDIO_OUT_PROTOCOL           * This,
  OUT UINT32                                 *State
  );

//
// Ac97 Audio channel definition
//
typedef enum _AC97_AUDIO_CHANNEL_NUMBER
{
  Ac97Channels2       = 0,
  Ac97Channels4       = 1,
  Ac97Channels6       = 2,
} AC97_AUDIO_CHANNEL_NUMBER;

//
// Ac97 Audio mode definition
//
typedef enum _AC97_AUDIO_PCM_MODE
{
  Ac97Audio16Bit      = 0,
  Ac97Audio20Bit      = 1,
} AC97_AUDIO_PCM_MODE;

//
// Ac97 Audio volume definition
//
#pragma pack(1)

typedef struct {
  UINT16  RigthChannelVol : 6;
  UINT16  Reserved1 : 2;
  UINT16  LeftChannelVol : 6;
  UINT16  Reserved2 : 1;
  UINT16  Mute : 1;
} AC97_AUDIO_GENERAL_VOLUME;

typedef struct {
  UINT16  Treble : 4;
  UINT16  Reserved1 : 4;
  UINT16  Bass : 4;
  UINT16  Reserved2 : 4;
} AC97_AUDIO_GENERAL_TONE;

#pragma pack()
//
// Ac97 Audio driver attribute definition
//
typedef enum {
  EfiAudioOutChannelNumber,
  EfiAudioOutSampleRate,
  EfiAudioOutPcmMode,
  EfiAudioOutMasterVolume,
  EfiAudioOutAuxVolume,
  EfiAudioOutMonoVolume,
  EfiAudioOutMasterTone,
} EFI_SIMPLE_AUDIO_OUT_ATTRIBUTE_TARGET;

typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_AUDIO_OUT_GET_ATTRIBUTE) (
  IN EFI_SIMPLE_AUDIO_OUT_PROTOCOL              * This,
  IN     EFI_SIMPLE_AUDIO_OUT_ATTRIBUTE_TARGET  Target,
  OUT VOID                                      *Buffer,
  IN     UINT32                                 BufferSize
  );

typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_AUDIO_OUT_SET_ATTRIBUTE) (
  IN EFI_SIMPLE_AUDIO_OUT_PROTOCOL              * This,
  IN     EFI_SIMPLE_AUDIO_OUT_ATTRIBUTE_TARGET  Target,
  IN     VOID                                   *Buffer,
  IN     UINT32                                 BufferSize
  );

typedef struct _EFI_SIMPLE_AUDIO_OUT_PROTOCOL {
  EFI_SIMPLE_AUDIO_OUT_STREAM_OPERATION StreamOperation;
  EFI_SIMPLE_AUDIO_OUT_QUERY_STATE      QueryState;
  EFI_SIMPLE_AUDIO_OUT_GET_ATTRIBUTE    GetAttribute;
  EFI_SIMPLE_AUDIO_OUT_SET_ATTRIBUTE    SetAttribute;
} EFI_SIMPLE_AUDIO_OUT_PROTOCOL;

extern EFI_GUID gEfiSimpleAudioOutProtocolGuid;

#endif