diff options
author | Wai Yew CHAY <wychay@ctl.creative.com> | 2009-05-14 02:05:58 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-05-14 02:24:10 -0400 |
commit | 8cc72361481f00253f1e468ade5795427386d593 (patch) | |
tree | ec6f3ea304f90fa9c99abb1bf2354fc5d357db27 /sound/pci/ctxfi/ctresource.h | |
parent | 091bf7624d1c90cec9e578a18529f615213ff847 (diff) |
ALSA: SB X-Fi driver merge
The Sound Blaster X-Fi driver supports Creative solutions based on
20K1 and 20K2 chipsets.
Supported hardware :
Creative Sound Blaster X-Fi Titanium Fatal1ty® Champion Series
Creative Sound Blaster X-Fi Titanium Fatal1ty Professional Series
Creative Sound Blaster X-Fi Titanium Professional Audio
Creative Sound Blaster X-Fi Titanium
Creative Sound Blaster X-Fi Elite Pro
Creative Sound Blaster X-Fi Platinum
Creative Sound Blaster X-Fi Fatal1ty
Creative Sound Blaster X-Fi XtremeGamer
Creative Sound Blaster X-Fi XtremeMusic
Current release features:
* ALSA PCM Playback
* ALSA Record
* ALSA Mixer
Note:
* External I/O modules detection not included.
Signed-off-by: Wai Yew CHAY <wychay@ctl.creative.com>
Singed-off-by: Ryan RICHARDS <ryan_richards@creativelabs.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ctxfi/ctresource.h')
-rw-r--r-- | sound/pci/ctxfi/ctresource.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/sound/pci/ctxfi/ctresource.h b/sound/pci/ctxfi/ctresource.h new file mode 100644 index 000000000000..0838c2e84f8b --- /dev/null +++ b/sound/pci/ctxfi/ctresource.h | |||
@@ -0,0 +1,72 @@ | |||
1 | /** | ||
2 | * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved. | ||
3 | * | ||
4 | * This source file is released under GPL v2 license (no other versions). | ||
5 | * See the COPYING file included in the main directory of this source | ||
6 | * distribution for the license terms and conditions. | ||
7 | * | ||
8 | * @File ctresource.h | ||
9 | * | ||
10 | * @Brief | ||
11 | * This file contains the definition of generic hardware resources for | ||
12 | * resource management. | ||
13 | * | ||
14 | * @Author Liu Chun | ||
15 | * @Date May 13 2008 | ||
16 | * | ||
17 | */ | ||
18 | |||
19 | #ifndef CTRESOURCE_H | ||
20 | #define CTRESOURCE_H | ||
21 | |||
22 | #include <linux/types.h> | ||
23 | |||
24 | enum RSCTYP { | ||
25 | SRC, | ||
26 | SRCIMP, | ||
27 | AMIXER, | ||
28 | SUM, | ||
29 | DAIO, | ||
30 | NUM_RSCTYP /* This must be the last one and less than 16 */ | ||
31 | }; | ||
32 | |||
33 | struct rsc_ops; | ||
34 | |||
35 | struct rsc { | ||
36 | u32 idx:12; /* The index of a resource */ | ||
37 | u32 type:4; /* The type (RSCTYP) of a resource */ | ||
38 | u32 conj:12; /* Current conjugate index */ | ||
39 | u32 msr:4; /* The Master Sample Rate a resource working on */ | ||
40 | void *ctrl_blk; /* Chip specific control info block for a resource */ | ||
41 | void *hw; /* Chip specific object for hardware access means */ | ||
42 | struct rsc_ops *ops; /* Generic resource operations */ | ||
43 | }; | ||
44 | |||
45 | struct rsc_ops { | ||
46 | int (*master)(struct rsc *rsc); /* Move to master resource */ | ||
47 | int (*next_conj)(struct rsc *rsc); /* Move to next conjugate resource */ | ||
48 | int (*index)(const struct rsc *rsc); /* Return the index of resource */ | ||
49 | /* Return the output slot number */ | ||
50 | int (*output_slot)(const struct rsc *rsc); | ||
51 | }; | ||
52 | |||
53 | int rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, void *hw); | ||
54 | int rsc_uninit(struct rsc *rsc); | ||
55 | |||
56 | struct rsc_mgr { | ||
57 | enum RSCTYP type; /* The type (RSCTYP) of resource to manage */ | ||
58 | unsigned int amount; /* The total amount of a kind of resource */ | ||
59 | unsigned int avail; /* The amount of currently available resources */ | ||
60 | unsigned char *rscs; /* The bit-map for resource allocation */ | ||
61 | void *ctrl_blk; /* Chip specific control info block */ | ||
62 | void *hw; /* Chip specific object for hardware access */ | ||
63 | }; | ||
64 | |||
65 | /* Resource management is based on bit-map mechanism */ | ||
66 | int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type, | ||
67 | unsigned int amount, void *hw); | ||
68 | int rsc_mgr_uninit(struct rsc_mgr *mgr); | ||
69 | int mgr_get_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int *ridx); | ||
70 | int mgr_put_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int idx); | ||
71 | |||
72 | #endif /* CTRESOURCE_H */ | ||