2 * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved.
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.
11 * This file contains the definition of hardware access methord.
21 #include <linux/types.h>
22 #include <linux/pci.h>
30 /* Type of input source for ADC */
36 ADC_NONE
/* Switch to digital input */
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 */
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
);
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
);
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
);
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
);
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
);
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
);
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
,
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
);
148 struct pci_dev
*pci
; /* the pci kernel structure of this card */
150 unsigned long io_base
;
151 unsigned long mem_base
;
154 int create_hw_obj(struct pci_dev
*pci
, struct hw
**rhw
);
155 int destroy_hw_obj(struct hw
*hw
);
157 unsigned int get_field(unsigned int data
, unsigned int field
);
158 void set_field(unsigned int *data
, unsigned int field
, unsigned int value
);
160 #endif /* CTHARDWARE_H */
This page took 0.043271 seconds and 5 git commands to generate.