aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ctxfi/cthardware.h
diff options
context:
space:
mode:
authorWai Yew CHAY <wychay@ctl.creative.com>2009-05-14 02:05:58 -0400
committerTakashi Iwai <tiwai@suse.de>2009-05-14 02:24:10 -0400
commit8cc72361481f00253f1e468ade5795427386d593 (patch)
treeec6f3ea304f90fa9c99abb1bf2354fc5d357db27 /sound/pci/ctxfi/cthardware.h
parent091bf7624d1c90cec9e578a18529f615213ff847 (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/cthardware.h')
-rw-r--r--sound/pci/ctxfi/cthardware.h160
1 files changed, 160 insertions, 0 deletions
diff --git a/sound/pci/ctxfi/cthardware.h b/sound/pci/ctxfi/cthardware.h
new file mode 100644
index 000000000000..b0512df8b334
--- /dev/null
+++ b/sound/pci/ctxfi/cthardware.h
@@ -0,0 +1,160 @@
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 cthardware.h
9 *
10 * @Brief
11 * This file contains the definition of hardware access methord.
12 *
13 * @Author Liu Chun
14 * @Date May 13 2008
15 *
16 */
17
18#ifndef CTHARDWARE_H
19#define CTHARDWARE_H
20
21#include <linux/types.h>
22#include <linux/pci.h>
23
24enum CHIPTYP {
25 ATC20K1,
26 ATC20K2,
27 ATCNONE
28};
29
30/* Type of input source for ADC */
31enum ADCSRC{
32 ADC_MICIN,
33 ADC_LINEIN,
34 ADC_VIDEO,
35 ADC_AUX,
36 ADC_NONE /* Switch to digital input */
37};
38
39struct card_conf {
40 /* device virtual mem page table page physical addr
41 * (supporting one page table page now) */
42 unsigned long vm_pgt_phys;
43 unsigned int rsr; /* reference sample rate in Hzs*/
44 unsigned int msr; /* master sample rate in rsrs */
45};
46
47struct hw {
48 int (*card_init)(struct hw *hw, struct card_conf *info);
49 int (*card_stop)(struct hw *hw);
50 int (*pll_init)(struct hw *hw, unsigned int rsr);
51 enum CHIPTYP (*get_chip_type)(struct hw *hw);
52 int (*is_adc_source_selected)(struct hw *hw, enum ADCSRC source);
53 int (*select_adc_source)(struct hw *hw, enum ADCSRC source);
54 int (*have_digit_io_switch)(struct hw *hw);
55
56 /* SRC operations */
57 int (*src_rsc_get_ctrl_blk)(void **rblk);
58 int (*src_rsc_put_ctrl_blk)(void *blk);
59 int (*src_set_state)(void *blk, unsigned int state);
60 int (*src_set_bm)(void *blk, unsigned int bm);
61 int (*src_set_rsr)(void *blk, unsigned int rsr);
62 int (*src_set_sf)(void *blk, unsigned int sf);
63 int (*src_set_wr)(void *blk, unsigned int wr);
64 int (*src_set_pm)(void *blk, unsigned int pm);
65 int (*src_set_rom)(void *blk, unsigned int rom);
66 int (*src_set_vo)(void *blk, unsigned int vo);
67 int (*src_set_st)(void *blk, unsigned int st);
68 int (*src_set_ie)(void *blk, unsigned int ie);
69 int (*src_set_ilsz)(void *blk, unsigned int ilsz);
70 int (*src_set_bp)(void *blk, unsigned int bp);
71 int (*src_set_cisz)(void *blk, unsigned int cisz);
72 int (*src_set_ca)(void *blk, unsigned int ca);
73 int (*src_set_sa)(void *blk, unsigned int sa);
74 int (*src_set_la)(void *blk, unsigned int la);
75 int (*src_set_pitch)(void *blk, unsigned int pitch);
76 int (*src_set_clear_zbufs)(void *blk, unsigned int clear);
77 int (*src_set_dirty)(void *blk, unsigned int flags);
78 int (*src_set_dirty_all)(void *blk);
79 int (*src_commit_write)(struct hw *hw, unsigned int idx, void *blk);
80 int (*src_get_ca)(struct hw *hw, unsigned int idx, void *blk);
81 unsigned int (*src_get_dirty)(void *blk);
82 unsigned int (*src_dirty_conj_mask)(void);
83 int (*src_mgr_get_ctrl_blk)(void **rblk);
84 int (*src_mgr_put_ctrl_blk)(void *blk);
85 /* syncly enable src @idx */
86 int (*src_mgr_enbs_src)(void *blk, unsigned int idx);
87 /* enable src @idx */
88 int (*src_mgr_enb_src)(void *blk, unsigned int idx);
89 /* disable src @idx */
90 int (*src_mgr_dsb_src)(void *blk, unsigned int idx);
91 int (*src_mgr_commit_write)(struct hw *hw, void *blk);
92
93 /* SRC Input Mapper operations */
94 int (*srcimp_mgr_get_ctrl_blk)(void **rblk);
95 int (*srcimp_mgr_put_ctrl_blk)(void *blk);
96 int (*srcimp_mgr_set_imaparc)(void *blk, unsigned int slot);
97 int (*srcimp_mgr_set_imapuser)(void *blk, unsigned int user);
98 int (*srcimp_mgr_set_imapnxt)(void *blk, unsigned int next);
99 int (*srcimp_mgr_set_imapaddr)(void *blk, unsigned int addr);
100 int (*srcimp_mgr_commit_write)(struct hw *hw, void *blk);
101
102 /* AMIXER operations */
103 int (*amixer_rsc_get_ctrl_blk)(void **rblk);
104 int (*amixer_rsc_put_ctrl_blk)(void *blk);
105 int (*amixer_mgr_get_ctrl_blk)(void **rblk);
106 int (*amixer_mgr_put_ctrl_blk)(void *blk);
107 int (*amixer_set_mode)(void *blk, unsigned int mode);
108 int (*amixer_set_iv)(void *blk, unsigned int iv);
109 int (*amixer_set_x)(void *blk, unsigned int x);
110 int (*amixer_set_y)(void *blk, unsigned int y);
111 int (*amixer_set_sadr)(void *blk, unsigned int sadr);
112 int (*amixer_set_se)(void *blk, unsigned int se);
113 int (*amixer_set_dirty)(void *blk, unsigned int flags);
114 int (*amixer_set_dirty_all)(void *blk);
115 int (*amixer_commit_write)(struct hw *hw, unsigned int idx, void *blk);
116 int (*amixer_get_y)(void *blk);
117 unsigned int (*amixer_get_dirty)(void *blk);
118
119 /* DAIO operations */
120 int (*dai_get_ctrl_blk)(void **rblk);
121 int (*dai_put_ctrl_blk)(void *blk);
122 int (*dai_srt_set_srco)(void *blk, unsigned int src);
123 int (*dai_srt_set_srcm)(void *blk, unsigned int src);
124 int (*dai_srt_set_rsr)(void *blk, unsigned int rsr);
125 int (*dai_srt_set_drat)(void *blk, unsigned int drat);
126 int (*dai_srt_set_ec)(void *blk, unsigned int ec);
127 int (*dai_srt_set_et)(void *blk, unsigned int et);
128 int (*dai_commit_write)(struct hw *hw, unsigned int idx, void *blk);
129 int (*dao_get_ctrl_blk)(void **rblk);
130 int (*dao_put_ctrl_blk)(void *blk);
131 int (*dao_set_spos)(void *blk, unsigned int spos);
132 int (*dao_commit_write)(struct hw *hw, unsigned int idx, void *blk);
133 int (*dao_get_spos)(void *blk, unsigned int *spos);
134
135 int (*daio_mgr_get_ctrl_blk)(struct hw *hw, void **rblk);
136 int (*daio_mgr_put_ctrl_blk)(void *blk);
137 int (*daio_mgr_enb_dai)(void *blk, unsigned int idx);
138 int (*daio_mgr_dsb_dai)(void *blk, unsigned int idx);
139 int (*daio_mgr_enb_dao)(void *blk, unsigned int idx);
140 int (*daio_mgr_dsb_dao)(void *blk, unsigned int idx);
141 int (*daio_mgr_dao_init)(void *blk, unsigned int idx,
142 unsigned int conf);
143 int (*daio_mgr_set_imaparc)(void *blk, unsigned int slot);
144 int (*daio_mgr_set_imapnxt)(void *blk, unsigned int next);
145 int (*daio_mgr_set_imapaddr)(void *blk, unsigned int addr);
146 int (*daio_mgr_commit_write)(struct hw *hw, void *blk);
147
148 struct pci_dev *pci; /* the pci kernel structure of this card */
149 int irq;
150 unsigned long io_base;
151 unsigned long mem_base;
152};
153
154int create_hw_obj(struct pci_dev *pci, struct hw **rhw);
155int destroy_hw_obj(struct hw *hw);
156
157unsigned int get_field(unsigned int data, unsigned int field);
158void set_field(unsigned int *data, unsigned int field, unsigned int value);
159
160#endif /* CTHARDWARE_H */