~ubuntu-branches/ubuntu/oneiric/oss4/oneiric-proposed

« back to all changes in this revision

Viewing changes to kernel/drv/oss_sbxfi/sbxfi.h

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Rivera
  • Date: 2011-06-16 20:37:48 UTC
  • mfrom: (5.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110616203748-jbrxik6ql33z54co
Tags: 4.2-build2004-1ubuntu1
* Merge from Debian unstable.
  - Supports our current kernel (LP: #746048)
  Remaining changes:
  - debian/oss4-dkms.dkms.in: s/source/build/ in Kernel headers paths.
* ld-as-needed.patch: Re-order CC arguments to enable building with ld
  --as-needed (LP: #770972)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *
 
3
 * This file is part of Open Sound System.
 
4
 *
 
5
 * Copyright (C) 4Front Technologies 1996-2008.
 
6
 *
 
7
 * This this source file is released under GPL v2 license (no other versions).
 
8
 * See the COPYING file included in the main directory of this source
 
9
 * distribution for the license terms and conditions.
 
10
 *
 
11
 */
 
12
 
 
13
#define PCI_SUBDEVICE_ID_CREATIVE_SB0760        0x0024
 
14
#define PCI_SUBDEVICE_ID_CREATIVE_SB08801       0x0041
 
15
#define PCI_SUBDEVICE_ID_CREATIVE_SB08802       0x0042
 
16
#define PCI_SUBDEVICE_ID_CREATIVE_SB08803       0x0043
 
17
 
 
18
#define MAX_OUTPUTDEVS  1
 
19
#define MAX_INPUTDEVS   1
 
20
#define SUPPORTED_FORMAT        (AFMT_S16_LE)
 
21
 
 
22
#define MIXER_VOLSTEPS  144     /* Centibel steps */
 
23
 
 
24
//#define MAX_PLAY_CHANNELS     6 /* Does not work */
 
25
#define MAX_PLAY_CHANNELS       2
 
26
 
 
27
#if 0
 
28
typedef unsigned char CTBYTE, *PCTBYTE;
 
29
typedef unsigned short unsigned short, *Punsigned short;
 
30
typedef signed short CTSHORT, *PCTSHORT;
 
31
typedef unsigned int unsigned int, *unsigned int *;
 
32
typedef signed long CTLONG, *PCTLONG;
 
33
typedef void CTVOID, *PCTVOID;
 
34
typedef unsigned int CTBOOL, *PCTBOOL;
 
35
typedef unsigned int CTUINT, *PCTUINT;
 
36
#endif
 
37
 
 
38
#ifndef TRUE
 
39
#define TRUE 1
 
40
#endif
 
41
 
 
42
#ifndef FALSE
 
43
#define FALSE 0
 
44
#endif
 
45
 
 
46
typedef unsigned int CTSTATUS;
 
47
typedef oss_native_word IOADDR;
 
48
 
 
49
enum GlobalErrorCode
 
50
{
 
51
  CTSTATUS_SUCCESS = 0x0000,
 
52
  CTSTATUS_ERROR,
 
53
  CTSTATUS_INVALIDPARAM,
 
54
  CTSTATUS_NOTSUPPORTED,
 
55
  CTSTATUS_NOMEMORY,
 
56
  CTSTATUS_INVALIDIO,
 
57
  CTSTATUS_INVALIDIRQ,
 
58
  CTSTATUS_INVALIDDMA,
 
59
  CTSTATUS_INVALIDID,
 
60
  CTSTATUS_INVALIDVALUE,
 
61
  CTSTATUS_BADFORMAT_BITS,
 
62
  CTSTATUS_BADFORMAT_RATE,
 
63
  CTSTATUS_BADFORMAT_CHANNELS,
 
64
  CTSTATUS_INUSE,
 
65
  CTSTATUS_STILLPLAYING,
 
66
  CTSTATUS_ALLOCATED,
 
67
  CTSTATUS_INVALID_FORMAT,
 
68
  CTSTATUS_OUT_OF_RESOURCE,
 
69
  CTSTATUS_CHIP_INUSE,
 
70
  CTSTATUS_NOCHIPRESOURCE,
 
71
  CTSTATUS_PORTS_INUSE,
 
72
  CTSTATUS_EXIT,
 
73
  CTSTATUS_FAILURE
 
74
};
 
75
 
 
76
 
 
77
#define ADC_SRC_MICIN       0x0
 
78
#define ADC_SRC_LINEIN      0x1
 
79
#define ADC_SRC_VIDEO       0x2
 
80
#define ADC_SRC_AUX         0x3
 
81
#define ADC_SRC_NONE        0x4
 
82
 
 
83
typedef struct
 
84
{
 
85
  char *name;
 
86
  int dev;
 
87
  int open_mode;
 
88
  int fmt;
 
89
  int dev_flags;
 
90
  int direction;
 
91
  int state_bits;
 
92
  int pgtable_index;    // Pointer to the first page table entry
 
93
 
 
94
  int running;
 
95
 
 
96
  int channels;
 
97
 
 
98
  unsigned int rate;
 
99
 
 
100
  // Audio Ring resources
 
101
  unsigned int SrcChan;
 
102
 
 
103
  unsigned int dwDAChan[MAX_PLAY_CHANNELS];
 
104
 
 
105
  // Play volumes
 
106
  int vol_left, vol_right;
 
107
} sbxfi_portc_t;
 
108
 
 
109
typedef struct
 
110
{
 
111
  oss_device_t *osdev;
 
112
  oss_mutex_t mutex;
 
113
  oss_mutex_t low_mutex;
 
114
 
 
115
  char *name;
 
116
  int hw_family;
 
117
 
 
118
// 20K1 models
 
119
#define HW_ORIG         0x0001
 
120
#define HW_073x         0x0002
 
121
#define HW_055x         0x0004
 
122
#define HW_UAA          0x0008
 
123
 
 
124
// 20K2 models
 
125
#define HW_0760        0x0010
 
126
#define HW_08801       0x0020
 
127
#define HW_08802       0x0040
 
128
#define HW_08803       0x0080
 
129
 
 
130
 
 
131
  unsigned int interrupt_count;
 
132
 
 
133
  // Hardware IDs
 
134
  unsigned short wVendorID;
 
135
  unsigned short wDeviceID;
 
136
  unsigned short wSubsystemVendorID;
 
137
  unsigned short wSubsystemID;
 
138
  unsigned short wChipRevision;
 
139
 
 
140
  // Hardware Resources
 
141
  unsigned int dwMemBase;
 
142
  unsigned short wIOPortBase;
 
143
 
 
144
  // Buffers
 
145
  oss_native_word dwPTBPhysAddx;
 
146
  unsigned int *pdwPageTable;
 
147
  unsigned int dwPageTableSize;
 
148
  oss_dma_handle_t pgtable_dma_handle;
 
149
  int next_pg;  /* Next free index in the page table */
 
150
 
 
151
  sbxfi_portc_t play_portc[MAX_OUTPUTDEVS];
 
152
  int nr_outdevs;
 
153
 
 
154
  sbxfi_portc_t rec_portc[MAX_INPUTDEVS];
 
155
  int nr_indevs;
 
156
 
 
157
  // Mixer
 
158
  int mixer_dev;
 
159
 
 
160
  // Audio
 
161
  int first_dev;
 
162
 
 
163
  int next_src; // Next free SRC channel
 
164
 
 
165
  sbxfi_portc_t *src_to_portc[256];
 
166
} sbxfi_devc_t;